You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Local models via Ollama take 60-90s to respond to simple prompts like 'hi', while direct API calls take 3s #18428
The same delay occurs with llama-server (llama.cpp) as backend,
ruling out Ollama as the cause.
Cloud models (Anthropic, OpenAI) respond instantly — confirming
the issue is specific to local model handling inside OpenCode.
Suspected cause:
OpenCode adds ~75s of internal overhead when processing local model responses,
possibly related to event loop blocking or empty string handling in the streaming logic.
Additional symptom:
SQLiteError: SQLITE_MISUSE on startup with multiple models defined in opencode.json
Plugins
No response
OpenCode version
1.2.27
Steps to reproduce
Install Ollama and pull any local model:
$ ollama pull qwen2.5-coder:3b-instruct-q4_K_M
OpenCode starts with a very large prompt, some ~13k tokens in my testing even before any MCPs or skills are installed. On my local system with GLM-4.7-Flash, the first time I send something to the model (especially resuming a particularly long existing session) can take minutes. After that initial processing time though, it responds near-instantly.
Sounds to me like your local models are just taking that long to process the initial request into the kv cache.
I'm seeing exponentially slower results. Note the model took 10s to determine the answer here with 32k context window, but Opencode took 22 minutes! The follow-up response was 22x faster, but still ~5x slower than the model itself.
Note that the session name showed the translated math within 30s of the initial prompt.
Are there debugging tools I can use to see what is happening here to try to configure slow steps out with these local models?
Activity
V13Axel commentedon Mar 20, 2026
OpenCode starts with a very large prompt, some ~13k tokens in my testing even before any MCPs or skills are installed. On my local system with GLM-4.7-Flash, the first time I send something to the model (especially resuming a particularly long existing session) can take minutes. After that initial processing time though, it responds near-instantly.
Sounds to me like your local models are just taking that long to process the initial request into the kv cache.
schell commentedon Mar 21, 2026
Yeah, this happens to me as well but only on the first message. After that it's business as usual.
gibbitz commentedon May 17, 2026
I'm seeing exponentially slower results. Note the model took 10s to determine the answer here with 32k context window, but Opencode took 22 minutes! The follow-up response was 22x faster, but still ~5x slower than the model itself.
Note that the session name showed the translated math within 30s of the initial prompt.
Are there debugging tools I can use to see what is happening here to try to configure slow steps out with these local models?
github-actions commentedon Jul 17, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
schell commentedon Jul 18, 2026
Seems silly to close an active issue without fixing it.