From 675bdd323c8af3ee1eff48db67b0cec37abba21d Mon Sep 17 00:00:00 2001 From: Amaan Date: Fri, 21 Aug 2026 17:32:35 +0530 Subject: [PATCH] feat/new-models-embeddings-t5-multi-iab: Price the five models the savings table was missing Checked ZGPU_PRICING against the dashboard model-pricing API (api-dashboard.zerogpu.ai/api/model-pricing/with-model), the authoritative price list behind the catalog. Five ids it serves had no entry here, so every call routed to one of them fell through to ZGPU_FALLBACK and was costed at glm-5.2's $1.10/$3.50. zlm-v1-moderation-edge $0.02 / $0.05 t5-small $0.05 / $0.40 zlm-v1-multi-iab-classify $0.05 / $0.40 all-minilm-l6-v2 $0.50 / not billed bge-small-en-v1.5 $0.50 / not billed zlm-v1-moderation-edge is the one that was actually costing users accuracy: it has been in the published catalog since the moderation docs landed, and the fallback prices it 55x over on input. Because savings are reported as baseline minus ZeroGPU cost, overstating the ZeroGPU rate *understates* what the user saved, which is the safe direction to be wrong in but still wrong. The two embedding models bill input tokens only, so `out: 0` is the real published rate rather than a placeholder, and the comment says so to stop a future reader from "fixing" it. No CLI command routes to an embedding model yet; they are priced so the table stays a faithful mirror of the catalog and so the two-way test below keeps passing once the docs list them. ZGPU_FALLBACK is unchanged: glm-5.2 at $1.10/$3.50 is still the priciest published rate, so the "never overstates savings" invariant still holds. The catalog transcription in tests/savings.test.ts is updated in step, which is what forces src/lib/savings.ts to change with the catalog in both directions. That table now carries one deliberate exception, documented inline: zlm-v1-followup-questions-edge was dropped from the published catalog when the model was deprecated, but `zerogpu generate-followups` still routes to it, so the CLI must still price it. Both entries should go together when that command does. All 40 tests pass; tsc --noEmit and eslint are clean. Co-Authored-By: Claude Opus 5 (1M context) --- src/lib/savings.ts | 7 +++++++ tests/savings.test.ts | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/lib/savings.ts b/src/lib/savings.ts index 8cf26b0..4441721 100644 --- a/src/lib/savings.ts +++ b/src/lib/savings.ts @@ -34,6 +34,13 @@ export const ZGPU_PRICING: Record = { "deberta-v3-small": { in: 0.02, out: 0.05 }, "LFM2.5-1.2B-Thinking": { in: 0.02, out: 0.05 }, "LFM2.5-1.2B-Instruct": { in: 0.02, out: 0.05 }, + "zlm-v1-moderation-edge": { in: 0.02, out: 0.05 }, + "t5-small": { in: 0.05, out: 0.4 }, + "zlm-v1-multi-iab-classify": { in: 0.05, out: 0.4 }, + // Embedding models bill input tokens only; there are no output tokens to + // charge, so `out: 0` is the real rate, not a placeholder. + "all-minilm-l6-v2": { in: 0.5, out: 0 }, + "bge-small-en-v1.5": { in: 0.5, out: 0 }, }; // Conservative fallback for any model id not in the table above: the priciest // published rate, so an unlisted model never overstates savings. Currently diff --git a/tests/savings.test.ts b/tests/savings.test.ts index f7347e8..56e140e 100644 --- a/tests/savings.test.ts +++ b/tests/savings.test.ts @@ -110,6 +110,11 @@ describe("ZGPU_PRICING tracks the published model catalog", () => { // below then force src/lib/savings.ts to change with it. Without this guard the // CLI silently keeps a stale rate and misreports savings — which is exactly how // gpt-oss-120b sat at $0.03/$0.10 long after it was repriced to $0.15/$0.60. + // + // One deliberate exception: zlm-v1-followup-questions-edge was removed from + // the published catalog when the model was deprecated, but `zerogpu + // generate-followups` still routes to it, so the CLI must still price it. + // Drop both entries together when that command goes. const CATALOG: Record = { "gpt-oss-120b": { in: 0.15, out: 0.6 }, "qwen3-30b-a3b-fp8": { in: 0.05, out: 0.3 }, @@ -125,6 +130,11 @@ describe("ZGPU_PRICING tracks the published model catalog", () => { "deberta-v3-small": { in: 0.02, out: 0.05 }, "LFM2.5-1.2B-Thinking": { in: 0.02, out: 0.05 }, "LFM2.5-1.2B-Instruct": { in: 0.02, out: 0.05 }, + "zlm-v1-moderation-edge": { in: 0.02, out: 0.05 }, + "t5-small": { in: 0.05, out: 0.4 }, + "zlm-v1-multi-iab-classify": { in: 0.05, out: 0.4 }, + "all-minilm-l6-v2": { in: 0.5, out: 0 }, + "bge-small-en-v1.5": { in: 0.5, out: 0 }, }; it("prices every catalog model at the published rate", () => {