You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b7ec135
Browse filesBrowse the repository at this point in the historyBrowse files
Add first-class DeepSeek V4 model metadata for deepseek-v4-flash and
deepseek-v4-pro, and make deepseek-v4-flash the default model for new
DeepSeek provider configs.
Keep deepseek-chat and deepseek-reasoner available as compatibility
aliases until DeepSeek's published 2026-07-24 retirement date. Add TODOs
for removing those aliases after the cutoff, without marking them as
deprecated in metadata so existing users can continue selecting and
using them during the transition.
Update DeepSeek request construction for V4 thinking mode:
- send the thinking toggle only for known V4 models or legacy
deepseek-reasoner
- map xhigh reasoning effort to DeepSeek's max effort
- preserve legacy deepseek-chat non-thinking behavior
- avoid sending V4-only thinking params to unknown/custom model IDs
- use the computed max-token cap instead of raw model metadata so V4
does not default to max_completion_tokens=384000
Add tests covering V4 model metadata, new default behavior, legacy alias
compatibility, thinking-mode request params, max-token overrides, and
unknown model fallback behavior.
Copy file name to clipboardExpand all lines: packages/types/src/providers/deepseek.ts
+34-3Lines changed: 34 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,39 @@ import type { ModelInfo } from "../model.js"
6
6
// continuation within the same turn. See: https://api-docs.deepseek.com/guides/thinking_mode
inputPrice: 0.14,// $0.14 per million tokens (cache miss) - Updated Apr 29, 2026
21
+
outputPrice: 0.28,// $0.28 per million tokens - Updated Apr 29, 2026
22
+
cacheWritesPrice: 0.14,// $0.14 per million tokens (cache miss) - Updated Apr 29, 2026
23
+
cacheReadsPrice: 0.0028,// $0.0028 per million tokens (cache hit) - Updated Apr 29, 2026
24
+
description: `DeepSeek-V4-Flash is DeepSeek's fast, cost-efficient V4 model. It supports thinking and non-thinking modes, JSON output, tool calls, chat prefix completion (beta), and FIM completion (beta) in non-thinking mode.`,
// TODO(deepseek): Re-check V4 Pro discounted prices after DeepSeek's 2026-05-31 discount end date.
35
+
inputPrice: 0.435,// $0.435 per million tokens (cache miss, discounted) - Updated Apr 29, 2026
36
+
outputPrice: 0.87,// $0.87 per million tokens (discounted) - Updated Apr 29, 2026
37
+
cacheWritesPrice: 0.435,// $0.435 per million tokens (cache miss, discounted) - Updated Apr 29, 2026
38
+
cacheReadsPrice: 0.003625,// $0.003625 per million tokens (cache hit, discounted) - Updated Apr 29, 2026
39
+
description: `DeepSeek-V4-Pro is DeepSeek's strongest V4 model for reasoning, coding, long-context, and agentic workloads. It supports thinking and non-thinking modes, JSON output, tool calls, chat prefix completion (beta), and FIM completion (beta) in non-thinking mode.`,
40
+
},
41
+
// TODO(deepseek): Remove this compatibility alias after DeepSeek's 2026-07-24 retirement date.
12
42
"deepseek-chat": {
13
43
maxTokens: 8192,// 8K max output
14
44
contextWindow: 128_000,
@@ -18,8 +48,9 @@ export const deepSeekModels = {
18
48
outputPrice: 0.42,// $0.42 per million tokens - Updated Dec 9, 2025
19
49
cacheWritesPrice: 0.28,// $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
20
50
cacheReadsPrice: 0.028,// $0.028 per million tokens (cache hit) - Updated Dec 9, 2025
21
-
description: `DeepSeek-V3.2 (Non-thinking Mode) achieves a significant breakthrough in inference speed over previous models. It tops the leaderboard among open-source models and rivals the most advanced closed-source models globally. Supports JSON output, tool calls, chat prefix completion (beta), and FIM completion (beta).`,
51
+
description: `Legacy compatibility alias for the non-thinking mode of deepseek-v4-flash. DeepSeek plans to deprecate this model name on 2026-07-24.`,
22
52
},
53
+
// TODO(deepseek): Remove this compatibility alias after DeepSeek's 2026-07-24 retirement date.
23
54
"deepseek-reasoner": {
24
55
maxTokens: 8192,// 8K max output
25
56
contextWindow: 128_000,
@@ -30,7 +61,7 @@ export const deepSeekModels = {
30
61
outputPrice: 0.42,// $0.42 per million tokens - Updated Dec 9, 2025
31
62
cacheWritesPrice: 0.28,// $0.28 per million tokens (cache miss) - Updated Dec 9, 2025
32
63
cacheReadsPrice: 0.028,// $0.028 per million tokens (cache hit) - Updated Dec 9, 2025
33
-
description: `DeepSeek-V3.2 (Thinking Mode) achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks. Supports Chain of Thought reasoning with up to 8K output tokens. Supports JSON output, tool calls, and chat prefix completion (beta).`,
64
+
description: `Legacy compatibility alias for the thinking mode of deepseek-v4-flash. DeepSeek plans to deprecate this model name on 2026-07-24.`,
0 commit comments