As of April 2026, Gemma 4 tool calling is broken in Ollama v0.20.0 (ollama/ollama#15241) - the tool call parser fails and streaming drops tool calls entirely. OpenCode also has issues with local OpenAI-compatible providers (anomalyco/opencode#20669, #20719).
This guide documents a working setup using:
- llama.cpp (built from source with PR #21326 template fix + PR #21343 tokenizer fix) instead of Ollama
- OpenCode built from source with PR #16531 tool-call compatibility layer
Tested on macOS Apple Silicon (M1 Max, 32GB) on April 2, 2026.