Skip to content

Commit 8c28629

Browse files
committed
fix(models): restore best-for with stricter criteria
Made-with: Cursor
1 parent 8d1e89b commit 8c28629

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

apps/sim/app/(landing)/models/[provider]/[model]/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ export default async function ModelPage({
200200

201201
<p className='max-w-[820px] text-[17px] text-[var(--landing-text-muted)] leading-relaxed'>
202202
{model.summary}
203+
{model.bestFor ? ` ${model.bestFor}` : ''}
203204
</p>
204205

205206
<div className='mt-8 flex flex-wrap gap-3'>
@@ -286,6 +287,7 @@ export default async function ModelPage({
286287
}
287288
/>
288289
<DetailItem label='Provider' value={provider.name} />
290+
{model.bestFor ? <DetailItem label='Best for' value={model.bestFor} /> : null}
289291
</div>
290292
</section>
291293

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,15 @@ describe('model catalog capability facts', () => {
3535
it.concurrent('does not invent a max output token limit when one is not published', () => {
3636
expect(getEffectiveMaxOutputTokens({})).toBeNull()
3737
})
38+
39+
it.concurrent('keeps best-for copy for clearly differentiated models only', () => {
40+
const researchModel = getModelBySlug('google', 'deep-research-pro-preview-12-2025')
41+
const generalModel = getModelBySlug('xai', 'grok-4-latest')
42+
43+
expect(researchModel).not.toBeNull()
44+
expect(generalModel).not.toBeNull()
45+
46+
expect(researchModel?.bestFor).toContain('research workflows')
47+
expect(generalModel?.bestFor).toBeUndefined()
48+
})
3849
})

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export interface CatalogModel {
112112
capabilities: ModelCapabilities
113113
capabilityTags: string[]
114114
summary: string
115+
bestFor?: string
115116
searchText: string
116117
}
117118

@@ -368,6 +369,36 @@ function buildCapabilityTags(capabilities: ModelCapabilities): string[] {
368369
return tags
369370
}
370371

372+
function buildBestForLine(model: {
373+
pricing: PricingInfo
374+
capabilities: ModelCapabilities
375+
contextWindow: number | null
376+
}): string | null {
377+
const { pricing, capabilities, contextWindow } = model
378+
379+
if (capabilities.deepResearch) {
380+
return 'Best for multi-step research workflows and agent-led web investigation.'
381+
}
382+
383+
if (capabilities.reasoningEffort || capabilities.thinking) {
384+
return 'Best for reasoning-heavy tasks that need more deliberate model control.'
385+
}
386+
387+
if (contextWindow && contextWindow >= 1000000) {
388+
return 'Best for long-context retrieval, large documents, and high-memory workflows.'
389+
}
390+
391+
if (capabilities.nativeStructuredOutputs) {
392+
return 'Best for production workflows that need reliable typed outputs.'
393+
}
394+
395+
if (pricing.input <= 0.2 && pricing.output <= 1.25) {
396+
return 'Best for cost-sensitive automations, background tasks, and high-volume workloads.'
397+
}
398+
399+
return null
400+
}
401+
371402
function buildModelSummary(
372403
providerName: string,
373404
displayName: string,
@@ -414,6 +445,11 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => {
414445
const shortId = stripProviderPrefix(provider.id, model.id)
415446
const mergedCapabilities = { ...provider.capabilities, ...model.capabilities }
416447
const capabilityTags = buildCapabilityTags(mergedCapabilities)
448+
const bestFor = buildBestForLine({
449+
pricing: model.pricing,
450+
capabilities: mergedCapabilities,
451+
contextWindow: model.contextWindow ?? null,
452+
})
417453
const displayName = formatModelDisplayName(provider.id, model.id)
418454
const modelSlug = slugify(shortId)
419455
const href = `/models/${providerSlug}/${modelSlug}`
@@ -438,6 +474,7 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => {
438474
model.contextWindow ?? null,
439475
capabilityTags
440476
),
477+
...(bestFor ? { bestFor } : {}),
441478
searchText: [
442479
provider.name,
443480
providerDisplayName,

0 commit comments

Comments
 (0)