File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -325,6 +325,10 @@ const BUILTIN_ALIASES: Record<string, string> = {
325325 // ZCode runs GLM-5.2 through z.ai's start-plan subscription; it isn't in
326326 // LiteLLM yet. Price as the nearest released sibling (GLM-5.1) until it is.
327327 'GLM-5.2' : 'glm-5p1' ,
328+ // Hermes Agent stores the same model id lowercased (`glm-5.2`) in its
329+ // sessions table, so it misses the capitalized alias above and goes
330+ // unpriced. Map the lowercase spelling to the same sibling.
331+ 'glm-5.2' : 'glm-5p1' ,
328332}
329333
330334let userAliases : Record < string , string > = { }
Original file line number Diff line number Diff line change @@ -32,6 +32,15 @@ describe('getModelCosts', () => {
3232 expect ( costs ) . not . toBeNull ( )
3333 expect ( costs ! . inputCostPerToken ) . toBe ( 5e-6 )
3434 } )
35+
36+ it ( 'prices lowercase glm-5.2 (Hermes spelling) the same as capitalized GLM-5.2' , ( ) => {
37+ const lower = getModelCosts ( 'glm-5.2' )
38+ const upper = getModelCosts ( 'GLM-5.2' )
39+ expect ( lower ) . not . toBeNull ( )
40+ expect ( upper ) . not . toBeNull ( )
41+ expect ( lower ! . inputCostPerToken ) . toBe ( upper ! . inputCostPerToken )
42+ expect ( lower ! . outputCostPerToken ) . toBe ( upper ! . outputCostPerToken )
43+ } )
3544} )
3645
3746describe ( 'getShortModelName' , ( ) => {
You can’t perform that action at this time.
0 commit comments