diff --git a/server/index.ts b/server/index.ts index 3d16b16..719a80a 100644 --- a/server/index.ts +++ b/server/index.ts @@ -1969,6 +1969,7 @@ app.post("/api/prompt", async (c) => { if (OLLAMA_MODELS[model]) { try { + await ensureSidecar("ollama"); const ollamaRes = await fetch(`${OLLAMA_URL}/api/chat`, { method: "POST", headers: { "Content-Type": "application/json" }, @@ -1989,6 +1990,7 @@ app.post("/api/prompt", async (c) => { } const data = await ollamaRes.json(); + markSidecarUsed("ollama"); return c.json({ content: data.message?.content || "" }); } catch (e: any) { console.error("[prompt] Ollama unreachable:", e.message); diff --git a/server/sidecar-manager.ts b/server/sidecar-manager.ts index 9c5ebfe..ca0da6e 100644 --- a/server/sidecar-manager.ts +++ b/server/sidecar-manager.ts @@ -39,6 +39,12 @@ const SIDECARS: Record = { port: 8810, healthTimeout: 15_000, }, + ollama: { + container: "ollama", + host: "ollama", + port: 11434, + healthTimeout: 30_000, + }, }; const lastUsed = new Map();