feat(deepseek): register V4-Flash and V4-Pro models#265
Merged
Kamilbenkirane merged 1 commit intomainfrom Apr 24, 2026
Merged
Conversation
Add deepseek-v4-flash and deepseek-v4-pro to the text registry with
1M context, 384K max output, and THINKING_LEVEL choice ("disabled",
"high", "max"). Introduces a DeepSeek-specific ThinkingLevelMapper
that emits the dual-field wire shape (thinking.type + reasoning_effort).
Legacy deepseek-chat / deepseek-reasoner entries are untouched; DeepSeek
aliases them to V4-Flash modes server-side.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deepseek-v4-flashanddeepseek-v4-pro(released early March 2026): 1M context, 384K max output, thinking + non-thinking modes, 128-function tool calling.TextParameter.THINKING_LEVELasChoice(["disabled", "high", "max"])and a DeepSeekThinkingLevelMapperthat emits the proprietary dual-field wire shape:thinking.type(enabled/disabled) plus top-levelreasoning_effort(high/max). Pattern mirrors xai/openai — spread the protocol mappers and append the provider-specific one.deepseek-chat/deepseek-reasonerentries are untouched; DeepSeek aliases them to V4-Flash modes server-side.Pricing for context (per 1M tokens, from official docs):
Test plan
make cigreen (598 unit tests pass, 82.3% coverage, lint/mypy/bandit clean)celeste.text.generate:thinking_levelin{disabled, high, max}tool_choice="required"works withthinking_level="disabled"ThinkingLevelMapperemits exact wire format:"disabled"→{"thinking": {"type": "disabled"}}"high"→{"thinking": {"type": "enabled"}, "reasoning_effort": "high"}"max"→{"thinking": {"type": "enabled"}, "reasoning_effort": "max"}test_tool_choice_required_forces_tool_callfails for V4 models due to an undocumented DeepSeek server bug:tool_choice="required"is rejected with HTTP 400"deepseek-reasoner does not support this tool_choice"when thinking mode is enabled (V4's default). Works fine withthinking_level="disabled". The official API reference listsrequiredas a validtool_choicevalue with no thinking-mode caveat. KeepingToolChoiceSupport()permissive to match the documented contract.Docs