tinker_cookbook.renderers.get_renderer
tinker_cookbook.renderers.get_renderer(name, tokenizer, image_processor, model_name)
Factory function to create renderers by name.
Parameters:
- name (str) – Renderer name. Supported values: -
"role_colon": Simple role:content format -"llama3": Llama 3 chat format -"qwen3": Qwen3 with thinking enabled -"qwen3_vl": Qwen3 vision-language with thinking -"qwen3_vl_instruct": Qwen3 vision-language instruct (no thinking) -"qwen3_disable_thinking": Qwen3 with thinking disabled -"qwen3_instruct": Qwen3 instruct 2507 (no thinking) -"qwen3_5": Qwen3.5 VL with thinking -"qwen3_5_disable_thinking": Qwen3.5 VL with thinking disabled -"deepseekv3": DeepSeek V3 (defaults to non-thinking mode) -"deepseekv3_disable_thinking": DeepSeek V3 non-thinking (alias) -"deepseekv3_thinking": DeepSeek V3 thinking mode -"kimi_k2": Kimi K2 Thinking format -"kimi_k25": Kimi K2.5 with thinking enabled -"kimi_k25_disable_thinking": Kimi K2.5 with thinking disabled -"kimi_k26": Kimi K2.6 with thinking enabled (HF default — same token output askimi_k25) -"kimi_k26_disable_thinking": Kimi K2.6 with thinking disabled -"kimi_k26_preserve_thinking": Kimi K2.6 with thinking enabled and historical<think>...</think>blocks preserved (HFpreserve_thinking=true); use for long-horizon agents / multi-turn RL -"nemotron3": Nemotron-3 with full reasoning (Nano & Super) -"nemotron3_low_thinking": Nemotron-3 with low-effort reasoning (Super only) -"nemotron3_disable_thinking": Nemotron-3 with reasoning off (Nano & Super) -"gpt_oss_no_sysprompt": GPT-OSS without system prompt -"gpt_oss_low_reasoning": GPT-OSS with low reasoning -"gpt_oss_medium_reasoning": GPT-OSS with medium reasoning -"gpt_oss_high_reasoning": GPT-OSS with high reasoning - Custom renderers registered viaregister_renderer() - tokenizer (Tokenizer) – The tokenizer to use.
- image_processor (ImageProcessor | None) – Required for VL renderers.
- model_name (str | None) – Model name for pickle metadata. If None, falls back to
tokenizer.name_or_path. Provide this explicitly when the tokenizer was loaded with a remapped name (e.g., Llama 3 models).
Returns: Renderer: A Renderer instance configured for the specified format.
Raises:
- RendererError: If the renderer name is unknown or if a VL renderer
- is requested without an image_processor.