deepseek-ai / deepseek-ai/deepseek-recipe

V4.1 encoding retains historical reasoning without tools, unlike the official API

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
331
Forks
26
PR merge metrics
No merged PRs in 30d

Description

When `thinking` is omitted or enabled and no `tools` are provided, `DeepseekV41Encoding` retains historical assistant `reasoning_content`, while the official V4.1 Flash API (`deepseek-flash`) ignores it.

For the same conversation, adding 1024 tokens of historical reasoning changes the input token count as follows:

- Official API: **37 → 37**
- Recipe: **38 → 1062**

This affects both earlier and the most recent assistant history. `tools: []` and `tools: null` behave the same as omitting `tools`.

With thinking disabled, both the API and recipe discard historical reasoning.

Tested on September 11, 2026, using `deepseek-recipe==0.1.1` and the bundled V4.1 tokenizer. Source inspected at commit `8cadfede7063`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.