YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat: use mac npu for audio/STT +docs
Louis Beaumont4a5d48e893e6
diff --git a/Cargo.toml b/Cargo.tomlindex 715eb257d..9d5e43b0f 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -13,3 +13,8 @@ edition = "2021"[workspace.dependencies]log = "0.4"+candle = { package = "candle-core", version = "0.6.0", features = ["metal"] } # not sure if this cause problem if user uses CPU or CUDA? should it be a feature?+candle-nn = { package = "candle-nn", version = "0.6.0", features = ["metal"] }+candle-transformers = { package = "candle-transformers", version = "0.6.0", features = ["metal"] }+tokenizers = "0.19.1"+diff --git a/README.md b/README.mdindex a54abe589..971ba9ea8 100644--- a/README.md+++ b/README.md@@ -188,6 +188,8 @@ Contributions are welcome! If you'd like to contribute, please fork the repositoSay 👋 in our [public Discord channel](https://discord.gg/dU9EBuw7Uq) . We discuss how to bring this lib to production, help each other with contributions, personal projects or just hang out ☕.+Bit more details on the architecture [here](https://link.excalidraw.com/l/5MKXLddifTr/8subenQGvcd).+## LicensingThe code in this project is licensed under MIT license. See the [LICENSE](LICENSE.md) file for more information.diff --git a/screenpipe-audio/Cargo.toml b/screenpipe-audio/Cargo.tomlindex 8305ba5e5..a06eeed5a 100644--- a/screenpipe-audio/Cargo.toml+++ b/screenpipe-audio/Cargo.toml@@ -25,10 +25,10 @@ chrono = { version = "0.4.31", features = ["serde"] }# Local Embeddings + STT# TODO: feature metal, cuda, etc. see https://github.com/huggingface/candle/blob/main/candle-core/Cargo.toml-candle = { package = "candle-core", version = "0.3.2" } # atm got seg fault w features = ["metal"] ♥️-candle-nn = "0.3.2"-candle-transformers = "0.3.2"-tokenizers = "0.19.1"+candle = { workspace = true }+candle-nn = { workspace = true }+candle-transformers = { workspace = true }+tokenizers = { workspace = true }lazy_static = "1.4.0"base64 = "0.21.7"anyhow = "1.0.86"diff --git a/screenpipe-audio/src/stt.rs b/screenpipe-audio/src/stt.rsindex 2cd3151c2..e8fcd485c 100644--- a/screenpipe-audio/src/stt.rs+++ b/screenpipe-audio/src/stt.rs@@ -346,62 +346,6 @@ enum Task {Translate,}-#[derive(Clone, Copy, Debug, PartialEq, Eq)]-enum WhichModel {- Tiny,- TinyEn,- Base,- BaseEn,- Small,- SmallEn,- Medium,- MediumEn,- Large,- LargeV2,- LargeV3,- DistilMediumEn,- DistilLargeV2,- DistilLargeV3,-}--impl WhichModel {- fn is_multilingual(&self) -> bool {- match self {- Self::Tiny- | Self::Base- | Self::Small- | Self::Medium- | Self::Large- | Self::LargeV2- | Self::LargeV3- | Self::DistilLargeV2- | Self::DistilLargeV3 => true,- Self::TinyEn | Self::BaseEn | Self::SmallEn | Self::MediumEn | Self::DistilMediumEn => {- false- }- }- }-- fn model_and_revision(&self) -> (&'static str, &'static str) {- match self {- Self::Tiny => ("openai/whisper-tiny", "main"),- Self::TinyEn => ("openai/whisper-tiny.en", "refs/pr/15"),- Self::Base => ("openai/whisper-base", "refs/pr/22"),- Self::BaseEn => ("openai/whisper-base.en", "refs/pr/13"),- Self::Small => ("openai/whisper-small", "main"),- Self::SmallEn => ("openai/whisper-small.en", "refs/pr/10"),- Self::Medium => ("openai/whisper-medium", "main"),- Self::MediumEn => ("openai/whisper-medium.en", "main"),- Self::Large => ("openai/whisper-large", "refs/pr/36"),- Self::LargeV2 => ("openai/whisper-large-v2", "refs/pr/57"),- Self::LargeV3 => ("openai/whisper-large-v3", "main"),- Self::DistilMediumEn => ("distil-whisper/distil-medium.en", "main"),- Self::DistilLargeV2 => ("distil-whisper/distil-large-v2", "main"),- Self::DistilLargeV3 => ("distil-whisper/distil-large-v3", "main"),- }- }-}-pub fn stt(input: &str) -> Result<String> {info!("Starting speech to text");// ! hack assuming device on 0 and that everyone wants to use AI acceleratordiff --git a/screenpipe-server/Cargo.toml b/screenpipe-server/Cargo.tomlindex fd3587c1f..0dedde5dd 100644--- a/screenpipe-server/Cargo.toml+++ b/screenpipe-server/Cargo.toml@@ -36,10 +36,10 @@ sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio-native-tls", "chrffmpeg-next = "7.0.2"# Local Embeddings + STT-candle = { package = "candle-core", version = "0.3.2" }-candle-nn = "0.3.2"-candle-transformers = "0.3.2"-tokenizers = "0.15.0"+candle = { workspace = true }+candle-nn = { workspace = true }+candle-transformers = { workspace = true }+tokenizers = { workspace = true }lazy_static = "1.4.0"base64 = "0.21.7"anyhow = "1.0.86"diff --git a/screenpipe-server/src/core.rs b/screenpipe-server/src/core.rsindex f21cd20fa..0542b9e10 100644--- a/screenpipe-server/src/core.rs+++ b/screenpipe-server/src/core.rs@@ -162,6 +162,8 @@ pub async fn start_continuous_recording(}Err(e) => {error!("Failed to receive audio chunk: {}", e);+ // should terminate the thread+ break;}}}diff --git a/screenpipe-vision/Cargo.toml b/screenpipe-vision/Cargo.tomlindex 2e338f3b4..ec91746b0 100644--- a/screenpipe-vision/Cargo.toml+++ b/screenpipe-vision/Cargo.toml@@ -31,10 +31,10 @@ rusty-tesseract = "1.1.10"chrono = { version = "0.4.31", features = ["serde"] }# Local Embeddings-candle = { package = "candle-core", version = "0.3.2" }-candle-nn = "0.3.2"-candle-transformers = "0.3.2"-tokenizers = "0.15.0"+candle = { workspace = true }+candle-nn = { workspace = true }+candle-transformers = { workspace = true }+tokenizers = { workspace = true }lazy_static = "1.4.0"base64 = "0.21.7"anyhow = "1.0.86"