@@ -172,6 +172,8 @@ export interface CatalogProvider {
172172 providerCapabilityTags : string [ ]
173173 modelCount : number
174174 models : CatalogModel [ ]
175+ /** The models that still accept requests; every recommendation reads these, never `models`. */
176+ currentModels : CatalogModel [ ]
175177 featuredModels : CatalogModel [ ]
176178 searchText : string
177179}
@@ -438,8 +440,11 @@ function buildBestForLine(model: {
438440 pricing : PricingInfo
439441 capabilities : ModelCapabilities
440442 contextWindow : number | null
443+ retired : boolean
441444} ) : string | null {
442- const { pricing, capabilities, contextWindow } = model
445+ const { pricing, capabilities, contextWindow, retired } = model
446+
447+ if ( retired ) return null
443448
444449 if ( capabilities . reasoningEffort || capabilities . thinking ) {
445450 return 'Best for reasoning-heavy tasks that need more deliberate model control.'
@@ -512,6 +517,7 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => {
512517 pricing : model . pricing ,
513518 capabilities : mergedCapabilities ,
514519 contextWindow : model . contextWindow ?? null ,
520+ retired,
515521 } )
516522 const displayName = formatModelDisplayName ( provider . id , model . id )
517523 const modelSlug = slugify ( shortId )
@@ -563,7 +569,8 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => {
563569 models . find ( ( model ) => model . id === provider . defaultModel ) ?. displayName ||
564570 ( provider . defaultModel ? formatModelDisplayName ( provider . id , provider . defaultModel ) : 'Dynamic' )
565571
566- const featuredModels = [ ...models ] . sort ( compareModelsByRelevance ) . slice ( 0 , 6 )
572+ const currentModels = models . filter ( ( model ) => ! model . retired )
573+ const featuredModels = [ ...currentModels ] . sort ( compareModelsByRelevance ) . slice ( 0 , 6 )
567574 const naming = PROVIDER_MODEL_FAMILIES [ provider . id ]
568575 const modelFamily = naming ?. family ?? providerDisplayName
569576
@@ -588,6 +595,7 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => {
588595 providerCapabilityTags,
589596 modelCount : models . length ,
590597 models,
598+ currentModels,
591599 featuredModels,
592600 searchText : [
593601 provider . name ,
@@ -697,7 +705,7 @@ export function getRelatedModels(targetModel: CatalogModel, limit = 6): CatalogM
697705
698706 const targetTokens = new Set ( tokenizeModelName ( stripTechnicalSuffixes ( targetModel . shortId ) ) )
699707
700- const scored = provider . models . reduce < Array < { model : CatalogModel ; score : number } > > (
708+ const scored = provider . currentModels . reduce < Array < { model : CatalogModel ; score : number } > > (
701709 ( acc , model ) => {
702710 if ( model . id === targetModel . id ) {
703711 return acc
@@ -728,19 +736,19 @@ export function buildProviderFaqs(provider: CatalogProvider): CatalogFaq[] {
728736 const cheapestModel = getCheapestProviderModel ( provider )
729737 const largestContextModel = getLargestContextProviderModel ( provider )
730738
731- const toolUseModels = provider . models . filter (
739+ const toolUseModels = provider . currentModels . filter (
732740 ( m ) =>
733741 m . capabilities . toolUsageControl !== undefined ||
734742 provider . providerCapabilityTags . includes ( 'Tool Use' )
735743 )
744+ const namedModels = provider . currentModels . slice ( 0 , 6 )
736745
737746 const faqs : CatalogFaq [ ] = [
738747 {
739748 question : `What ${ provider . name } models are available in Sim?` ,
740- answer : `Sim currently tracks ${ provider . modelCount } ${ provider . name } model${ provider . modelCount === 1 ? '' : 's' } including ${ provider . models
741- . slice ( 0 , 6 )
749+ answer : `Sim currently tracks ${ provider . modelCount } ${ provider . name } model${ provider . modelCount === 1 ? '' : 's' } including ${ namedModels
742750 . map ( ( model ) => model . displayName )
743- . join ( ', ' ) } ${ provider . modelCount > 6 ? ', and more' : '' } .`,
751+ . join ( ', ' ) } ${ provider . modelCount > namedModels . length ? ', and more' : '' } .`,
744752 } ,
745753 {
746754 question : `What is the default ${ provider . name } model in Sim?` ,
@@ -770,7 +778,7 @@ export function buildProviderFaqs(provider: CatalogProvider): CatalogFaq[] {
770778 faqs . push ( {
771779 question : `Which ${ provider . name } models support tool use and function calling in Sim?` ,
772780 answer :
773- toolUseModels . length === provider . modelCount
781+ toolUseModels . length === provider . currentModels . length
774782 ? `All ${ provider . name } models in Sim support tool use and function calling, allowing agents to invoke external APIs, query databases, and run custom actions.`
775783 : `${ toolUseModels
776784 . slice ( 0 , 5 )
@@ -880,9 +888,10 @@ export function buildModelCapabilityFacts(model: CatalogModel): CapabilityFact[]
880888 ]
881889}
882890
891+ /** The provider's current model with the lowest input price. */
883892export function getCheapestProviderModel ( provider : CatalogProvider ) : CatalogModel | null {
884- if ( provider . models . length === 0 ) return null
885- return provider . models . reduce ( ( min , m ) => ( m . pricing . input < min . pricing . input ? m : min ) )
893+ if ( provider . currentModels . length === 0 ) return null
894+ return provider . currentModels . reduce ( ( min , m ) => ( m . pricing . input < min . pricing . input ? m : min ) )
886895}
887896
888897/**
@@ -899,12 +908,12 @@ export function compareByContextWindow(a: CatalogModel, b: CatalogModel): number
899908}
900909
901910/**
902- * The provider's largest-context model that is not retired . Ties go to the first model in catalog
911+ * The provider's largest-context current model . Ties go to the first model in catalog
903912 * order, so the answer names the provider's headline model rather than a smaller sibling with the
904913 * same window.
905914 */
906915export function getLargestContextProviderModel ( provider : CatalogProvider ) : CatalogModel | null {
907- const candidates = provider . models . filter ( ( model ) => ! model . retired && model . contextWindow )
916+ const candidates = provider . currentModels . filter ( ( model ) => model . contextWindow )
908917 if ( candidates . length === 0 ) return null
909918 return candidates . reduce ( ( max , model ) =>
910919 ( model . contextWindow ?? 0 ) > ( max . contextWindow ?? 0 ) ? model : max
0 commit comments