fix(catalog): rename the DeepSeek flash model to its canonical id deepseek-flash - #233
Merged
Merged
Conversation
…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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-flashanddeepseek-v4-flash-vision-expare retired (requests tothose names still answer, but DeepSeek routes them to DeepSeek-V4.1-Flash and bills Flash prices).
deepseek-v4-prois unchanged.Why it mattered:
POST /api/sharingsvalidates that a share is priceable withSELECT 1 FROM models WHERE provider = ?1 AND model = ?2, so listing a share of the new model wasrejected - the name was in neither
config/config.example.tomlnor the seededmodelstable.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 nonew 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 becomesdeepseek-flashwith the official prices(idle cache-hit
0.02/ uncached1.0/ output4.0CNY per 1M; peak0.04/2.0/8.0),vision = true(V4.1-Flash is natively multimodal), context 1M / max output 384K. The separatedeepseek-v4-flash-vision-expentry is folded into it, so the catalogue is now 13 models.ui/js/data.js: theMODELS/MARKETmirrors follow (13 models, 7 on sale).src/catalog_gate.rs:MODEL_COUNT14 -> 13,KNOWN_MODEL/KNOWN_INPUT/KNOWN_OUTPUTupdated to the new name and prices.
src/config.rs,src/db.rs,src/routes/sharing.rs: fixtures and catalogue assertions updated.config.rsadditionally asserts that the retired names are gone from the catalogue and thatdeepseek-flashis a vision model.docs/plan-api-matrix.md: stop hardcoding the catalogue size (it points at the single source oftruth instead, so it cannot rot on the next change).
ui/index.html:data.jscache-bust.Config/data-structure changes are mirrored into the example file
Tests
cargo testall green - 239 passed / 0 failed (the count is unchanged: no test was addedor removed, the catalogue assertions were updated in place)
cargo fmt --checkexit 0cargo clippy --all-targets -- -D warningsclean on CI's stable toolchain(main's latest run: step
Run clippy= success). Disclosure: the only complete toolchaininstallable in the sandbox is rustc/clippy 1.95.0, whose clippy additionally reports one
collapsible_matchatsrc/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.
A/B evidence
Two instruments.
probe= the catalogue facts, read from the carriers and compared against theofficial page (
config [[models]],ui/js/data.jsMODELS/MARKET, the doc);rust= the committedcargo testsuite, re-run against four trees.v0_orig{A1 A2 A3 A4 A5 A7 A8 A9}(probe)m_add_only{A4 A5 A7}m_oldprice{A2 A5}m_novisiondeepseek-flashwithout vision{A3 A4 A7}m_nobust{A8}R1_countMODEL_COUNTleft at 14catalog_gate::tests::extractors_are_aliveR2_pricecatalog_gate×3,config::tests::parse_config_example_ok,db::tests::seed_models_upserts_from_config_modelsR3_nameroutes::sharing::tests×6live{}(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
--quietflag removed from the harness - libtest's--quietprints 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
fix/deepseek-flash-canonical-modelDeployment note
src/db.rs::seed_modelsis a full sync:[[models]]is authoritative and rows absent from itare deleted at startup. Only the in-repo
config.example.tomlis edited here, so a runningdeployment must apply the same rename to its own (gitignored)
config.tomland restart so thecatalogue 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.