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
read_file tool call not available with local model gemma4:e4b running with Ollama #21354
I am running opencode with locally running gemma4:e4b with Ollama. I tried to ask it to read a file and it was not able to. It gave the message I am attaching as an image to this. The read tool from openCode is not used since the model looks for read_file tool. When I switch to openAI's API call after giving my token, it starts to work. Is there a separate config needed for LLMs running on local with Ollama to resolve tools calls?
Reacted by Artem Timofeev and Leonel Andrés Moreno Alvarez
These issues describe the same underlying problem: gemma4 tool calling not working correctly through OpenCode's Ollama integration. Please check if any of these cover your case and consider adding your findings there instead.
You perhaps need to increase the context window in your Ollama settings (that's my assumption as it is saying it didn't get any user query but only a list of tools which was probably incomplete due to the small context window).
Once that is done, you'll need a stronger model to get anything done and perhaps use something else than Ollama.
@rekram1-node Hi, please, I also have this issue, any idea? I am using a Macbook Pro M4 base + gemma4:e4b, Ollama, I have the exact same error resposne
I have the same issue with Gemma4 E4B IT with a context window of 32k running with llama.cpp. Can share this "thinking" output from within Opencode
Steps:
┃ 1. Read config.yml.
┃ 2. Analyze the file contents, specifically around lines 24 and 33, to identify how the cluster/environment settings are missing or
┃ misconfigured.
┃ 3. Formulate a plan and/or ask the user for clarification based on the findings.
┃
┃ I will start by reading the file.
[read]:config.yml
Activity
github-actions commentedon Apr 7, 2026
This issue might be a duplicate of existing issues. Please check:
These issues describe the same underlying problem: gemma4 tool calling not working correctly through OpenCode's Ollama integration. Please check if any of these cover your case and consider adding your findings there instead.
justfortheloveof commentedon Apr 7, 2026
You perhaps need to increase the context window in your Ollama settings (that's my assumption as it is saying it didn't get any user query but only a list of tools which was probably incomplete due to the small context window).
Once that is done, you'll need a stronger model to get anything done and perhaps use something else than Ollama.
BrutchsamaJeanLouis commentedon Apr 10, 2026
there is also issue 16531 that blocks gemma4 support
leonelmorenoa commentedon Apr 13, 2026
Any solution for this issue?
leonelmorenoa commentedon Apr 13, 2026
@rekram1-node Hi, please, I also have this issue, any idea? I am using a Macbook Pro M4 base + gemma4:e4b, Ollama, I have the exact same error resposne
srggrs commentedon May 20, 2026
I have the same issue with Gemma4 E4B IT with a context window of 32k running with llama.cpp. Can share this "thinking" output from within Opencode
Steps: ┃ 1. Read config.yml. ┃ 2. Analyze the file contents, specifically around lines 24 and 33, to identify how the cluster/environment settings are missing or ┃ misconfigured. ┃ 3. Formulate a plan and/or ask the user for clarification based on the findings. ┃ ┃ I will start by reading the file. [read]:config.ymlrkuo2000 commentedon May 31, 2026
use journalctl -u ollama -f to see if prompt > num_ctx
model's num_ctx (context window size) can be checked by running ollama ps
How to fix :
ollama run gemma4-31b
/set parameter num_ctx 65536
/save gemma4-31b-ctx64k
/exit
edit ~/.config/opencode/opencode.json to rename model to the newly saved model (gemma4-31b-ctx64k)
rerun opencode
rekram1-node commentedon Jun 23, 2026
Automated: closing question issues.
GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.
If this is a bug or feature request, please open a new issue with the appropriate template.