Skip to content

vllm.tokenizers.deepseek_v41

Functions:

_add_updated_tool_schemas(conversation, tools)

Like deepseek-recipe, follow each user turn whose tool results reference tools with a system turn listing those tools' schemas, in reference order.

_compile_added_tokens_pattern(tokens)

Match the longest added token at each position using shared prefixes.

_escape_deep(value, escape)

Escape every key and string of a JSON-like value.

get_deepseek_v41_tokenizer(tokenizer)

Wrap an HF tokenizer with the V4.1 prompt encoder.