feat(deepseek): add DeepSeek V4 Pro and V4 Flash model metadata#26380
Conversation
Add model pricing, context window, and capability metadata for the new DeepSeek V4 model series: - deepseek-v4-flash: 1M context, 384K output, .14/M input, .28/M output - deepseek-v4-pro: 1M context, 384K output, .74/M input, .48/M output Both models support function calling, tool choice, reasoning, response schema, prompt caching, and streaming. Entries added with both bare and provider-prefixed keys. Source: https://api-docs.deepseek.com/quick_start/pricing
|
|
Low: No security issues foundThis PR adds static model metadata entries (pricing, context window, capability flags) for DeepSeek V4 Pro and V4 Flash to a JSON configuration file, along with corresponding tests. No executable code, no user input handling, no secrets, no auth changes. Status: 0 open Posted by Veria AI · 2026-04-24T03:49:36.997Z |
Greptile SummaryThis PR adds pricing and capability metadata for two new DeepSeek V4 models ( Confidence Score: 3/5Not safe to merge until the deepseek-v4-pro pricing values are verified against official docs — the description and JSON diverge by more than 2× on both input and output cost per token. A P1 pricing mismatch on deepseek-v4-pro (description says $0.74/M input / $0.48/M output, JSON encodes $1.74/M / $3.48/M) must be resolved before merging, as it will either over-charge or under-charge users. The JSON values look internally self-consistent (2× output ratio, same as v4-flash), but cannot be confirmed without checking the live DeepSeek pricing page. model_prices_and_context_window.json — the deepseek-v4-pro input/output cost fields need verification.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds 4 model entries (bare + provider-prefixed) for deepseek-v4-flash and deepseek-v4-pro; v4-flash pricing matches description, but v4-pro JSON prices ($1.74/M in, $3.48/M out) differ significantly from the PR description table ($0.74/M in, $0.48/M out) — needs verification. |
| tests/test_litellm/test_deepseek_model_metadata.py | Adds 14 tests verifying V4 metadata existence and values; tests are mock-safe (no network calls) but load JSON from disk via path construction rather than using litellm.model_cost like the existing test patterns. |
Reviews (1): Last reviewed commit: "feat(deepseek): add DeepSeek V4 Pro and ..." | Re-trigger Greptile
| "supports_response_schema": true, | ||
| "supports_system_messages": true, | ||
| "supports_tool_choice": true | ||
| }, | ||
| "deepseek-v4-pro": { | ||
| "cache_creation_input_token_cost": 0.0, |
There was a problem hiding this comment.
Pricing mismatch between description and JSON for
deepseek-v4-pro
The PR description table states input_cost_per_token = $0.74/M and output_cost_per_token = $0.48/M, but the JSON contains:
input_cost_per_token:1.74e-06→ $1.74/Moutput_cost_per_token:3.48e-06→ $3.48/M
The JSON values look internally consistent (same 2× ratio as v4-flash, and output > input), suggesting the PR description contains typos (.74 instead of 1.74, and .48 instead of 3.48). However, please verify these values against the official DeepSeek pricing page before merging to avoid billing users at the wrong rate.
| class TestDeepSeekV4ModelMetadata: | ||
| """Verify that DeepSeek V4 Flash and V4 Pro model entries exist | ||
| and have correct metadata in the main JSON file.""" | ||
|
|
||
| def _load_main_json(self) -> dict: | ||
| main_path = os.path.join( | ||
| os.path.dirname(os.path.dirname(litellm.__file__)), | ||
| "model_prices_and_context_window.json", | ||
| ) |
There was a problem hiding this comment.
Tests bypass
litellm.model_cost and load JSON directly from disk
The existing TestBareModelFallback class above uses litellm.model_cost (in-memory, already loaded), but the new _load_main_json() method reconstructs a filesystem path on every test call using os.path.dirname. This is fragile — it silently resolves to a different file if the package is installed as a wheel, or when the repo is checked out in an unexpected structure. Consider using litellm.model_cost consistently:
def _get_entry(self, key: str) -> dict:
return litellm.model_cost[key]| @@ -9641,6 +9641,56 @@ | |||
| "supports_system_messages": true, | |||
| "supports_tool_choice": false | |||
| }, | |||
There was a problem hiding this comment.
cache_creation_input_token_cost: 0.0 — verify free cache writes
Both v4 entries set cache_creation_input_token_cost to 0.0. Most DeepSeek models do charge for writing to cache (e.g., existing deepseek-r1 entries). If DeepSeek V4 genuinely offers free cache creation, this is fine, but it should be explicitly confirmed against the pricing page to avoid under-billing.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Add model pricing, context window, and capability metadata for the new DeepSeek V4 model series.
Models Added
Capabilities
Both models support:
Changes
Notes
AI Disclosure
This PR was authored with AI assistance.