Repository navigation
Inference: add a local 'ollama' vendor for low-level helper work #3128
danielmiessler
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Moved from #2998, opened by @fastrevmd-lab.
Version
LifeOS 8.761.0 · attestation: 2 system file(s) differ from danielmiessler/LifeOS@v8.761.0 · 8 system file(s) missing:
What is broken
Inference.tsonly knows theanthropic,openaiandanthropic-apivendors, so there's no way to send unattended--level lowhelper work (hourly reads, derivers, classifiers) to a local model. A machine with a local Ollama server still has to spend subscription quota or paid tokens on that work. Passing--vendor ollama, or"byLevel": {"low": "ollama"}inUSER/CONFIG/inference-vendor.json, is rejected byresolveVendorwithunknown vendor 'ollama'.Where (file:line)
LIFEOS/TOOLS/Inference.ts:73
Repro on a clean tree
Negative control
Probe:
bun LIFEOS/TOOLS/Inference.ts --vendor ollama --level low --no-fallback 'Reply with one word.' 'Say ok.'· exit 1 · captured 2026-11-28T00:55:23.808ZRed looks like: unknown vendor 'ollama'
Suggested fix
Adds an
ollamavendor toLIFEOS/TOOLS/Inference.ts.ollamaAttempt()makes one native/api/chatcall withstream:falseandthink:false, using the model from the config'sollamaModeland the server fromollamaUrl(defaulthttp://localhost:11434).expectJsonsends Ollama'sformatfield (thejsonSchemawhen given, else"json").<think>block is stripped, and token usage is reported.done_reason:"length", an empty answer, HTTP errors and an unreachable server all return a failed result instead of throwing.modeloverrides are refused, the same way theanthropic-apilane refuses them.inference()falls back to the config'sfallbackvendor, unlessallowVendorFallback:falseis set or the call was aborted.Opt in with
{"byLevel": {"low": "ollama"}, "ollamaModel": "<model>"}. With noollamaentry in the config, nothing changes.LIFEOS/TOOLS/Inference.ollama.test.tsadds 5 tests against a fake Ollama server, and all pass. I also tested it live on a local model: a JSON classification and a plain reply both succeeded.Verified after fix
Probe:
bun LIFEOS/TOOLS/Inference.ts --vendor ollama --level low --no-fallback 'Reply with one word.' 'Say ok.'· exit 0 · captured 2026-11-28T00:55:24.436ZEnvironment
All reactions