Tool calling broken via Ollama β€” missing chat template in GGUF

#2
by DiscoveryBlock - opened

Heads up for anyone trying to use Carnice-9b with Ollama for tool calling (e.g., Hermes Agent, OpenAI-compatible clients): out of the box it
fails with "this model does not support tools" from /v1/chat/completions.

The weights are fine β€” the issue is that the GGUF ships without an embedded chat template, so ollama pull falls back to a bare {{ .Prompt }} template. Ollama gates tool requests at the API layer by scanning the template for {{ .Tools }} and {{ .ToolCalls }}; if
they're absent, the request is rejected before the model ever sees it.

Diagnosis:

ollama show kai-os/carnice-9b --modelfile | grep -A 30 TEMPLATE

You'll see only {{ .Prompt }}.

Fix (since Carnice is a Qwen3.5 fine-tune, the qwen3 template works perfectly):

curl -X POST http://localhost:11434/api/create -d '{
  "model": "carnice-9b-tools",
  "from": "kai-os/carnice-9b",
  "template": "<paste TEMPLATE block from `ollama show qwen3:8b --modelfile`>"
}'

Note: on Ollama 0.20+, use from: + template: as separate fields. The legacy modelfile: field silently no-ops.

After this, tool calling works immediately β€” verified with Hermes Agent.

Suggested upstream fix: re-run convert_hf_to_gguf.py (llama.cpp) with the qwen3 chat template embedded in the GGUF metadata, then
re-upload. That way ollama pull picks it up automatically and nobody has to derive a -tools variant.

Note: strip the zero-width characters before the triple-backticks (β†’) β€” I added them so the code blocks render in this chat. HF will
accept plain triple-backticks.

Bro, I downloaded Carnice today, and you literally saved me so many hours of my life trying to solve a problem I probably wouldn't have known how to solve otherwise. Thanks to you, it only took me 5 minutes, which is awesome. How's Carnice working for you now?

Glad it saved you time!

Carnice has been solid for what it is, better than the other local models I was using, but most of my inference I'm still running through Morpheus AI since I have perpetual access to it with my staked $MOR.

Sign up or log in to comment