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
4 changes: 4 additions & 0 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ const BUILTIN_ALIASES: Record<string, string> = {
// ZCode runs GLM-5.2 through z.ai's start-plan subscription; it isn't in
// LiteLLM yet. Price as the nearest released sibling (GLM-5.1) until it is.
'GLM-5.2': 'glm-5p1',
// Hermes Agent stores the same model id lowercased (`glm-5.2`) in its
// sessions table, so it misses the capitalized alias above and goes
// unpriced. Map the lowercase spelling to the same sibling.
'glm-5.2': 'glm-5p1',
}

let userAliases: Record<string, string> = {}
Expand Down
9 changes: 9 additions & 0 deletions tests/models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ describe('getModelCosts', () => {
expect(costs).not.toBeNull()
expect(costs!.inputCostPerToken).toBe(5e-6)
})

it('prices lowercase glm-5.2 (Hermes spelling) the same as capitalized GLM-5.2', () => {
const lower = getModelCosts('glm-5.2')
const upper = getModelCosts('GLM-5.2')
expect(lower).not.toBeNull()
expect(upper).not.toBeNull()
expect(lower!.inputCostPerToken).toBe(upper!.inputCostPerToken)
expect(lower!.outputCostPerToken).toBe(upper!.outputCostPerToken)
})
})

describe('getShortModelName', () => {
Expand Down
Loading