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.

Original post →

More from coding & agent

coding & agent channel →