Skip to content

Commit da2371a

Browse files
authored
fix(models): restore Anthropic models in landing page compare chart (#5584)
1 parent 8525ba5 commit da2371a

2 files changed

Lines changed: 22 additions & 19 deletions

File tree

apps/sim/app/(landing)/models/components/model-comparison-charts.tsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import {
88
MODEL_CATALOG_PROVIDERS,
99
} from '@/app/(landing)/models/utils'
1010

11-
/** Providers that host other providers' models - deprioritized to avoid duplicates. */
12-
const RESELLER_PROVIDERS = new Set(
13-
MODEL_CATALOG_PROVIDERS.flatMap((p) => (p.isReseller ? [p.id] : []))
14-
)
11+
/** Flagship providers featured in the landing-page comparison, in display order. */
12+
const FEATURED_COMPARISON_PROVIDER_IDS = ['anthropic', 'openai', 'google']
13+
14+
/** Max latest models pulled from each featured provider. */
15+
const MAX_MODELS_PER_PROVIDER = 4
1516

1617
const PROVIDER_ICON_MAP: Record<string, ComponentType<{ className?: string }>> = (() => {
1718
const map: Record<string, ComponentType<{ className?: string }>> = {}
@@ -27,22 +28,22 @@ function selectComparisonModels(models: CatalogModel[]): CatalogModel[] {
2728
const seen = new Set<string>()
2829
const result: CatalogModel[] = []
2930

30-
const sorted = [...models].sort((a, b) => {
31-
const score = (m: CatalogModel) => {
32-
const reseller = RESELLER_PROVIDERS.has(m.providerId) ? -50 : 0
33-
const reasoning = m.capabilities.reasoningEffort || m.capabilities.thinking ? 10 : 0
34-
const context = (m.contextWindow ?? 0) / 100000
35-
return reseller + reasoning + context
31+
for (const providerId of FEATURED_COMPARISON_PROVIDER_IDS) {
32+
const providerModels = models
33+
.filter((model) => model.providerId === providerId && !model.deprecated)
34+
.sort((a, b) => (b.releaseDate ?? '').localeCompare(a.releaseDate ?? ''))
35+
36+
let takenForProvider = 0
37+
for (const model of providerModels) {
38+
if (takenForProvider >= MAX_MODELS_PER_PROVIDER) break
39+
40+
const nameKey = model.displayName.toLowerCase()
41+
if (seen.has(nameKey)) continue
42+
43+
seen.add(nameKey)
44+
result.push(model)
45+
takenForProvider += 1
3646
}
37-
return score(b) - score(a)
38-
})
39-
40-
for (const model of sorted) {
41-
if (result.length >= 10) break
42-
const nameKey = model.displayName.toLowerCase()
43-
if (seen.has(nameKey)) continue
44-
seen.add(nameKey)
45-
result.push(model)
4647
}
4748

4849
return result

apps/sim/app/(landing)/models/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export interface CatalogModel {
122122
providerSlug: string
123123
contextWindow: number | null
124124
releaseDate: string | null
125+
deprecated: boolean
125126
pricing: PricingInfo
126127
capabilities: ModelCapabilities
127128
capabilityTags: string[]
@@ -482,6 +483,7 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => {
482483
providerSlug,
483484
contextWindow: model.contextWindow ?? null,
484485
releaseDate: model.releaseDate ?? null,
486+
deprecated: model.deprecated ?? false,
485487
pricing: model.pricing,
486488
capabilities: mergedCapabilities,
487489
capabilityTags,

0 commit comments

Comments
 (0)