Checkpoint tokenizer

×

The tokenizers file, tokenizer configuration and chat template shipped with the checkpoint.

Unverified: the full token-to-ID mapping. The atlas pins tokenizer.json by its checksum, the same object as GLM-5’s, and keeps no copy.

Explanation

The generic TokenizersBackend loads tokenizer.json (tokenizer_config.json 32).

Sources

In codeTokenizersBackend

Open pinned code ↗

Contextual evidence

The checkpoint’s tokenizer is a Hugging Face tokenizers file (tokenizer.json) loaded by the generic TokenizersBackend; the configuration declares its special tokens, among them the role markers and [gMASK] and <sop>.

tokenizer_config.json 1–33 ↗ · zai-org/GLM-5.1 @ 26e1bd6e011f

Excerpt
{
  "backend": "tokenizers",
  "clean_up_tokenization_spaces": false,
  "do_lower_case": false,
  "eos_token": "<|endoftext|>",
  "extra_special_tokens": [
    "<|endoftext|>",
    "[MASK]",
    "[gMASK]",
    "[sMASK]",
    "<sop>",
    "<eop>",
    "<|system|>",
    "<|user|>",
    "<|assistant|>",
    "<|observation|>",
    "<|begin_of_image|>",
    "<|end_of_image|>",
    "<|begin_of_video|>",
    "<|end_of_video|>",
    "<|begin_of_audio|>",
    "<|end_of_audio|>",
    "<|begin_of_transcription|>",
    "<|end_of_transcription|>"
  ],
  "is_local": true,
  "model_max_length": 202752,
  "model_specific_special_tokens": {},
  "pad_token": "<|endoftext|>",
  "padding_side": "left",
  "remove_space": false,
  "tokenizer_class": "TokenizersBackend"
}

The chat template opens with [gMASK]<sop>, marks each message with its role (<|system|>, <|user|>, <|assistant|>, and <|observation|> for tool results) and opens the assistant’s turn with <think> unless thinking is disabled.

chat_template.jinja 1–119 ↗ · zai-org/GLM-5.1 @ 26e1bd6e011f

Excerpt
[gMASK]<sop>

… lines 2–59 omitted …

{%- for m in messages -%}
{%- if m.role == 'user' -%}<|user|>{{ visible_text(m.content) }}{% set ns.has_thinking = (',' ~ loop.index0 ~ ',') in ns.thinking_indices -%}
{%- elif m.role == 'assistant' -%}
<|assistant|>

… lines 64–90 omitted …

{%- elif m.role == 'tool' -%}
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
    {{- '<|observation|>' -}}

… lines 94–112 omitted …

{%- elif m.role == 'system' -%}
<|system|>{{ visible_text(m.content) }}
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt -%}
    <|assistant|>{{- '</think>' if (enable_thinking is defined and not enable_thinking) else '<think>' -}}
{%- endif -%}