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
## Summary
Promote DeepSeek to a first-class provider in the curated model
registry, with explicit V4 Pro and V4 Flash entries (1M context, 384K
max output, full pricing + cache pricing) and proper "DeepSeek" branding
in the display formatter.
## Background
DeepSeek was already wired up as a provider (`@ai-sdk/deepseek` factory,
settings UI, OpenRouter route, API-key requirements), but no DeepSeek
model was in `knownModels.ts`, so users had no curated alias, no
tokenizer override, and no warm-up entry. With V4 in preview and the
legacy `deepseek-chat` / `deepseek-reasoner` IDs scheduled for
retirement, V4 should be the default DeepSeek anchor going forward.
## Implementation
- `src/common/constants/knownModels.ts`
- Extend `ModelProvider` to include `"deepseek"`.
- Add `DEEPSEEK_V4_PRO` (id `deepseek:deepseek-v4-pro`) — flagship; bare
`deepseek` alias points here, matching the convention `gemini` → Gemini
Pro, `grok` → Grok 4.1.
- Add `DEEPSEEK_V4_FLASH` (id `deepseek:deepseek-v4-flash`) — fast/cheap
tier, reachable via `deepseek-flash`.
- Both reuse `tokenizerOverride: "deepseek/deepseek-v3.1"` (latest
DeepSeek tokenizer published in `ai-tokenizer`) until V4's
`encoding_dsv4` lands upstream — same pattern OPUS/SONNET use.
- `src/common/utils/tokens/models-extra.ts`
- V4-Pro: 1M context, 384K output, $1.74/M input, $3.48/M output,
cache-hit input at 1/10 of input price.
- V4-Flash: 1M context, 384K output, $0.14/M input, $0.28/M output,
cache-hit input at 1/10 of input price.
- Recorded the post-promo (full) prices, not the launch-window 75%
discount, so cost forecasts don't silently regress when the promo ends.
- `src/common/utils/ai/modelDisplay.ts`
- Added a DeepSeek branch so ids render as `DeepSeek V4 Pro` instead of
the fallback `Deepseek V4 Pro` (mis-cased brand). Version-tag tokens
like `v4` / `r1` are uppercased; anything else is title-cased.
- Tests cover `deepseek-v4-pro`, `deepseek-v4-flash`, `deepseek-r1`,
`deepseek-chat`, and the gateway-scoped `deepseek/deepseek-v4-pro` form
(validates the existing slash-stripping branch routes through the new
handler).
- `docs/config/models.mdx` and the matching
`builtInSkillContent.generated.ts` — regenerated by `make fmt`.
## Validation
- `make fmt`, `make typecheck`, `make lint`, `make static-check` —
green.
- `bun test src/common/utils/ai/modelDisplay.test.ts` — passes new
DeepSeek cases.
- Jest `knownModels.test.ts` — passes (verifies every curated model
resolves in `models.json` or `models-extra.ts` and that aliases stay
unique).
- Bun-runner regression sweep on neighboring tests: `contextLimit`,
`modelStats`, `normalizeModelInput`, `modelPreferenceRepair`,
`aiService`.
## Risks
Low. Changes are additive in the model registry (new provider variant,
new entries) and the display formatter adds a leading branch with a
tight prefix guard (`deepseek-`); existing
Claude/GPT/Gemini/Ollama/fallback paths are untouched. Pricing values
are sourced from DeepSeek's published pricing page; if numbers move,
only `models-extra.ts` needs a refresh.
---
_Generated with `mux` • Model: `anthropic:claude-opus-4-7` • Thinking:
`max` • Cost: `$2.65`_
<!-- mux-attribution: model=anthropic:claude-opus-4-7 thinking=max
costs=2.65 -->
0 commit comments