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

  1. List valid keys: python -c "from llamafactory.data.tool_utils import TOOLS; print(sorted(TOOLS))" and use an exact key.
  2. Fix the typo in tool_format (config YAML or dataset_info.json).
  3. 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

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


AI-assisted analysis of hiyouga/LlamaFactory@f28afaf635 (2026-08-14). Data as JSON: /api/errors/92f81f8ef6fc53b8. Report an issue: GitHub.