<!-- llms-explorer concept facts · https://llms-explorer.com/tree/ollama-usesollamarenderedchat-versus-native-llam/ · pack 2026-10-05 · ~1027 tokens -->

# Ollama usesOllamaRenderedChat versus native llama-server Jinja chat path

> Which release introduced `PreferChatTemplate`.

Parent: [Mac local LLMs: Ollama internals](https://llms-explorer.com/tree/mac-local-llms-ollama-internals/) · 1 facets · 16 facts · page: https://llms-explorer.com/tree/ollama-usesollamarenderedchat-versus-native-llam/

## Facts

- Which release introduced `PreferChatTemplate`. — source: `asserted`
- Whether native-path tool-call parsing relies on llama-server's own parser output for every model family. — source: `asserted`
- `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](https://raw.githubusercontent.com/ollama/ollama/main/server/routes.go)
- `OLLAMA_GO_TEMPLATE` is a `BoolWithDefault` described as "Enable Modelfile TEMPLATE based rendering when available". — [source](https://raw.githubusercontent.com/ollama/ollama/main/envconfig/config.go)
- `BoolWithDefault` returns true when the variable is set to a value `strconv.ParseBool` rejects. — [source](https://raw.githubusercontent.com/ollama/ollama/main/envconfig/config.go)
- `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](https://raw.githubusercontent.com/ollama/ollama/main/server/images.go)
- `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](https://raw.githubusercontent.com/ollama/ollama/main/server/images.go)
- `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](https://raw.githubusercontent.com/ollama/ollama/main/server/images.go)
- `shouldUseHarmony` is true only when the model family is `gptoss` or `gpt-oss` and the template contains `<|start|>` and `<|end|>`. — [source](https://raw.githubusercontent.com/ollama/ollama/main/server/routes.go)
- `selectedTemplateSource` reports one of renderer_parser, renderer, parser, harmony, go_template, gguf_chat_template or none. — [source](https://raw.githubusercontent.com/ollama/ollama/main/server/images.go)
- With `DisableJinja` the runner adds `--no-jinja --chat-template chatml` and the code comment says Go-rendered prompts go through completion endpoints. — [source](https://raw.githubusercontent.com/ollama/ollama/main/llm/llama_server.go)
- The native chat call posts to `http://127.0.0.1:<port>/v1/chat/completions` and `ApplyChatTemplate` posts to `/apply-template`. — [source](https://raw.githubusercontent.com/ollama/ollama/main/llm/llama_server.go)
- 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](https://raw.githubusercontent.com/ollama/ollama/main/llm/llama_server.go)
- `truncateNativeChatMessages` renders each candidate message list with `ApplyChatTemplate`, tokenizes it and keeps system messages while dropping earlier ones until the prompt fits. — [source](https://raw.githubusercontent.com/ollama/ollama/main/server/routes.go)
- `handleNativeChat` supports `DebugRenderOnly` by returning the `ApplyChatTemplate` string with an image count. — [source](https://raw.githubusercontent.com/ollama/ollama/main/server/routes.go)
- 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](https://raw.githubusercontent.com/ollama/ollama/main/server/images.go)
