From fae7317b460ae83399e1879b2087d9ed83d4daab Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 10 Jul 2026 17:47:59 -0700 Subject: [PATCH] fix(models): restore Anthropic models in landing page compare chart --- .../components/model-comparison-charts.tsx | 39 ++++++++++--------- apps/sim/app/(landing)/models/utils.ts | 2 + 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/apps/sim/app/(landing)/models/components/model-comparison-charts.tsx b/apps/sim/app/(landing)/models/components/model-comparison-charts.tsx index 36ba0f43178..3d4f3111728 100644 --- a/apps/sim/app/(landing)/models/components/model-comparison-charts.tsx +++ b/apps/sim/app/(landing)/models/components/model-comparison-charts.tsx @@ -8,10 +8,11 @@ import { MODEL_CATALOG_PROVIDERS, } from '@/app/(landing)/models/utils' -/** Providers that host other providers' models - deprioritized to avoid duplicates. */ -const RESELLER_PROVIDERS = new Set( - MODEL_CATALOG_PROVIDERS.flatMap((p) => (p.isReseller ? [p.id] : [])) -) +/** Flagship providers featured in the landing-page comparison, in display order. */ +const FEATURED_COMPARISON_PROVIDER_IDS = ['anthropic', 'openai', 'google'] + +/** Max latest models pulled from each featured provider. */ +const MAX_MODELS_PER_PROVIDER = 4 const PROVIDER_ICON_MAP: Record> = (() => { const map: Record> = {} @@ -27,22 +28,22 @@ function selectComparisonModels(models: CatalogModel[]): CatalogModel[] { const seen = new Set() const result: CatalogModel[] = [] - const sorted = [...models].sort((a, b) => { - const score = (m: CatalogModel) => { - const reseller = RESELLER_PROVIDERS.has(m.providerId) ? -50 : 0 - const reasoning = m.capabilities.reasoningEffort || m.capabilities.thinking ? 10 : 0 - const context = (m.contextWindow ?? 0) / 100000 - return reseller + reasoning + context + for (const providerId of FEATURED_COMPARISON_PROVIDER_IDS) { + const providerModels = models + .filter((model) => model.providerId === providerId && !model.deprecated) + .sort((a, b) => (b.releaseDate ?? '').localeCompare(a.releaseDate ?? '')) + + let takenForProvider = 0 + for (const model of providerModels) { + if (takenForProvider >= MAX_MODELS_PER_PROVIDER) break + + const nameKey = model.displayName.toLowerCase() + if (seen.has(nameKey)) continue + + seen.add(nameKey) + result.push(model) + takenForProvider += 1 } - return score(b) - score(a) - }) - - for (const model of sorted) { - if (result.length >= 10) break - const nameKey = model.displayName.toLowerCase() - if (seen.has(nameKey)) continue - seen.add(nameKey) - result.push(model) } return result diff --git a/apps/sim/app/(landing)/models/utils.ts b/apps/sim/app/(landing)/models/utils.ts index e35e9a67d95..6f54de56b6c 100644 --- a/apps/sim/app/(landing)/models/utils.ts +++ b/apps/sim/app/(landing)/models/utils.ts @@ -122,6 +122,7 @@ export interface CatalogModel { providerSlug: string contextWindow: number | null releaseDate: string | null + deprecated: boolean pricing: PricingInfo capabilities: ModelCapabilities capabilityTags: string[] @@ -482,6 +483,7 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => { providerSlug, contextWindow: model.contextWindow ?? null, releaseDate: model.releaseDate ?? null, + deprecated: model.deprecated ?? false, pricing: model.pricing, capabilities: mergedCapabilities, capabilityTags,