Skip to content
TypeScript

refactor(server): remove test-only pricing normalizer (#10017)

Julius Marminge270e021f2a7e
diff --git a/apps/server/src/usage/usagePricing.test.ts b/apps/server/src/usage/usagePricing.test.ts
index d45dfe2dd09..713d860999c 100644
--- a/apps/server/src/usage/usagePricing.test.ts
+++ b/apps/server/src/usage/usagePricing.test.ts
@@ -4,7 +4,6 @@ import {
cacheSavingsUsd,
createOverrideRateTable,
lookupRate,
- normalizeModelName,
parseRateTable,
priceUsage,
} from "./usagePricing.ts";
@@ -83,10 +82,6 @@ describe("usage pricing", () => {
}
});
- it("keeps the existing model-name normalization contract", () => {
- expect(normalizeModelName(" Anthropic/Claude-Opus-5 ")).toBe("claude-opus-5");
- });
-
it("keeps the canonical Fable rate separate from DeepInfra in either order", () => {
const canonical = ["claude-fable-5", rate(1e-5, 1e-6)] as const;
const deepInfra = ["deepinfra/anthropic/claude-fable-5", rate(1e-5)] as const;
diff --git a/apps/server/src/usage/usagePricing.ts b/apps/server/src/usage/usagePricing.ts
index 5ca75a68cb3..6c94be42482 100644
--- a/apps/server/src/usage/usagePricing.ts
+++ b/apps/server/src/usage/usagePricing.ts
@@ -127,16 +127,6 @@ function normalizeRateKey(model: string): string {
return model.trim().toLowerCase();
}
-/**
- * Canonicalises a model name for lookup.
- *
- * Strips a `provider/` prefix and lowercases, since transcripts are
- * inconsistent about casing.
- */
-export function normalizeModelName(model: string): string {
- return bareModelName(normalizeRateKey(model));
-}
-
function bareModelName(key: string): string {
const slash = key.lastIndexOf("/");
return slash === -1 ? key : key.slice(slash + 1);