Summary
.env.example lists several Anthropic-compatible providers, but gives no warning that their extended-thinking behavior differs and isn't handled by the teaching examples. A learner who copies certain MODEL_ID lines and runs a chapter hits an API error or sees the model's raw reasoning leak into output.
The default (MODEL_ID=claude-sonnet-4-6) is fine. The gap is purely a missing note.
What actually happens (behavior splits three ways, not one)
Provider (env MODEL_ID) |
Thinking behavior on the Anthropic endpoint |
Effect on the examples |
kimi-k2.6 |
thinking-native (K2-Thinking family) |
reject requests unless thinking is enabled |
deepseek-v4-* |
thinking ON by default; responses always include a thinking block |
runs, but every turn emits thinking content |
MiniMax-M2.x |
reasoning can leak as reasoning_content in the stream unless thinking is disabled |
reasoning bleeds into visible output |
glm-5.2 |
hybrid, thinking optional/configurable |
works as-is |
Sources:
Why not add a thinking param to the chapter code
I checked; a code fix is the wrong call:
- No uniform flag works. kimi wants thinking enabled;
DeepSeek and MiniMax want it disabled.
A blanket thinking={"type":"enabled",...} would make MiniMax leak and is redundant for DeepSeek.
- A fixed
budget_tokens breaks small calls. s09_memory/code.py:178 uses max_tokens=200 and :260 uses max_tokens=800;
the API requires budget_tokens < max_tokens, so e.g. budget_tokens=1000 returns 400 there.
- Adding thinking plumbing expands chapter scope against the minimal-teaching design).
Proposed fix (doc-only)
Add a short note to .env.example:
Reasoning/thinking behavior varies by provider
minimal examples:
- kimi-k2.6 is thinking-native and may require non-thinking variant like kimi-k2.7-code.
- deepseek-v4 enables thinking by default (resp).
- MiniMax M2.x may leak reasoning unless thinki
For the cleanest run, use claude-sonnet-4-6 (default) or a non-thinking model.
Happy to open the one-file PR if the doc-only direction looks right, or discuss if you'd prefer per-chapter thinking handling.
Summary
.env.examplelists several Anthropic-compatible providers, but gives no warning that their extended-thinking behavior differs and isn't handled by the teaching examples. A learner who copies certainMODEL_IDlines and runs a chapter hits an API error or sees the model's raw reasoning leak into output.The default (
MODEL_ID=claude-sonnet-4-6) is fine. The gap is purely a missing note.What actually happens (behavior splits three ways, not one)
MODEL_ID)kimi-k2.6deepseek-v4-*thinkingblockMiniMax-M2.xreasoning_contentin the stream unless thinking is disabledglm-5.2Sources:
Why not add a
thinkingparam to the chapter codeI checked; a code fix is the wrong call:
DeepSeek and MiniMax want it disabled.
A blanket
thinking={"type":"enabled",...}would make MiniMax leak and is redundant for DeepSeek.budget_tokensbreaks small calls.s09_memory/code.py:178usesmax_tokens=200and:260usesmax_tokens=800;the API requires
budget_tokens < max_tokens, so e.g.budget_tokens=1000returns 400 there.Proposed fix (doc-only)
Add a short note to
.env.example:Reasoning/thinking behavior varies by provider
minimal examples:
For the cleanest run, use claude-sonnet-4-6 (default) or a non-thinking model.
Happy to open the one-file PR if the doc-only direction looks right, or discuss if you'd prefer per-chapter thinking handling.