Skip to content

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

release-app

Louis Beaumont5473423e3e1d
diff --git a/screenpipe-app-tauri/app/page.tsx b/screenpipe-app-tauri/app/page.tsx
index 51faeb106..c98441bd6 100644
--- a/screenpipe-app-tauri/app/page.tsx
+++ b/screenpipe-app-tauri/app/page.tsx
@@ -22,7 +22,8 @@ import { relaunch } from "@tauri-apps/plugin-process";
import { PipeApi } from "@/lib/api";
import localforage from "localforage";
import { onOpenUrl } from "@tauri-apps/plugin-deep-link";
-import { LoginDialog } from "@/components/login-dialog";
+import { LoginDialog } from "../components/login-dialog";
+import { ModelDownloadTracker } from "../components/model-download-tracker";
export default function Home() {
const { settings, updateSettings, loadUser, reloadStore } = useSettings();
@@ -33,6 +34,7 @@ export default function Home() {
const { open: openStatusDialog } = useStatusDialog();
const { setIsOpen: setSettingsOpen } = useSettingsDialog();
const isProcessingRef = React.useRef(false);
+
useEffect(() => {
if (settings.user?.token) {
loadUser(settings.user.token);
@@ -227,7 +229,7 @@ export default function Home() {
return (
<div className="flex flex-col items-center flex-1 max-w-screen-2xl mx-auto relative">
<LoginDialog />
-
+ <ModelDownloadTracker />
<NotificationHandler />
{showOnboarding ? (
<Onboarding />
diff --git a/screenpipe-app-tauri/components/model-download-tracker.tsx b/screenpipe-app-tauri/components/model-download-tracker.tsx
new file mode 100644
index 000000000..40981c64e
--- /dev/null
+++ b/screenpipe-app-tauri/components/model-download-tracker.tsx
@@ -0,0 +1,149 @@
+"use client";
+
+import { useToast } from "@/components/ui/use-toast";
+import { listen } from "@tauri-apps/api/event";
+import { useEffect, useState } from "react";
+import { Progress } from "./ui/progress";
+import { AlertCircle, Download } from "lucide-react";
+
+export function ModelDownloadTracker() {
+ const { toast, dismiss } = useToast();
+ const [activeDownloads, setActiveDownloads] = useState<
+ Record<string, boolean>
+ >({});
+ const [toastIds, setToastIds] = useState<Record<string, string>>({});
+
+ useEffect(() => {
+ // Patterns to look for in logs
+ const downloadStartPatterns = [
+ { regex: /downloading from (.*?)\/([^\/]+)/, group: 2 },
+ { regex: /downloading (.*?) file/, group: 1 },
+ { regex: /downloading ([^,]+)/, group: 1 },
+ { regex: /downloading.*model.*?([\w-]+)/, group: 1 },
+ { regex: /downloading model/, group: 1 },
+ ];
+
+ const downloadEndPatterns = [
+ { regex: /Downloaded (.*?) to/, group: 1 },
+ { regex: /successfully downloaded ([^,]+)/, group: 1 },
+ { regex: /model ([\w-]+) downloaded/, group: 1 },
+ { regex: /model ([\w-]+) downloaded/, group: 1 },
+ { regex: /model downloaded/, group: 1 },
+ ];
+
+ // Function to extract model name from log line
+ const getModelName = (
+ line: string,
+ patterns: { regex: RegExp; group: number }[]
+ ) => {
+ for (const pattern of patterns) {
+ const match = line.match(pattern.regex);
+ if (match && match[pattern.group]) {
+ return match[pattern.group].trim();
+ }
+ }
+ return null;
+ };
+
+ const unlisten = listen<string>("sidecar_log", (event) => {
+ const line = event.payload.toLowerCase();
+
+ // Skip lines that don't look like download related
+ if (
+ !line.includes("download") &&
+ !line.includes("model") &&
+ !line.includes("cache")
+ ) {
+ return;
+ }
+
+ // Check for download start
+ const modelStarting = getModelName(line, downloadStartPatterns);
+ if (modelStarting && !activeDownloads[modelStarting]) {
+ console.log(`Detected model download starting: ${modelStarting}`);
+
+ // Show toast for download start
+ const id = toast({
+ title: "downloading model",
+ description: (
+ <div className="flex flex-col gap-2">
+ <div className="flex items-center gap-2">
+ <Download className="h-4 w-4" />
+ <span>{modelStarting}</span>
+ </div>
+ <Progress value={33} className="h-1" />
+ </div>
+ ),
+ duration: Infinity, // Will be manually closed when download completes
+ }).id;
+
+ // Store toast ID so we can update it later
+ setToastIds((prev) => ({ ...prev, [modelStarting]: id }));
+ setActiveDownloads((prev) => ({ ...prev, [modelStarting]: true }));
+ }
+
+ // Check for download completion
+ const modelCompleted = getModelName(line, downloadEndPatterns);
+ if (modelCompleted && activeDownloads[modelCompleted]) {
+ console.log(`Detected model download completed: ${modelCompleted}`);
+
+ // Close the "downloading" toast
+ if (toastIds[modelCompleted]) {
+ dismiss(toastIds[modelCompleted]);
+ }
+
+ // Show completion toast
+ toast({
+ title: "model downloaded",
+ description: `${modelCompleted} is ready to use`,
+ duration: 3000,
+ });
+
+ // Remove from active downloads
+ setActiveDownloads((prev) => {
+ const newState = { ...prev };
+ delete newState[modelCompleted];
+ return newState;
+ });
+
+ setToastIds((prev) => {
+ const newState = { ...prev };
+ delete newState[modelCompleted];
+ return newState;
+ });
+ }
+
+ // Also look for general download progress in the logs (may not be available)
+ if (line.includes("download") && line.includes("%")) {
+ const percentMatch = line.match(/(\d+)%/);
+ if (percentMatch && percentMatch[1]) {
+ const percent = parseInt(percentMatch[1], 10);
+ console.log(`Download progress detected: ${percent}%`);
+ // We could use this to update progress bars if we can associate it with a specific model
+ }
+ }
+
+ // Look for download errors
+ if (
+ (line.includes("download") || line.includes("model")) &&
+ (line.includes("error") ||
+ line.includes("failed") ||
+ line.includes("timeout"))
+ ) {
+ toast({
+ title: "download error",
+ description:
+ "there was a problem downloading a model. check logs for details.",
+ variant: "destructive",
+ duration: 5000,
+ });
+ }
+ });
+
+ return () => {
+ unlisten.then((unsubscribe) => unsubscribe());
+ };
+ }, [toast, dismiss, activeDownloads, toastIds]);
+
+ return null; // This component doesn't render anything
+}
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lock
index ddcbf822a..76eb92f33 100755
--- a/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -5300,7 +5300,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "0.41.5"
+version = "0.41.6"
dependencies = [
"anyhow",
"async-stream",
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index 11a6c1e77..318c8a6b2 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "0.41.6"
+version = "0.41.7"
description = ""
authors = ["you"]
license = ""
diff --git a/screenpipe-audio/src/transcription/whisper/model.rs b/screenpipe-audio/src/transcription/whisper/model.rs
index ff8add02b..d0a06a9f8 100644
--- a/screenpipe-audio/src/transcription/whisper/model.rs
+++ b/screenpipe-audio/src/transcription/whisper/model.rs
@@ -2,6 +2,7 @@ use crate::core::engine::AudioTranscriptionEngine;
use anyhow::Result;
use hf_hub::{api::sync::Api, Repo, RepoType};
use std::{path::PathBuf, sync::Arc};
+use tracing::info;
use whisper_rs::WhisperContextParameters;
pub fn download_whisper_model(engine: Arc<AudioTranscriptionEngine>) -> Result<PathBuf> {
@@ -12,6 +13,8 @@ pub fn download_whisper_model(engine: Arc<AudioTranscriptionEngine>) -> Result<P
"main".to_string(),
);
let api_repo = api.repo(repo);
+
+ info!("downloading model {:?}", engine);
let model_name = match *engine {
AudioTranscriptionEngine::WhisperLargeV3Turbo => "ggml-large-v3-turbo.bin",
AudioTranscriptionEngine::WhisperTiny => "ggml-tiny.bin",
@@ -23,6 +26,8 @@ pub fn download_whisper_model(engine: Arc<AudioTranscriptionEngine>) -> Result<P
let model = api_repo.get(model_name)?;
+ info!("whisper model downloaded {}", model_name);
+
Ok(model)
}