Local models' broken chat templates silently broke agent clients — here's the fix

viest_me · reddit · 2026-11-09

A developer running local models via llama-server (v0.7.0, source build) behind agent clients Codex and Pi on an M3 Max found two models' bundled chat templates broke the clients in different ways:

Why fix templates in llama.cpp: Ollama refuses modified templates (you'd have to rewrite the whole 22GB GGUF, and it injects its own default SYSTEM message); llama.cpp accepts a template file at startup: llama-server -m model.gguf --jinja --chat-template-file chattemplate.jinja.

Three checks before connecting an agent:

Takeaway: a broken template can make a model look worse than any flag setting — check it before blaming the weights.

Original post →

More from coding & agent

coding & agent channel →