Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/lib/savings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ export const ZGPU_PRICING: Record<string, { in: number; out: number }> = {
"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
Expand Down
10 changes: 10 additions & 0 deletions tests/savings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, { in: number; out: number }> = {
"gpt-oss-120b": { in: 0.15, out: 0.6 },
"qwen3-30b-a3b-fp8": { in: 0.05, out: 0.3 },
Expand All @@ -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", () => {
Expand Down