hiyouga/LlamaFactory · error · ValueError
Tool utils `{name}` not found.
Error message
Tool utils `{name}` not found. What it means
get_tool_utils maps a tool_format name to a ToolUtils instance via the TOOLS registry dict. An unknown name raises ValueError('Tool utils `name` not found.'). This happens when tool_format in DataArguments or dataset_info.json does not match a registry key.
Source
Thrown at src/llamafactory/data/tool_utils.py:904
"gemma4": Gemma4ToolUtils(),
"glm4": GLM4ToolUtils(),
"llama3": Llama3ToolUtils(),
"lfm2": LFM2ToolUtils(),
"minimax1": MiniMaxM1ToolUtils(),
"minimax2": MiniMaxM2ToolUtils(),
"mistral": MistralToolUtils(),
"qwen": QwenToolUtils(),
"qwen3_5": Qwen35ToolUtils(),
"glm4_moe": GLM4MOEToolUtils(),
"seed_oss": SeedToolUtils(),
"ling": LingToolUtils(),
}
def get_tool_utils(name: str) -> "ToolUtils":
tool_utils = TOOLS.get(name, None)
if tool_utils is None:
raise ValueError(f"Tool utils `{name}` not found.")
return tool_utils
View on GitHub (pinned to f28afaf635)
Solutions
- List valid keys: python -c "from llamafactory.data.tool_utils import TOOLS; print(sorted(TOOLS))" and use an exact key.
- Fix the typo in tool_format (config YAML or dataset_info.json).
- If a format was removed in an upgrade, migrate to its renamed successor (see the repo's tool_utils registry).
Example fix
# before "tool_format": "glm4moe" # after "tool_format": "glm4_moe"
Defensive patterns
Strategy: validation
Validate before calling
from llamafactory.data.tool_utils import TOOLS
assert my_tool_format in TOOLS, f"{my_tool_format} not in {sorted(TOOLS)}" Prevention
- Copy tool_format keys from TOOLS in tool_utils.py (or print sorted(TOOLS)).
- Treat config renames as breaking changes when upgrading LlamaFactory; re-check tool_format keys.
When it happens
Trigger: Setting tool_format: <name> to a typo'd or version-removed key (e.g. 'glm4' vs 'glm4_moe', 'react' variants); referencing a custom tool format registered in another process; keys renamed across LlamaFactory versions.
Common situations: Upgrading LlamaFactory where tool format names changed; hand-writing dataset_info.json tool_format values from memory; community configs referencing formats that no longer exist.
Related errors
- Template {data_args.template} does not exist.
- Unknown finetuning type: {finetuning_args.finetuning_type}.
- Unknown task: {finetuning_args.stage}.
- Please upgrade `transformers` to 4.34.0
- Unable to process key {key}
AI-assisted analysis of hiyouga/LlamaFactory@f28afaf635 (2026-08-14).
Data as JSON: /api/errors/92f81f8ef6fc53b8.
Report an issue: GitHub.