(modelId: string, modelName: string)
| 311 | } |
| 312 | |
| 313 | function inferFamily(modelId: string, modelName: string): string | undefined { |
| 314 | const kimiFamily = inferKimiFamily(modelId, modelName); |
| 315 | if (kimiFamily !== undefined) return kimiFamily; |
| 316 | |
| 317 | const sorted = [...ModelFamilyValues].sort((a, b) => b.length - a.length); |
| 318 | const targets = [modelId.toLowerCase(), modelName.toLowerCase()]; |
| 319 | for (const family of sorted) { |
| 320 | const f = family.toLowerCase(); |
| 321 | for (const t of targets) { |
| 322 | if (t.includes(f)) return family; |
| 323 | } |
| 324 | } |
| 325 | return undefined; |
| 326 | } |
| 327 | |
| 328 | function getExistingLongContextCost(existing: ExistingModel | null) { |
| 329 | const tier = existing?.cost?.tiers?.find( |
no test coverage detected