Ollama usesOllamaRenderedChat versus native llama-server Jinja chat path
Parent: Mac local LLMs: Ollama internals · Published reference · snapshot 2026-10-05
↓ Facts as markdownall context files
Which release introduced `PreferChatTemplate`.
These notes link each claim to its source. A source may be a research report hosted on this site rather than the primary document. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Facts
- Which release introduced `PreferChatTemplate`. [source]
- Whether native-path tool-call parsing relies on llama-server's own parser output for every model family. [source]
- `shouldUseGoTemplate` returns false without a Go template, returns the env value when `OLLAMA_GO_TEMPLATE` is set, and otherwise returns `!m.PreferChatTemplate && envconfig.GoTemplate(true)`. [source]
- `OLLAMA_GO_TEMPLATE` is a `BoolWithDefault` described as "Enable Modelfile TEMPLATE based rendering when available". [source]
- `BoolWithDefault` returns true when the variable is set to a value `strconv.ParseBool` rejects. [source]
- `PreferChatTemplate` is set at model load only when the env var is unset, a Go template and a GGUF chat template exist, no Renderer, Parser or harmony applies, and `shouldPreferChatTemplate` returns true. [source]
- `shouldPreferChatTemplate` prefers the GGUF template when it has strictly more capabilities and the Go template lacks a tool round trip or the GGUF has one, or when capabilities are equal and tool-capable and only the GGUF has a tool round trip. [source]
- `chatTemplateHasToolRoundTrip` requires `tool_calls` or `assistant_tool_call` plus one of `tool_response`, `tool_results`, a tool-role comparison or `ipython`; `goTemplateHasToolRoundTrip` requires `tools` and `toolcalls` variables plus `eq .Role "tool"`, `tool_response` or `TOOL_RESULTS`. [source]
- `shouldUseHarmony` is true only when the model family is `gptoss` or `gpt-oss` and the template contains `<|start|>` and `<|end|>`. [source]
- `selectedTemplateSource` reports one of renderer_parser, renderer, parser, harmony, go_template, gguf_chat_template or none. [source]
- With `DisableJinja` the runner adds `--no-jinja --chat-template chatml` and the code comment says Go-rendered prompts go through completion endpoints. [source]
- The native chat call posts to `http://127.0.0.1:<port>/v1/chat/completions` and `ApplyChatTemplate` posts to `/apply-template`. [source]
- The native request adds `tools`, `logprobs` and `top_logprobs` when present and maps `think` to `chat_template_kwargs` with `enable_thinking` and, for string values, `reasoning_effort`. [source]
- `truncateNativeChatMessages` renders each candidate message list with `ApplyChatTemplate`, tokenizes it and keeps system messages while dropping earlier ones until the prompt fits. [source]
- `handleNativeChat` supports `DebugRenderOnly` by returning the `ApplyChatTemplate` string with an image count. [source]
- Ollama logs "model is missing tokenizer.chat_template and Go TEMPLATE support is unavailable; chat responses may be poorly formatted" with the hint `OLLAMA_GO_TEMPLATE=1` in the condition set out above. [source]
Children
- No children recorded.