Skip to content

Sync ZGPU_PRICING with the published model catalog, and guard it against drift - #5

Merged
amaan-ai20 merged 1 commit into
mainfrom
claude/missing-models-cli-a2zyza
Aug 3, 2026
Merged

Sync ZGPU_PRICING with the published model catalog, and guard it against drift#5
amaan-ai20 merged 1 commit into
mainfrom
claude/missing-models-cli-a2zyza

Conversation

@amaan-ai20

@amaan-ai20 amaan-ai20 commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

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_PRICING entry and are reachable from a command, and CHAT_MODELS already covers all six text-generation models the catalog exposes for chat. Verified three independent ways: a set-diff of the catalog table against ZGPU_PRICING (empty in the docs→CLI direction), the docs/text-generation model list, and both OpenAPI enums in zerogpu.openapi.json.

The gap was not coverage, it was a price. gpt-oss-120b was repriced to $0.15 / $0.60 per 1M (docs commits c316853 "fixed pricing discrepancy" and eff3ac4 "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-120b call 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 — correct gpt-oss-120b to { in: 0.15, out: 0.6 }; export ZGPU_PRICING so 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_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-120b at its true price.

Not added: zlm-v1-moderation-edge. It's referenced by integrations/claude-skill.mdx but 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:

Mutation Result
Restore the stale {0.03, 0.10} ❌ fails — gpt-oss-120b: ZGPU_PRICING disagrees with the published catalog
Add an unlisted ghost-model-v9 ❌ fails — + "ghost-model-v9"
Neither (as committed) ✅ 40 passed

Checklist

  • npm run lint passes
  • npm test passes (40 passed, up from 38)
  • npm run build succeeds
  • Documentation updated (if user-facing behavior changed) — n/a: no README/docs/ change needed, prices are not quoted outside savings.ts (verified by grep). No model coverage changed, so the chat model tables are still accurate.

Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Updated ZeroGPU pricing for the gpt-oss-120b model to reflect the published catalog rates.
  • Tests

    • Added coverage to verify that all published ZeroGPU models and pricing rates remain synchronized with the catalog.

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>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8dc8a2fb-e1d6-4a70-8ca9-c8d3e8e8966b

📥 Commits

Reviewing files that changed from the base of the PR and between 94b1deb and 28b5e47.

📒 Files selected for processing (2)
  • src/lib/savings.ts
  • tests/savings.test.ts

📝 Walkthrough

Walkthrough

The change exports ZGPU_PRICING, updates gpt-oss-120b rates, and adds tests that enforce exact alignment with the published ZeroGPU model catalog.

Changes

ZeroGPU pricing catalog

Layer / File(s) Summary
Pricing update and catalog validation
src/lib/savings.ts, tests/savings.test.ts
ZGPU_PRICING is exported. gpt-oss-120b rates change to 0.15 input and 0.6 output per 1M tokens. Tests verify exact model coverage and rates.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • zerogpu/cli#3: Updates and exports ZGPU_PRICING for catalog-consistency tests.
  • zerogpu/cli#4: Updates ZeroGPU pricing in the same source and test files.

Poem

A rabbit checked the pricing chart,
With careful paws and coding art.
The models match, the rates align,
Each catalog entry stands in line.
Hop, hop—tests keep the table fine!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the pricing synchronization and drift-prevention tests in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/missing-models-cli-a2zyza

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@amaan-ai20
amaan-ai20 merged commit 37c3cd7 into main Aug 3, 2026
2 checks passed
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.

2 participants