Sync ZGPU_PRICING with the published model catalog, and guard it against drift - #5
Conversation
Checked every model in the docs catalog against the CLI. No model id is
missing: all 14 published models already have a ZGPU_PRICING entry and are
reachable from a command, and CHAT_MODELS covers all six text-generation
models the catalog exposes for chat. The gap was not coverage, it was a
price.
gpt-oss-120b was repriced to $0.15 / $0.60 per 1M (docs commits "fixed
pricing discrepancy" and "increased price for gpt-oss"); the CLI still had
{0.03, 0.10}. Because savings are reported as baseline cost minus ZeroGPU
cost, understating the ZeroGPU rate 5x on input and 6x on output made every
gpt-oss-120b call report more saved than was actually saved. That is the one
number in this table a user is asked to trust, so it is now correct.
ZGPU_FALLBACK is unchanged: glm-5.2 at {1.10, 3.50} is still the priciest
published rate, and the existing "never overstates savings" invariant still
holds with gpt-oss at its true price.
The real defect was that nothing tied this table to the catalog, so a docs
reprice could sit unnoticed indefinitely. ZGPU_PRICING is now exported and
pinned by two tests: one asserts every catalog model carries the published
rate, the other asserts nothing is priced that the catalog does not list, so
drift fails CI in both directions instead of quietly misreporting. Both were
verified to fail when the stale rate is restored and when an unlisted model
is added.
Not added: zlm-v1-moderation-edge, referenced by the Claude Skill docs but
absent from the model catalog, both OpenAPI enums, and any model page. It
has no published price or endpoint contract to implement against, so adding
it would mean inventing both.
Co-Authored-By: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change exports ChangesZeroGPU pricing catalog
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
The ask was to add models missing from the CLI. I checked, and no model is missing — so this PR fixes what was actually wrong instead.
All 14 models in the model catalog already have a
ZGPU_PRICINGentry and are reachable from a command, andCHAT_MODELSalready covers all six text-generation models the catalog exposes for chat. Verified three independent ways: a set-diff of the catalog table againstZGPU_PRICING(empty in the docs→CLI direction), thedocs/text-generationmodel list, and both OpenAPI enums inzerogpu.openapi.json.The gap was not coverage, it was a price.
gpt-oss-120bwas repriced to $0.15 / $0.60 per 1M (docs commitsc316853"fixed pricing discrepancy" andeff3ac4"increased price for gpt-oss"); the CLI still carried{0.03, 0.10}.That one is worth stating plainly: savings are reported as baseline cost − ZeroGPU cost, so understating the ZeroGPU rate 5× on input and 6× on output made every
gpt-oss-120bcall report more saved than was actually saved. It is the one number in this table a user is asked to trust.The deeper defect is that nothing tied this table to the catalog, so a docs reprice could — and did — sit unnoticed indefinitely. That's the part this PR is really for.
Changes
src/lib/savings.ts— correctgpt-oss-120bto{ in: 0.15, out: 0.6 }; exportZGPU_PRICINGso it can be pinned by a test.tests/savings.test.ts— transcribe the full published catalog and assert against it in both directions: every catalog model carries the published rate, and nothing is priced that the catalog does not list (catching a retired model or a typo'd id). Drift now fails CI instead of quietly misreporting savings.ZGPU_FALLBACKis unchanged —glm-5.2at{1.10, 3.50}is still the priciest published rate, and the existing "never overstates savings" invariant still holds withgpt-oss-120bat its true price.Not added:
zlm-v1-moderation-edge. It's referenced byintegrations/claude-skill.mdxbut is absent from the model catalog, both OpenAPI enums, and any model page — no published price or endpoint contract to implement against, so adding it would mean inventing both. Flagging rather than guessing.Verification
Beyond the suite passing, I confirmed the new guard isn't vacuous by mutating the source and watching it fail:
{0.03, 0.10}gpt-oss-120b: ZGPU_PRICING disagrees with the published catalogghost-model-v9+ "ghost-model-v9"Checklist
npm run lintpassesnpm testpasses (40 passed, up from 38)npm run buildsucceedsdocs/change needed, prices are not quoted outsidesavings.ts(verified by grep). No model coverage changed, so thechatmodel tables are still accurate.Generated by Claude Code
Summary by CodeRabbit
Bug Fixes
gpt-oss-120bmodel to reflect the published catalog rates.Tests