<!-- llms-explorer concept facts · https://llms-explorer.com/tree/ollama-modelfile-renderer-and-parser-directives/ · pack 2026-10-05 · ~1244 tokens -->

# Ollama Modelfile RENDERER and PARSER directives and the renderer/parser registri

> 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.

Parent: [Mac local LLMs: Ollama internals](https://llms-explorer.com/tree/mac-local-llms-ollama-internals/) · 1 facets · 17 facts · page: https://llms-explorer.com/tree/ollama-modelfile-renderer-and-parser-directives/

## 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](https://raw.githubusercontent.com/ollama/ollama/main/parser/parser.go)
- `docs/modelfile.mdx` on main does not mention RENDERER or PARSER, so both directives are undocumented in the Modelfile reference. — [source](https://raw.githubusercontent.com/ollama/ollama/main/docs/modelfile.mdx)
- `usesOllamaRenderedChat` is true when `Config.Renderer != ""`, `Config.Parser != ""`, harmony applies, or a Go template applies, and then `llamaServerConfigForModel` sets `DisableJinja`. — [source](https://raw.githubusercontent.com/ollama/ollama/main/server/routes.go)
- A model that sets only PARSER (no RENDERER) is therefore also routed away from the GGUF Jinja template. — [source](https://raw.githubusercontent.com/ollama/ollama/main/server/routes.go)
- `chatModeForModel` chooses the rendered chat path for MLX models and for models where `usesOllamaRenderedChat` holds; otherwise `handleNativeChat` runs. — [source](https://raw.githubusercontent.com/ollama/ollama/main/server/routes.go)
- 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](https://raw.githubusercontent.com/ollama/ollama/main/server/routes.go)
- `parsers.ParserForName` returns nil for an unregistered name, and `routes.go` guards every use with `if builtinParser != nil`. — [source](https://raw.githubusercontent.com/ollama/ollama/main/model/parsers/parsers.go)
- 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](https://raw.githubusercontent.com/ollama/ollama/main/model/parsers/parsers.go)
- 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](https://raw.githubusercontent.com/ollama/ollama/main/model/renderers/renderer.go)
- 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](https://raw.githubusercontent.com/ollama/ollama/main/model/parsers/parsers.go)
- 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](https://raw.githubusercontent.com/ollama/ollama/main/model/parsers/parsers.go)
- `ornith` maps to `Qwen35Parser`, the same parser class as `qwen3.5`. — [source](https://raw.githubusercontent.com/ollama/ollama/main/model/parsers/parsers.go)
- `gemma4-large` sets `emptyBlockOnNothink`; `qwen3.5` sets `emitEmptyThinkOnNoThink`; `olmo3.1` turns on the extended system message. — [source](https://raw.githubusercontent.com/ollama/ollama/main/model/renderers/renderer.go)
- 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](https://raw.githubusercontent.com/ollama/ollama/main/model/parsers/parsers.go)
- The `Renderer` interface has `Thinking`, `Render(messages, tools, think)` and `LeadingBOS`; the server uses `LeadingBOSForRenderer` to prepend a BOS for rendered prompts. — [source](https://raw.githubusercontent.com/ollama/ollama/main/model/renderers/renderer.go)
- `passthrough` parser returns the input as content with no thinking and no tool calls, and reports no tool or thinking support. — [source](https://raw.githubusercontent.com/ollama/ollama/main/model/parsers/parsers.go)
- `RenderImgTags` is a package flag the server sets true at init so renderers emit `[img]` tags. — [source](https://raw.githubusercontent.com/ollama/ollama/main/model/renderers/renderer.go)
