| author | |
| committer | |
| log | 270e021f2a7ed34e3d81d1cdc9f1ca0c0ac85df4 |
| tree | 21967370e56fbf31767ac1c2ced76724bc9816cf |
| parent | 3e544f8cda371dc565c806508a9ab38b80c96ff7 |
| signature | Signed by PGP key B5690EEEBB952194 |
2 files changed, 0 insertions(+), 15 deletions(-)
apps/server/src/usage/usagePricing.test.ts-5| ... | ... | @@ -4,7 +4,6 @@ import { |
| 4 | 4 | cacheSavingsUsd, |
| 5 | 5 | createOverrideRateTable, |
| 6 | 6 | lookupRate, |
| 7 | normalizeModelName, | |
| 8 | 7 | parseRateTable, |
| 9 | 8 | priceUsage, |
| 10 | 9 | } from "./usagePricing.ts"; |
| ... | ... | @@ -83,10 +82,6 @@ describe("usage pricing", () => { |
| 83 | 82 | } |
| 84 | 83 | }); |
| 85 | 84 | |
| 86 | it("keeps the existing model-name normalization contract", () => { | |
| 87 | expect(normalizeModelName(" Anthropic/Claude-Opus-5 ")).toBe("claude-opus-5"); | |
| 88 | }); | |
| 89 | ||
| 90 | 85 | it("keeps the canonical Fable rate separate from DeepInfra in either order", () => { |
| 91 | 86 | const canonical = ["claude-fable-5", rate(1e-5, 1e-6)] as const; |
| 92 | 87 | const deepInfra = ["deepinfra/anthropic/claude-fable-5", rate(1e-5)] as const; |
apps/server/src/usage/usagePricing.ts-10| ... | ... | @@ -127,16 +127,6 @@ function normalizeRateKey(model: string): string { |
| 127 | 127 | return model.trim().toLowerCase(); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | /** | |
| 131 | * Canonicalises a model name for lookup. | |
| 132 | * | |
| 133 | * Strips a `provider/` prefix and lowercases, since transcripts are | |
| 134 | * inconsistent about casing. | |
| 135 | */ | |
| 136 | export function normalizeModelName(model: string): string { | |
| 137 | return bareModelName(normalizeRateKey(model)); | |
| 138 | } | |
| 139 | ||
| 140 | 130 | function bareModelName(key: string): string { |
| 141 | 131 | const slash = key.lastIndexOf("/"); |
| 142 | 132 | return slash === -1 ? key : key.slice(slash + 1); |