Skip to content

Commit 97248a9

Browse files
refactor(server): remove test-only pricing normalizer
1 parent ea0487c commit 97248a9

2 files changed

Lines changed: 0 additions & 15 deletions

File tree

‎apps/server/src/usage/usagePricing.test.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
cacheSavingsUsd,
55
createOverrideRateTable,
66
lookupRate,
7-
normalizeModelName,
87
parseRateTable,
98
priceUsage,
109
} from "./usagePricing.ts";
@@ -83,10 +82,6 @@ describe("usage pricing", () => {
8382
}
8483
});
8584

86-
it("keeps the existing model-name normalization contract", () => {
87-
expect(normalizeModelName(" Anthropic/Claude-Opus-5 ")).toBe("claude-opus-5");
88-
});
89-
9085
it("keeps the canonical Fable rate separate from DeepInfra in either order", () => {
9186
const canonical = ["claude-fable-5", rate(1e-5, 1e-6)] as const;
9287
const deepInfra = ["deepinfra/anthropic/claude-fable-5", rate(1e-5)] as const;

‎apps/server/src/usage/usagePricing.ts‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,6 @@ function normalizeRateKey(model: string): string {
127127
return model.trim().toLowerCase();
128128
}
129129

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-
140130
function bareModelName(key: string): string {
141131
const slash = key.lastIndexOf("/");
142132
return slash === -1 ? key : key.slice(slash + 1);

0 commit comments

Comments
 (0)