oc_chat
Loading...
Searching...
No Matches
providers.deepseek.models Namespace Reference

Variables

dict MODELS
dict TIER_MAP
dict RETIRED_ALIASES

Detailed Description

DeepSeek model registry — typed.

Purpose
-------
:data:`MODELS` is the canonical, single-source-of-truth registry of
DeepSeek models with their capabilities. It is consumed by
:meth:`DeepSeekProvider.models` and through that by
:class:`oc_chat.core.models.ModelManager`.

:data:`TIER_MAP` records the semantic-tier → model-id mapping that
:meth:`DeepSeekProvider.tier` returns. ``step_routing.py`` reads
from this via ``provider.tier("cheap")`` /
``provider.tier("reasoning")`` to choose the per-iteration model.

Responsibilities
----------------
- :data:`MODELS` — typed ``dict[str, ModelCaps]`` covering the only two
  selectable DeepSeek models, ``deepseek-v4-pro`` and ``deepseek-v4-flash``
  (in menu order). ``deepseek-v3`` / ``deepseek-coder`` / ``deepseek-chat`` /
  ``deepseek-reasoner`` are retired aliases that migrate on load.
- :data:`TIER_MAP` — semantic-tier to model-id lookup
  (``default`` / ``cheap`` / ``reasoning`` / ``summary``).
- :data:`RETIRED_ALIASES` — retired model id → replacement id, used to
  filter live discovery and to migrate saved sessions deterministically
  (plan 135 §4.6): ``deepseek-chat`` → ``deepseek-v4-flash`` (keeps the
  cheap/non-thinking-default character), ``deepseek-reasoner`` →
  ``deepseek-v4-pro`` (keeps the thinking/reasoning character). The
  TUI-polish pass further retires the legacy non-V4 ids so only the two
  V4 models are selectable: ``deepseek-v3`` → ``deepseek-v4-flash`` (cheap,
  non-thinking) and ``deepseek-coder`` → ``deepseek-v4-pro`` (the V4 set is
  the coding-capable line now).

Diagnostics
-----------
Domain: OC_CHAT.CLIENT
Levels:
    L2 — lifecycle events
    L3 — semantic details
    L4 — deep tracing

Contracts
---------
- ``MODELS`` keys are exact DeepSeek API model ids — never aliases.
- Capability flags are immutable: edit this file to update a model's
  capabilities; do not mutate the dataclass at runtime.
- ``TIER_MAP`` values must always reference keys in ``MODELS``.
- ``RETIRED_ALIASES`` keys are NOT in ``MODELS`` (they are retired); each
  value MUST be a key in ``MODELS``. Migration is deterministic per alias
  — never collapse both aliases to one shared target.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- option_c_agent_contracts (ModelCaps capability record for each model)

Variable Documentation

◆ MODELS

dict providers.deepseek.models.MODELS
Initial value:
1= {
2 "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"),
3 "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"),
4}

Definition at line 72 of file models.py.

◆ RETIRED_ALIASES

dict providers.deepseek.models.RETIRED_ALIASES
Initial value:
1= {
2 "deepseek-chat": "deepseek-v4-flash",
3 "deepseek-reasoner": "deepseek-v4-pro",
4 "deepseek-v3": "deepseek-v4-flash",
5 "deepseek-coder": "deepseek-v4-pro",
6}

Definition at line 93 of file models.py.

◆ TIER_MAP

dict providers.deepseek.models.TIER_MAP
Initial value:
1= {
2 "default": "deepseek-v4-pro",
3 "cheap": "deepseek-v4-flash",
4 "reasoning": "deepseek-v4-pro",
5 "summary": "deepseek-v4-flash",
6}

Definition at line 83 of file models.py.