Ollama vs llama.cpp: same request counts 85k vs 164k tokens in OpenCode
RadianceTower · reddit · 2026-09-12
A developer running local models with OpenCode found a major token-counting discrepancy: Ollama reported 85k tokens (matching OpenCode's UI) and stopped at its 85k context limit, but llama.cpp claimed the same request was 164k tokens and actually processed all of them when given a 170k window.
Since Ollama halts generation at the limit rather than silently dropping tokens, the issue isn't truncation—Ollama and llama.cpp simply count prompt tokens very differently. The poster is asking why.
More from coding & agent
- Hermes Agent uses new Rive CLI to rebuild homepage as a video game menu — Teknium · 2026-09-12
- Study: 69% of 31,000+ agent runs contained at least one reward-hacking episode — dair_ai · 2026-09-12
- Developer runs Codex entirely on a foldable phone, with app server and voice on-device — SIGKITTEN · 2026-09-12
- Cloud Agent Platforms Still Ask You to Pick a Repo While Codex Roams Unsupervised — willcb · 2026-09-12
- AI-generated firmware flashed straight to STM32 to run pumps and valve — debreuil · 2026-09-12
- Tortie: a slim agent-driven IDE that survives harness crashes — JnBrymn · 2026-09-12