Ollama Modelfile RENDERER and PARSER directives and the renderer/parser registri
Parent: Mac local LLMs: Ollama internals · Published reference · snapshot 2026-10-05
↓ Facts as markdownall context files
The Modelfile parser accepts `renderer` and `parser` as commands (also listed in the `errInvalidCommand` text) and `Command.String` writes them back upper-cased with quoted arguments.
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
- The Modelfile parser accepts `renderer` and `parser` as commands (also listed in the `errInvalidCommand` text) and `Command.String` writes them back upper-cased with quoted arguments. [source]
- `docs/modelfile.mdx` on main does not mention RENDERER or PARSER, so both directives are undocumented in the Modelfile reference. [source]
- `usesOllamaRenderedChat` is true when `Config.Renderer != ""`, `Config.Parser != ""`, harmony applies, or a Go template applies, and then `llamaServerConfigForModel` sets `DisableJinja`. [source]
- A model that sets only PARSER (no RENDERER) is therefore also routed away from the GGUF Jinja template. [source]
- `chatModeForModel` chooses the rendered chat path for MLX models and for models where `usesOllamaRenderedChat` holds; otherwise `handleNativeChat` runs. [source]
- For `gptoss`/`gpt-oss` models whose template contains `<|start|>` and `<|end|>`, the server fills an empty Parser with `harmony` and maps think value `max` to `high`. [source]
- `parsers.ParserForName` returns nil for an unregistered name, and `routes.go` guards every use with `if builtinParser != nil`. [source]
- Both registries check a runtime `Register` map first and fall back to a hard-coded switch, so a registered constructor overrides a built-in name. [source]
- The renderer switch names: qwen3-coder, qwen3-vl-instruct, qwen3-vl-thinking, qwen3.5, qwen3.8, ornith, cogito, deepseek3.1, olmo3, olmo3.1, olmo3-think, olmo3-32b-think, nemotron-3-nano, nemotron-3.5-nano, gemma4, gemma4-small, gemma4-large, functiongemma, glm-4.7, glm-ocr, lfm2, lfm2-thinking, laguna, poolside-v1, cohere, glimmer. [source]
- The parser switch names: qwen3, qwen3-thinking, qwen3.5, ornith, qwen3-coder, qwen3-vl-instruct, qwen3-vl-thinking, ministral, passthrough, harmony, cogito, deepseek3, olmo3, olmo3-think, nemotron-3-nano, nemotron-3.5-nano, functiongemma, glm-4.7, gemma4, gemma4-no-thinking, glm-ocr, lfm2, lfm2-thinking, laguna, poolside-v1, cohere, glimmer. [source]
- Renderer and parser names do not match one-to-one: `deepseek3.1` renders but the parser is `deepseek3`; `ministral` and `harmony` are parser-only; `gemma4-small` and `gemma4-large` are renderer variants with parser `gemma4` or `gemma4-no-thinking`. [source]
- `ornith` maps to `Qwen35Parser`, the same parser class as `qwen3.5`. [source]
- `gemma4-large` sets `emptyBlockOnNothink`; `qwen3.5` sets `emitEmptyThinkOnNoThink`; `olmo3.1` turns on the extended system message. [source]
- The `Parser` interface has `Init`, `Add(s, done)`, `PreservedTokens`, `ThinkingClose`, `HasToolSupport` and `HasThinkingSupport`; `PreservedTokens` lists grammar tokens that must stay visible in llama-server detokenized output. [source]
- The `Renderer` interface has `Thinking`, `Render(messages, tools, think)` and `LeadingBOS`; the server uses `LeadingBOSForRenderer` to prepend a BOS for rendered prompts. [source]
- `passthrough` parser returns the input as content with no thinking and no tool calls, and reports no tool or thinking support. [source]
- `RenderImgTags` is a package flag the server sets true at init so renderers emit `[img]` tags. [source]
Children
- No children recorded.