MCPcopy Create free account
hub / github.com/Noumena-Network/code / getModelFamilyInfo

Function getModelFamilyInfo

src/utils/model/modelOptions.ts:462–501  ·  view source on GitHub ↗

* Map a full model name to its family alias and the marketing name of the * version the alias currently resolves to. Used to detect when a user has * a specific older version pinned and a newer one is available.

(
  model: string,
)

Source from the content-addressed store, hash-verified

460 * a specific older version pinned and a newer one is available.
461 */
462function getModelFamilyInfo(
463 model: string,
464): { alias: string; currentVersionName: string } | null {
465 const canonical = getCanonicalName(model)
466
467 // Sonnet family
468 if (
469 canonical.includes('claude-sonnet-4-6') ||
470 canonical.includes('claude-sonnet-4-5') ||
471 canonical.includes('claude-sonnet-4-') ||
472 canonical.includes('claude-3-7-sonnet') ||
473 canonical.includes('claude-3-5-sonnet')
474 ) {
475 const currentName = getMarketingNameForModel(getDefaultFlashModel())
476 if (currentName) {
477 return { alias: 'Balanced', currentVersionName: currentName }
478 }
479 }
480
481 // Opus family
482 if (canonical.includes('claude-opus-4')) {
483 const currentName = getMarketingNameForModel(getDefaultOpusModel())
484 if (currentName) {
485 return { alias: 'Reasoning', currentVersionName: currentName }
486 }
487 }
488
489 // Haiku family
490 if (
491 canonical.includes('claude-haiku') ||
492 canonical.includes('claude-3-5-haiku')
493 ) {
494 const currentName = getMarketingNameForModel(getDefaultHaikuModel())
495 if (currentName) {
496 return { alias: 'Fast', currentVersionName: currentName }
497 }
498 }
499
500 return null
501}
502
503/**
504 * Returns a ModelOption for a known Anthropic model with a human-readable

Callers 1

getKnownModelOptionFunction · 0.85

Calls 5

getCanonicalNameFunction · 0.85
getMarketingNameForModelFunction · 0.85
getDefaultFlashModelFunction · 0.85
getDefaultOpusModelFunction · 0.85
getDefaultHaikuModelFunction · 0.85

Tested by

no test coverage detected