mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-27 22:15:33 +00:00
fix(pricing): add Sonnet 5 and Fable 5 to the canonical chat-pricing table (#2799)
claude-sonnet-5 and claude-fable-5 are GA Anthropic models, but neither was in CANONICAL_PRICING. A brain routing a tier to them (e.g. models.tier.reasoning = anthropic:claude-sonnet-5) ran with cost telemetry blind on that tier: canonicalLookup missed, the budget meter logged BUDGET_METER_NO_PRICING and disabled the gate, and cost views under-reported spend. - model-pricing.ts: anthropic:claude-sonnet-5 at $3/$15 and anthropic:claude-fable-5 at $10/$50. Sonnet 5's launch intro discount ($2/$10 through 2026-08-31) is deliberately not modeled — the table carries standard rates so estimates stay conservative and the entry needs no time-bombed edit when the promo lapses. - takes-quality-eval/pricing.ts: claude-sonnet-5 added to the curated SUPPORTED_MODELS allowlist (a likely judge override). Fable 5 stays out — priced for warn-only consumers, not a budgeted-eval panel model. - model-pricing.test.ts: pin tests for both rows, matching the existing Opus 4.8/4.7 pattern. Drift guards iterate the table; no changes. All derived views (ANTHROPIC_PRICING bare view -> budget-tracker, batch-projection, budget-meter) pick the rows up automatically. Co-authored-by: Paolo Belcastro <p3ob7o@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Paolo Belcastro
Claude Fable 5
parent
a7b0ae80a9
commit
9f313db374
@@ -52,11 +52,18 @@ export interface ModelPricing {
|
||||
*/
|
||||
export const CANONICAL_PRICING: Record<string, ModelPricing> = {
|
||||
// ── Anthropic ──────────────────────────────────────────────────────────
|
||||
// Fable 5: Anthropic's top tier, above Opus. $10 in / $50 out.
|
||||
'anthropic:claude-fable-5': { input: 10.00, output: 50.00 },
|
||||
// Opus 4.x: $5 in / $25 out. 4.8 (released 2026-05-28) shares 4.7's
|
||||
// per-token rate — closes gbrain#1819.
|
||||
'anthropic:claude-opus-4-8': { input: 5.00, output: 25.00 },
|
||||
'anthropic:claude-opus-4-7': { input: 5.00, output: 25.00 },
|
||||
'anthropic:claude-opus-4-6': { input: 5.00, output: 25.00 },
|
||||
// Sonnet 5 (released 2026-06-29): same $3/$15 sticker as 4.6. The launch
|
||||
// intro discount ($2/$10 through 2026-08-31) is deliberately NOT modeled —
|
||||
// the table carries standard rates so estimates stay conservative and
|
||||
// don't need a time-bombed edit when the promo lapses.
|
||||
'anthropic:claude-sonnet-5': { input: 3.00, output: 15.00 },
|
||||
'anthropic:claude-sonnet-4-6': { input: 3.00, output: 15.00 },
|
||||
// Haiku 4.5 — both the dateless canonical id and the dated snapshot.
|
||||
'anthropic:claude-haiku-4-5': { input: 1.00, output: 5.00 },
|
||||
|
||||
@@ -37,6 +37,7 @@ const SUPPORTED_MODELS = [
|
||||
'openai:gpt-5.5',
|
||||
'anthropic:claude-opus-4-8',
|
||||
'anthropic:claude-opus-4-7',
|
||||
'anthropic:claude-sonnet-5',
|
||||
'anthropic:claude-sonnet-4-6',
|
||||
'anthropic:claude-haiku-4-5',
|
||||
'google:gemini-1.5-pro',
|
||||
|
||||
@@ -43,6 +43,14 @@ describe('CANONICAL_PRICING — table integrity', () => {
|
||||
expect(CANONICAL_PRICING['anthropic:claude-opus-4-7']).toEqual({ input: 5.0, output: 25.0 });
|
||||
});
|
||||
|
||||
test('Sonnet 5 present at $3/$15 (standard rate, intro discount not modeled)', () => {
|
||||
expect(CANONICAL_PRICING['anthropic:claude-sonnet-5']).toEqual({ input: 3.0, output: 15.0 });
|
||||
});
|
||||
|
||||
test('Fable 5 present at $10/$50', () => {
|
||||
expect(CANONICAL_PRICING['anthropic:claude-fable-5']).toEqual({ input: 10.0, output: 50.0 });
|
||||
});
|
||||
|
||||
test('Gemini 2.0 Flash reconciled to $0.10/$0.40; legacy alias agrees', () => {
|
||||
expect(CANONICAL_PRICING['google:gemini-2.0-flash']).toEqual({ input: 0.1, output: 0.4 });
|
||||
expect(CANONICAL_PRICING['google:gemini-2-flash']).toEqual(
|
||||
|
||||
Reference in New Issue
Block a user