6DeepSeek model registry — typed.
10:data:`MODELS` is the canonical, single-source-of-truth registry of
11DeepSeek models with their capabilities. It is consumed by
12:meth:`DeepSeekProvider.models` and through that by
13:class:`oc_chat.core.models.ModelManager`.
15:data:`TIER_MAP` records the semantic-tier → model-id mapping that
16:meth:`DeepSeekProvider.tier` returns. ``step_routing.py`` reads
17from this via ``provider.tier("cheap")`` /
18``provider.tier("reasoning")`` to choose the per-iteration model.
22- :data:`MODELS` — typed ``dict[str, ModelCaps]`` covering the only two
23 selectable DeepSeek models, ``deepseek-v4-pro`` and ``deepseek-v4-flash``
24 (in menu order). ``deepseek-v3`` / ``deepseek-coder`` / ``deepseek-chat`` /
25 ``deepseek-reasoner`` are retired aliases that migrate on load.
26- :data:`TIER_MAP` — semantic-tier to model-id lookup
27 (``default`` / ``cheap`` / ``reasoning`` / ``summary``).
28- :data:`RETIRED_ALIASES` — retired model id → replacement id, used to
29 filter live discovery and to migrate saved sessions deterministically
30 (plan 135 §4.6): ``deepseek-chat`` → ``deepseek-v4-flash`` (keeps the
31 cheap/non-thinking-default character), ``deepseek-reasoner`` →
32 ``deepseek-v4-pro`` (keeps the thinking/reasoning character). The
33 TUI-polish pass further retires the legacy non-V4 ids so only the two
34 V4 models are selectable: ``deepseek-v3`` → ``deepseek-v4-flash`` (cheap,
35 non-thinking) and ``deepseek-coder`` → ``deepseek-v4-pro`` (the V4 set is
36 the coding-capable line now).
48- ``MODELS`` keys are exact DeepSeek API model ids — never aliases.
49- Capability flags are immutable: edit this file to update a model's
50 capabilities; do not mutate the dataclass at runtime.
51- ``TIER_MAP`` values must always reference keys in ``MODELS``.
52- ``RETIRED_ALIASES`` keys are NOT in ``MODELS`` (they are retired); each
53 value MUST be a key in ``MODELS``. Migration is deterministic per alias
54 — never collapse both aliases to one shared target.
58- oc_diagnostics (structured debug logging via _dbg)
59- option_c_agent_contracts (ModelCaps capability record for each model)
61from __future__
import annotations
63from oc_diagnostics
import _dbg
65from option_c_agent_contracts
import ModelCaps
67_dbg(
"OC_CHAT.CLIENT",
"module",
"loaded", 4)
72MODELS: dict[str, ModelCaps] = {
73 "deepseek-v4-pro": ModelCaps(supports_thinking=
True, supports_reasoning=
True, supports_tools=
True, max_context_tokens=1_000_000, max_output_tokens=384_000, reasoning_state=
"text", cache_strategy=
"automatic"),
74 "deepseek-v4-flash": ModelCaps(supports_thinking=
False, supports_reasoning=
False, supports_tools=
True, max_context_tokens=1_000_000, max_output_tokens=384_000, cache_strategy=
"automatic"),
83TIER_MAP: dict[str, str] = {
84 "default":
"deepseek-v4-pro",
85 "cheap":
"deepseek-v4-flash",
86 "reasoning":
"deepseek-v4-pro",
87 "summary":
"deepseek-v4-flash",
93RETIRED_ALIASES: dict[str, str] = {
94 "deepseek-chat":
"deepseek-v4-flash",
95 "deepseek-reasoner":
"deepseek-v4-pro",
96 "deepseek-v3":
"deepseek-v4-flash",
97 "deepseek-coder":
"deepseek-v4-pro",
101__all__ = [
"MODELS",
"TIER_MAP",
"RETIRED_ALIASES"]