Skip to content

fix(catalog): rename the DeepSeek flash model to its canonical id deepseek-flash - #233

Merged
argszero merged 1 commit into
mainfrom
fix/deepseek-flash-canonical-model
Sep 14, 2026
Merged

argszero merged 1 commit into
mainfrom
fix/deepseek-flash-canonical-model

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Rename the DeepSeek flash model to its current canonical id deepseek-flash.

The upstream docs (https://api-docs.deepseek.com/zh-cn/ , checked 2026-09-14) now name the model
deepseek-flash; deepseek-v4-flash and deepseek-v4-flash-vision-exp are retired (requests to
those names still answer, but DeepSeek routes them to DeepSeek-V4.1-Flash and bills Flash prices).
deepseek-v4-pro is unchanged.

Why it mattered: POST /api/sharings validates that a share is priceable with
SELECT 1 FROM models WHERE provider = ?1 AND model = ?2, so listing a share of the new model was
rejected - the name was in neither config/config.example.toml nor the seeded models table.

Rename only, deliberately no alias handling: the retired names are dead and upstream-routed, and
"a deleted model bills 0" is the documented behaviour (admin.models.sub), so dropping them adds no
new defect class.

Related Issue

No issue exists for this - it was found from a direct report and upstream docs. Left empty on
purpose rather than fabricating one.

Changes

  • config/config.example.toml: the flash row becomes deepseek-flash with the official prices
    (idle cache-hit 0.02 / uncached 1.0 / output 4.0 CNY per 1M; peak 0.04 / 2.0 / 8.0),
    vision = true (V4.1-Flash is natively multimodal), context 1M / max output 384K. The separate
    deepseek-v4-flash-vision-exp entry is folded into it, so the catalogue is now 13 models.

  • ui/js/data.js: the MODELS / MARKET mirrors follow (13 models, 7 on sale).

  • src/catalog_gate.rs: MODEL_COUNT 14 -> 13, KNOWN_MODEL / KNOWN_INPUT / KNOWN_OUTPUT
    updated to the new name and prices.

  • src/config.rs, src/db.rs, src/routes/sharing.rs: fixtures and catalogue assertions updated.
    config.rs additionally asserts that the retired names are gone from the catalogue and that
    deepseek-flash is a vision model.

  • docs/plan-api-matrix.md: stop hardcoding the catalogue size (it points at the single source of
    truth instead, so it cannot rot on the next change).

  • ui/index.html: data.js cache-bust.

  • Config/data-structure changes are mirrored into the example file

Tests

  • cargo test all green - 239 passed / 0 failed (the count is unchanged: no test was added
    or removed, the catalogue assertions were updated in place)
  • cargo fmt --check exit 0
  • cargo clippy --all-targets -- -D warnings clean on CI's stable toolchain
    (main's latest run: step Run clippy = success). Disclosure: the only complete toolchain
    installable in the sandbox is rustc/clippy 1.95.0, whose clippy additionally reports one
    collapsible_match at src/protocol.rs:662 - pre-existing, out of this diff (landed in fix(protocol): give every announced responses item a unique output_index and its own order #207,
    green CI ever since) and therefore deliberately not touched here.
  • Unit tests updated (catalogue assertions) - no new test was needed for a rename

A/B evidence

Two instruments. probe = the catalogue facts, read from the carriers and compared against the
official page (config [[models]], ui/js/data.js MODELS/MARKET, the doc); rust = the committed
cargo test suite, re-run against four trees.

leg content red set
v0_orig pre-change catalog {A1 A2 A3 A4 A5 A7 A8 A9} (probe)
m_add_only the new name added, the old rows kept {A4 A5 A7}
m_oldprice the new name with the old price {A2 A5}
m_novision deepseek-flash without vision {A3 A4 A7}
m_nobust the catalogue edited but not the guest mirror {A8}
R1_count MODEL_COUNT left at 14 catalog_gate::tests::extractors_are_alive
R2_price the flash row keeps the old price 5 tests: catalog_gate ×3, config::tests::parse_config_example_ok, db::tests::seed_models_upserts_from_config_models
R3_name the flash row keeps the old name 11 tests: the 5 above + routes::sharing::tests ×6
live the working tree {} (239 passed)

The three Rust legs red pairwise-distinct sets and the mutated files were restored
byte-identically (md5 asserted before/after on both carriers). Note: the Rust legs were re-run with
the --quiet flag removed from the harness - libtest's --quiet prints one character per test,
which made every mutation leg read green (an A/B with no discriminating power). The corrected
harness also asserts that the parser actually saw per-test lines (239 in every leg), so a silent
parser can never report a green matrix again.

Checklist

  • Branch naming follows the convention: fix/deepseek-flash-canonical-model
  • Commit message uses Conventional Commits
  • Single responsibility, minimal change

Deployment note

src/db.rs::seed_models is a full sync: [[models]] is authoritative and rows absent from it
are deleted at startup. Only the in-repo config.example.toml is edited here, so a running
deployment must apply the same rename to its own (gitignored) config.toml and restart so the
catalogue re-seeds. The retired names keep working upstream but are routed to V4.1-Flash and billed
at Flash prices, so keeping them listed would advertise a model that no longer exists.

…pseek-flash

The DeepSeek docs (https://api-docs.deepseek.com/zh-cn/, checked 2026-09-14)
now name the model `deepseek-flash`; the old `deepseek-v4-flash` and
`deepseek-v4-flash-vision-exp` are retired (requests to those names still
answer, but DeepSeek routes them to DeepSeek-V4.1-Flash and bills Flash
prices). `deepseek-v4-pro` is unchanged.

Why this mattered: `POST /api/sharings` validates that a share is priceable
with `SELECT 1 FROM models WHERE provider = ?1 AND model = ?2`, so listing a
share of the new model was rejected because the name was in neither
`config/config.example.toml` nor the seeded `models` table.

Rename only - deliberately no alias handling. The retired names are dead and
upstream-routed, and "a deleted model bills 0" is the documented behaviour
(`admin.models.sub`), so dropping them introduces no new defect class.

- config/config.example.toml: the flash row becomes `deepseek-flash` with the
  official prices (idle cache-hit 0.02 / uncached 1.0 / output 4.0 CNY per 1M;
  peak 0.04 / 2.0 / 8.0), `vision = true` (V4.1-Flash is natively multimodal)
  and context 1M / max output 384K; the separate `deepseek-v4-flash-vision-exp`
  entry is folded into it, so the catalogue is 13 models.
- ui/js/data.js: the MODELS / MARKET mirrors follow (13 models, 7 on sale).
- src/catalog_gate.rs: MODEL_COUNT 14 -> 13, KNOWN_MODEL / KNOWN_INPUT /
  KNOWN_OUTPUT updated to the new name and prices.
- src/config.rs, src/db.rs, src/routes/sharing.rs: fixtures and catalog
  assertions updated; `config.rs` now also asserts that the retired names are
  gone and that `deepseek-flash` is a vision model.
- docs/plan-api-matrix.md: stop hardcoding the catalogue size (point at the
  single source of truth instead).
- ui/index.html: data.js cache-bust.

Deployment note: `seed_models` is a full sync - `config`'s `[[models]]` is
authoritative and rows absent from it are deleted at startup - so a deployment
must apply the same rename to its own (gitignored) config.toml and restart.

Tests: `cargo test` 239 passed / 0 failed (the count is unchanged - no test was
added or removed, the catalogue assertions were updated in place);
`cargo fmt --check` exit 0. Clippy is clean on CI's stable toolchain (main's
last run: "Run clippy" success). The only complete toolchain installable in
this sandbox is rustc/clippy 1.95.0, whose clippy additionally flags one
pre-existing `collapsible_match` in `src/protocol.rs:662` - a file this change
does not touch (it landed in #207 and its CI has been green since), so it is
left alone rather than fixed opportunistically here.
@argszero
argszero merged commit 11c5324 into main Sep 14, 2026
1 check passed
@argszero
argszero deleted the fix/deepseek-flash-canonical-model branch September 14, 2026 11:01
@argszero argszero mentioned this pull request Sep 14, 2026
11 tasks
argszero added a commit that referenced this pull request Sep 14, 2026
Ships the 76 PRs merged since v0.7.22 (#161-#237), the largest release so far.
Database schema moves 12 -> 14:

- v13 (#217): `keys.used` changes unit from tokens to points, and the live
  values are healed from the ledger (`used = SUM(transactions.pts WHERE
  type='consume')`), gated on schema_version < 13.
- v14 (#234): four indexes for the monthly aggregates —
  `transactions(user_id, time, type, pts)`, `transactions(time, type, pts)`,
  `usage_records(time)`, `usage_records(user_id, time)`.

Deployments must apply the DeepSeek flash rename (#233) to their own
config.toml: `seed_models` is a full sync, so a model absent from the config is
deleted at startup; the retired names are gone from config.example.toml.

- Cargo.toml / Cargo.lock: 0.7.22 -> 0.7.23.
- ui/index.html: asset cache-bust 20260912-4 / 20260912-5 / 20260914-1 /
  20260914-4 / 20260914-9 -> 20260914-10 (all five refs).
- CHANGELOG.md: v0.7.23 entry, grouped by area with the PR and hash of each fix.

Gates: `cargo test` 249 passed / 0 failed, `cargo fmt --check` clean,
`node --check` on the four ui/js files OK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant