Fixing Ollama's defaults for small models in a desktop chat app
What they built
Micah Spiegel, who comes from finance rather than CS, is building Qwellar, a desktop app that treats a local AI as a long-term presence: persistent memory, chat with local models via Ollama, and a workspace for working with AI over time. It talks to llama3.2:3b through Ollama's API on localhost:11434.
The app teaches the model code words in the system prompt, such as outputting a confirm_start_fresh tag when the user asks to wipe the chat; the app watches for the tag and shows a confirmation card. At Ollama's default temperature of 0.8 the model wrote variations of the tag or paraphrased it, and the parser failed.
The default 2048-token context also silently dropped the start of longer conversations, so the model made things up about earlier messages. The post walks through the settings changes, a bug that kept the options from ever reaching Ollama, and the code involved.
Setup
- Ollama on localhost:11434 with llama3.2:3b (about 2 GB of RAM)
- Qwellar: Electron desktop app with a TypeScript Ollama client
How it works
- A BASELINE_MODEL_OPTIONS constant (temperature 0.15, num_ctx 16384) is merged into every request in the Ollama client, with caller options able to override it.
- The Electron main process was forwarding only model and messages; a one-line fix passes options through too.
- Prompts were hardened with explicit output-only instructions and labelled negative examples of bad output the model had produced.
- The parser now tolerates small mistakes like extra spaces, trailing text or markdown wrapping.
- A Settings UI exposes response style (Precise 0.15, Balanced 0.4, Creative 0.8, Custom) and context window (4k to 32k or model default).
Results & numbers
- At temperature 0.15 small models stopped mangling structured output and the confirmation tag fired correctly
- num_ctx 16384 gives about 80 turns of chat before running out, versus about 10 at 2048
Gotchas
- Ollama does not report when a conversation exceeds num_ctx; it silently cuts off the beginning
- The options bug returned HTTP 200 every time, so a status-code check never caught it; only end-to-end testing did
- Hardened prompts mean paying maintenance cost in English instead of code for every new feature
“Silence equals defaults. Most people never even know the field exists.”— Micah Spiegel
Do it yourself
- Add an options object to every /api/chat request instead of relying on defaults
- Use a low temperature (e.g. 0.15) for anything your code parses
- Raise num_ctx (e.g. 16384) to fit whole conversations within your RAM budget
- Verify the options actually reach Ollama end to end, not just that the API returns 200
POST http://localhost:11434/api/chat
{
"model": "llama3.2:3b",
"messages": [
{ "role": "user", "content": "hey what's up" }
],
"options": {
"temperature": 0.15,
"num_ctx": 16384
}
}Related
A 4B local model on a 4 GB laptop GPU as a PASS/FAIL test evaluator
Qwen3 4B Instruct in Ollama (Docker, WSL2) grades a Spring Boot app's root-cause answers against expected ones, returning a JSON verdict, with every speed and memory number measured on a 4 GB Quadro T1000.
A private ChatGPT for a family of four on a Mac mini
One always-on M4 Mac mini serves Open WebUI to every phone and laptop in the house. Kids get a tutor preset, and three AI subscriptions are gone.
Hybrid workflow: local for private and repetitive, cloud for hard
A Linux sysadmin stopped trying to replace cloud LLMs. Ollama now handles private docs, overnight article summaries and VS Code autocomplete.
14 months local-first: what still breaks
An honest report from a three-machine home lab. Local handles about 85% of tasks, but four kinds of work still fail, and that cut cloud spend from $187 to about $25 a month.