MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / getMarketingNameForModel

Function getMarketingNameForModel

src/utils/model/model.ts:592–636  ·  view source on GitHub ↗
(modelId: string)

Source from the content-addressed store, hash-verified

590
591// @[MODEL LAUNCH]: Add a marketing name mapping for the new model below.
592export function getMarketingNameForModel(modelId: string): string | undefined {
593 if (getAPIProvider() === 'foundry') {
594 // deployment ID is user-defined in Foundry, so it may have no relation to the actual model
595 return undefined
596 }
597
598 const has1m = modelId.toLowerCase().includes('[1m]')
599 const canonical = getCanonicalName(modelId)
600
601 if (canonical.includes('claude-opus-4-6')) {
602 return has1m ? 'Opus 4.6 (with 1M context)' : 'Opus 4.6'
603 }
604 if (canonical.includes('claude-opus-4-5')) {
605 return 'Opus 4.5'
606 }
607 if (canonical.includes('claude-opus-4-1')) {
608 return 'Opus 4.1'
609 }
610 if (canonical.includes('claude-opus-4')) {
611 return 'Opus 4'
612 }
613 if (canonical.includes('claude-sonnet-4-6')) {
614 return has1m ? 'Sonnet 4.6 (with 1M context)' : 'Sonnet 4.6'
615 }
616 if (canonical.includes('claude-sonnet-4-5')) {
617 return has1m ? 'Sonnet 4.5 (with 1M context)' : 'Sonnet 4.5'
618 }
619 if (canonical.includes('claude-sonnet-4')) {
620 return has1m ? 'Sonnet 4 (with 1M context)' : 'Sonnet 4'
621 }
622 if (canonical.includes('claude-3-7-sonnet')) {
623 return 'Claude 3.7 Sonnet'
624 }
625 if (canonical.includes('claude-3-5-sonnet')) {
626 return 'Claude 3.5 Sonnet'
627 }
628 if (canonical.includes('claude-haiku-4-5')) {
629 return 'Haiku 4.5'
630 }
631 if (canonical.includes('claude-3-5-haiku')) {
632 return 'Claude 3.5 Haiku'
633 }
634
635 return undefined
636}
637
638export function normalizeModelStringForAPI(model: string): string {
639 return model.replace(/\[(1|2)m\]/gi, '')

Callers 4

getModelFamilyInfoFunction · 0.85
getKnownModelOptionFunction · 0.85
computeEnvInfoFunction · 0.85
computeSimpleEnvInfoFunction · 0.85

Calls 2

getAPIProviderFunction · 0.85
getCanonicalNameFunction · 0.85

Tested by

no test coverage detected