Skip to content

feat(deepseek): register V4-Flash and V4-Pro models#265

Merged
Kamilbenkirane merged 1 commit intomainfrom
feat/deepseek-v4-models
Apr 24, 2026
Merged

feat(deepseek): register V4-Flash and V4-Pro models#265
Kamilbenkirane merged 1 commit intomainfrom
feat/deepseek-v4-models

Conversation

@Kamilbenkirane
Copy link
Copy Markdown
Member

Summary

  • Register deepseek-v4-flash and deepseek-v4-pro (released early March 2026): 1M context, 384K max output, thinking + non-thinking modes, 128-function tool calling.
  • Add TextParameter.THINKING_LEVEL as Choice(["disabled", "high", "max"]) and a DeepSeek ThinkingLevelMapper that emits the proprietary dual-field wire shape: thinking.type (enabled/disabled) plus top-level reasoning_effort (high/max). Pattern mirrors xai/openai — spread the protocol mappers and append the provider-specific one.
  • Legacy deepseek-chat / deepseek-reasoner entries are untouched; DeepSeek aliases them to V4-Flash modes server-side.

Pricing for context (per 1M tokens, from official docs):

Model Input Cached Output
V4-Flash $0.14 $0.028 $0.28
V4-Pro $1.74 $0.145 $3.48

Test plan

  • make ci green (598 unit tests pass, 82.3% coverage, lint/mypy/bandit clean)
  • Manual smoke via celeste.text.generate:
    • V4-Flash + V4-Pro generate with thinking_level in {disabled, high, max}
    • tool_choice="required" works with thinking_level="disabled"
    • Tool calls returned when tools provided
  • ThinkingLevelMapper emits exact wire format:
    • "disabled"{"thinking": {"type": "disabled"}}
    • "high"{"thinking": {"type": "enabled"}, "reasoning_effort": "high"}
    • "max"{"thinking": {"type": "enabled"}, "reasoning_effort": "max"}
  • ⚠️ Integration test test_tool_choice_required_forces_tool_call fails 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 with thinking_level="disabled". The official API reference lists required as a valid tool_choice value with no thinking-mode caveat. Keeping ToolChoiceSupport() permissive to match the documented contract.

Docs

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.
@claude
Copy link
Copy Markdown

claude Bot commented Apr 24, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@Kamilbenkirane Kamilbenkirane merged commit b9a6930 into main Apr 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant