Skip to content

Popular checkpoints are rejected for tool calling: Unrecognized chat template #7943

Open

Description

@albertvillanova

TRL recognizes a model by comparing its chat template, character for character, with a copy stored in trl/chat_templates/. Some widely used checkpoints ship a chat template that TRL has never stored, so add_response_schema rejects them, and GRPOTrainer with tools fails at init when the tokenizer does not provide its own response template. #7908 fixed this for LFM2.5 checkpoints; other families are affected too.

Reproduction

from transformers import AutoTokenizer
from trl import add_response_schema

tokenizer = AutoTokenizer.from_pretrained("zai-org/GLM-5.3-Flash")
add_response_schema(tokenizer)
ValueError: Unrecognized chat template, failed to add response schema. Please manually set the response schema on the tokenizer or processor. See the Transformers [docs](https://huggingface.co/docs/transformers/main/en/chat_response_parsing#response-parsing) for more details on response parsing.

Tested with TRL main and transformers 5.21.0.

Progress

I'm handling all the remaining items below myself: please don't open PRs for them, and ping me here if you need one of them sooner.

Activity

  1. albertvillanova commented on Nov 18, 2026

    @albertvillanova
    MemberAuthor

    Reopening for the two tiny-model follow-ups from the #7957 and #7964 reviews. The GLM-5.3-Flash one is done: the GLM think-prefill test now loads tiny-Glm5NextForConditionalGeneration. Qwen3-Coder and Qwen3-Coder-Next need separate tiny models, because Qwen3-Coder-Next uses a different architecture (Qwen3NextForCausalLM).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions