fix(sambanova): correct DeepSeek-V3.2 context window (32k -> 128k) - #32035
fix(sambanova): correct DeepSeek-V3.2 context window (32k -> 128k)#32035bhumikadangayach wants to merge 2 commits into
Conversation
Greptile SummaryThis PR fixes the
Confidence Score: 1/5Not safe to merge — the backup JSON file is malformed and will crash litellm in any scenario that falls back to it. The backup file's JSON structure is broken: the root object closes before litellm/model_prices_and_context_window_backup.json needs to be regenerated or hand-corrected so that
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Correctly updates sambanova/DeepSeek-V3.2 max_tokens, max_input_tokens, and max_output_tokens from 32768 to 131072; no other changes in this file |
| litellm/model_prices_and_context_window_backup.json | Contains the DeepSeek-V3.2 fix plus ~200+ unreferenced model additions/updates; critically, repositioning the darkbloom entries breaks the JSON structure — the root object closes before fallback_generalizations, making the file unparseable |
Comments Outside Diff (1)
-
litellm/model_prices_and_context_window_backup.json, line 1 (link)Backup file diverges significantly from the primary file
The PR description states "Backup file synced to match primary," but the diff shows the backup contains ~200+ lines of additional changes absent from
model_prices_and_context_window.json: new model entries (gemini-3-pro-image,gemini-3.1-flash-imageforvertex_ai/gemini/bare variants,openrouter/z-ai/glm-5.1,zai/glm-5.1,zai/glm-4.7-flash), updatedmax_input_tokensvalues for several OpenAI models, correctedmax_output_tokens/max_tokensforo1-provariants, and repositioneddarkbloomentries. The two files are not in sync. Any user relying on the backup will get different model data than a user relying on the primary.
Reviews (1): Last reviewed commit: "fix(sambanova): correct DeepSeek-V3.2 co..." | Re-trigger Greptile
| }, | ||
| "fallback_generalizations": { |
There was a problem hiding this comment.
Broken JSON structure — backup file is now invalid
The relocation of the darkbloom model entries introduced a malformed JSON structure. At line 44015 the root object is closed by } followed by a trailing ,, and "fallback_generalizations" appears on the next line at 0-space indentation — outside the root {}. This makes the file invalid JSON that json.loads() will reject with a JSONDecodeError.
load_local_model_cost_map() in get_model_cost_map.py has no try/except around json.loads(), so this will crash litellm in any scenario where the backup is needed: when LITELLM_LOCAL_MODEL_COST_MAP=True, when the remote fetch fails (the fallback path at lines 295–297 of get_model_cost_map.py), and during integrity validation via _get_backup_model_count(). Compare with the primary file (model_prices_and_context_window.json line 44008–44009) where gpt-oss-20b correctly closes with }, (comma included) and fallback_generalizations remains at 2-space indent inside the root object.
There was a problem hiding this comment.
Fixed in 748ddd3 — regenerated the backup directly from the primary file. Both files are now in sync and valid JSON (verified locally with json.load()). The Greptile review is based on the first commit before the fix — please re-trigger to confirm.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Follow-up to #30016.
Greptile flagged in that PR that DeepSeek-V3.2's 32k context window might be a repeat of the same copy-paste mistake that was just fixed for DeepSeek-V3.1 (also 32k -> 128k). Confirmed via multiple sources (OpenRouter, Artificial Analysis, DeepSeek's own technical paper) that DeepSeek-V3.2 has a 128k (131,072 token) context window, matching its V3.1 predecessor's architecture lineage.
Fixed max_tokens, max_input_tokens, and max_output_tokens for sambanova/DeepSeek-V3.2 from 32768 → 131072. Pricing and other fields unchanged.
Backup file synced to match primary.
Supersedes #31417 (rebased onto current litellm_oss_staging).