Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

Auto-start Ollama when app launches via npm run dev

PurpleDoubleD9f12e6e972a4
diff --git a/vite.config.ts b/vite.config.ts
index 89b6d6c8..4d627089 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -110,6 +110,21 @@ function comfyLauncher(): Plugin {
return {
name: 'comfy-launcher',
configureServer(server) {
+ // Auto-start Ollama when dev server starts
+ try {
+ execSync('tasklist /FI "IMAGENAME eq ollama.exe" | find /I "ollama.exe"', { stdio: 'ignore' })
+ console.log('[Ollama] Already running')
+ } catch {
+ console.log('[Ollama] Starting...')
+ try {
+ const ollamaProc = spawn('ollama', ['serve'], { detached: true, stdio: 'ignore', shell: true })
+ ollamaProc.unref()
+ console.log('[Ollama] Started')
+ } catch (err) {
+ console.warn('[Ollama] Failed to start:', err)
+ }
+ }
+
// Auto-start ComfyUI when dev server starts
setTimeout(async () => {
try {