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

fix: disable embedded llm for windows and linux

Louis Beaumont8fd51d44bbf2
diff --git a/screenpipe-app-tauri/components/settings.tsx b/screenpipe-app-tauri/components/settings.tsx
index ad58be722..e5eaa8a13 100644
--- a/screenpipe-app-tauri/components/settings.tsx
+++ b/screenpipe-app-tauri/components/settings.tsx
@@ -1,5 +1,5 @@
"use client";
-import React, { useState } from "react";
+import React, { useEffect, useState } from "react";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
@@ -50,6 +50,11 @@ export function Settings({ className }: { className?: string }) {
const [ollamaStatus, setOllamaStatus] = useState<
"idle" | "running" | "error"
>("idle");
+ const [currentPlatform, setCurrentPlatform] = useState("unknown");
+
+ useEffect(() => {
+ setCurrentPlatform(platform());
+ }, []);
const handleApiUrlChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const newValue = e.target.value;
@@ -406,128 +411,139 @@ export function Settings({ className }: { className?: string }) {
local machine or elsewhere and the exact model name.
</p>
- <Separator className="my-4" />
-
- <div className="w-full">
- <div className="flex items-center gap-4 mb-4">
- <div className="flex items-center min-w-[80px] justify-end">
- <Label htmlFor="embeddedLLM" className="text-right mr-2">
- embedded ai
- </Label>
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <HelpCircle className="h-4 w-4 cursor-help" />
- </TooltipTrigger>
- <TooltipContent side="right" className="max-w-[300px]">
- <p>
- enable this to use local ai features in screenpipe.
- you can use it through search or pipes for enhanced
- functionality without relying on external services.
- </p>
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- </div>
- <div className="flex items-center gap-4">
- <Switch
- id="embeddedLLM"
- checked={localSettings.embeddedLLM.enabled}
- onCheckedChange={handleEmbeddedLLMChange}
- />
- <Button
- onClick={startOllamaSidecar}
- disabled={
- !localSettings.embeddedLLM.enabled ||
- ollamaStatus === "running"
- }
- className="ml-auto"
- >
- {ollamaStatus === "running" ? (
- <Check className="h-4 w-4 mr-2" />
- ) : ollamaStatus === "error" ? (
- <X className="h-4 w-4 mr-2" />
- ) : ollamaStatus === "idle" ? (
- <Play className="h-4 w-4 mr-2" />
- ) : (
- <Loader2 className="h-4 w-4 mr-2 animate-spin" />
- )}
- {ollamaStatus === "running"
- ? "running"
- : ollamaStatus === "error"
- ? "error"
- : "start llm"}
- </Button>
- <Button
- variant="outline"
- onClick={handleStopLLM}
- className="ml-auto"
- >
- <X className="h-4 w-4 mr-2" />
- stop llm
- </Button>
- <LogFileButton />
- </div>
- </div>
- </div>
-
- {localSettings.embeddedLLM.enabled && (
+ {currentPlatform === "macos" && (
<>
+ <Separator className="my-4" />
+
<div className="w-full">
<div className="flex items-center gap-4 mb-4">
- <Label
- htmlFor="embeddedLLMModel"
- className="min-w-[80px] text-right"
- >
- llm model
- </Label>
- <div className="flex-grow flex items-center">
- <Input
- id="embeddedLLMModel"
- value={localSettings.embeddedLLM.model}
- onChange={handleEmbeddedLLMModelChange}
- className="flex-grow"
- placeholder="enter embedded llm model"
- />
+ <div className="flex items-center min-w-[80px] justify-end">
+ <Label
+ htmlFor="embeddedLLM"
+ className="text-right mr-2"
+ >
+ embedded ai
+ </Label>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
- <HelpCircle className="ml-2 h-4 w-4 cursor-help" />
+ <HelpCircle className="h-4 w-4 cursor-help" />
</TooltipTrigger>
<TooltipContent
side="right"
className="max-w-[300px]"
>
<p>
- supported models are the same as ollama. check
- the ollama documentation for a list of available
- models.
+ enable this to use local ai features in
+ screenpipe. you can use it through search or
+ pipes for enhanced functionality without relying
+ on external services.
</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
+ <div className="flex items-center gap-4">
+ <Switch
+ id="embeddedLLM"
+ checked={localSettings.embeddedLLM.enabled}
+ onCheckedChange={handleEmbeddedLLMChange}
+ />
+ <Button
+ onClick={startOllamaSidecar}
+ disabled={
+ !localSettings.embeddedLLM.enabled ||
+ ollamaStatus === "running"
+ }
+ className="ml-auto"
+ >
+ {ollamaStatus === "running" ? (
+ <Check className="h-4 w-4 mr-2" />
+ ) : ollamaStatus === "error" ? (
+ <X className="h-4 w-4 mr-2" />
+ ) : ollamaStatus === "idle" ? (
+ <Play className="h-4 w-4 mr-2" />
+ ) : (
+ <Loader2 className="h-4 w-4 mr-2 animate-spin" />
+ )}
+ {ollamaStatus === "running"
+ ? "running"
+ : ollamaStatus === "error"
+ ? "error"
+ : "start llm"}
+ </Button>
+ <Button
+ variant="outline"
+ onClick={handleStopLLM}
+ className="ml-auto"
+ >
+ <X className="h-4 w-4 mr-2" />
+ stop llm
+ </Button>
+ <LogFileButton />
+ </div>
</div>
</div>
- <div className="w-full">
- <div className="flex items-center gap-4 mb-4">
- <Label
- htmlFor="embeddedLLMPort"
- className="min-w-[80px] text-right"
- >
- llm port
- </Label>
- <Input
- id="embeddedLLMPort"
- type="number"
- value={localSettings.embeddedLLM.port}
- onChange={handleEmbeddedLLMPortChange}
- className="flex-grow"
- placeholder="enter embedded llm port"
- />
- </div>
- </div>
+ {localSettings.embeddedLLM.enabled && (
+ <>
+ <div className="w-full">
+ <div className="flex items-center gap-4 mb-4">
+ <Label
+ htmlFor="embeddedLLMModel"
+ className="min-w-[80px] text-right"
+ >
+ llm model
+ </Label>
+ <div className="flex-grow flex items-center">
+ <Input
+ id="embeddedLLMModel"
+ value={localSettings.embeddedLLM.model}
+ onChange={handleEmbeddedLLMModelChange}
+ className="flex-grow"
+ placeholder="enter embedded llm model"
+ />
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <HelpCircle className="ml-2 h-4 w-4 cursor-help" />
+ </TooltipTrigger>
+ <TooltipContent
+ side="right"
+ className="max-w-[300px]"
+ >
+ <p>
+ supported models are the same as ollama.
+ check the ollama documentation for a list of
+ available models.
+ </p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>
+ </div>
+ </div>
+
+ <div className="w-full">
+ <div className="flex items-center gap-4 mb-4">
+ <Label
+ htmlFor="embeddedLLMPort"
+ className="min-w-[80px] text-right"
+ >
+ llm port
+ </Label>
+ <Input
+ id="embeddedLLMPort"
+ type="number"
+ value={localSettings.embeddedLLM.port}
+ onChange={handleEmbeddedLLMPortChange}
+ className="flex-grow"
+ placeholder="enter embedded llm port"
+ />
+ </div>
+ </div>
+ </>
+ )}
</>
)}
</CardContent>
diff --git a/screenpipe-app-tauri/scripts/pre_build.js b/screenpipe-app-tauri/scripts/pre_build.js
index ec933c1c7..50c09f081 100644
--- a/screenpipe-app-tauri/scripts/pre_build.js
+++ b/screenpipe-app-tauri/scripts/pre_build.js
@@ -686,23 +686,27 @@ async function installOllamaSidecar() {
}
try {
+
+ // ! windows and linux not supported for now
+
+
await fs.mkdir(ollamaDir, { recursive: true });
const downloadPath = path.join(ollamaDir, path.basename(ollamaUrl));
console.log('Downloading Ollama...');
if (platform === 'windows') {
- await $`powershell -command "Invoke-WebRequest -Uri '${ollamaUrl}' -OutFile '${downloadPath}'"`;
+ // await $`powershell -command "Invoke-WebRequest -Uri '${ollamaUrl}' -OutFile '${downloadPath}'"`;
} else {
await $`wget -q --show-progress ${ollamaUrl} -O ${downloadPath}`;
}
console.log('Extracting Ollama...');
if (platform === 'windows') {
- await $`powershell -command "Expand-Archive -Path '${downloadPath}' -DestinationPath '${ollamaDir}'"`;
- await fs.rename(path.join(ollamaDir, 'ollama.exe'), path.join(ollamaDir, ollamaExe));
+ // await $`powershell -command "Expand-Archive -Path '${downloadPath}' -DestinationPath '${ollamaDir}'"`;
+ // await fs.rename(path.join(ollamaDir, 'ollama.exe'), path.join(ollamaDir, ollamaExe));
} else if (platform === 'linux') {
- await $`tar -xzf "${downloadPath}" -C "${ollamaDir}"`;
- await fs.rename(path.join(ollamaDir, 'ollama'), path.join(ollamaDir, ollamaExe));
+ // await $`tar -xzf "${downloadPath}" -C "${ollamaDir}"`;
+ // await fs.rename(path.join(ollamaDir, 'ollama'), path.join(ollamaDir, ollamaExe));
} else if (platform === 'macos') {
// just copy to both archs
await fs.copyFile(downloadPath, path.join(ollamaDir, "ollama-aarch64-apple-darwin"));
@@ -711,7 +715,7 @@ async function installOllamaSidecar() {
console.log('Setting permissions...');
if (platform === 'linux') {
- await fs.chmod(path.join(ollamaDir, ollamaExe), '755');
+ // await fs.chmod(path.join(ollamaDir, ollamaExe), '755');
} else if (platform === 'macos') {
await fs.chmod(path.join(ollamaDir, "ollama-aarch64-apple-darwin"), '755');
await fs.chmod(path.join(ollamaDir, "ollama-x86_64-apple-darwin"), '755');