fix(models): price Hermes lowercase glm-5.2 the same as GLM-5.2 (#545)

This commit is contained in:
ozymandiashh 2026-06-22 01:02:59 +02:00 committed by GitHub
parent 10d911d962
commit 4dcb7e6c3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -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> = {}

View file

@ -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', () => {