What this thread does
What was found
Yashwant Das (Medium, 2026-10-13) runs local models on an M4 Max with 64 GB for coding with Pi and opencode, served by Ollama 0.35 and oMLX 0.7. A 50-line logging proxy between agent and server showed:
- opencode 2.x sent none of his sampling settings: raw request fields only go out under
extraBody, not directly underoptions. - Ollama's OpenAI-compatible endpoint ignores some fields. A
top_k: 1test gave three different answers via/v1and identical ones via the native API. Ollama's OpenAI-compatibility docs listmax_tokensbut notmax_completion_tokens,top_kormin_p. - The output cap never applied. Both agents sent
max_completion_tokens; asked for 20 tokens that way, Ollama returned 890. Withmax_tokensit returned exactly 20. Combined with a low-temperature, zero-presence-penalty preset, one Qwen3.6 request looped for about 11 minutes and 58,000 tokens. - A client's context size only controls when the agent compacts; Ollama still loaded models at their full 262K context.
- Speculative decoding (MTP) helped the dense Qwen3.8 27B (up to 1.84x in oMLX) but made the MoE Qwen3.6 about 14% slower there.
- Long prompts read slowly (about 205 tokens/s for the dense model), so Pi's 5-minute idle timeout killed big uncached requests until he set
httpIdleTimeoutMsto 0.
His sample sizes are small (2-3 runs per speed figure, 7 vs 4 runs for the loop comparison) and he did not measure answer quality; he says so.
Cheap checks you can copy
1. Log what your agent actually sends (a tiny pass-through proxy, or the server's debug log). 2. Determinism test: same prompt three times with top_k: 1 or temperature 0. 3. Limit test: ask for 20 tokens with the field your agent uses and count what comes back. 4. Benchmark speed features in the runtime you use, with thinking on.
Open questions
Which agents and servers have you checked this way, and what did they drop?
Sources
Primary sources: the author's article (linked above; checked 2026-11-24; its measurements remain the author's own) and the Ollama OpenAI-compatibility docs, read on 18 October 2026.
- Confirms: the Ollama docs list
max_tokens,temperatureandseedas supported chat-completion fields and do not listmax_completion_tokens,top_kormin_p. That fits his finding that the first is ignored and explains why a client that sends onlymax_completion_tokensgets no output cap. - Does not confirm: the docs do not say what Ollama does with an unlisted field, so "ignores" rests on his proxy logs. The 890-versus-20 token test, the 11-minute loop and the speed figures are his own measurements.
Started from a post by @yashwant-das, packaged by the editor. Original post