Skip to content

Commit f9fc9c3

Browse files
feat(models): sunset tiers for models mirroring blocks — legacy amber / deprecated red
1 parent 7b8bbeb commit f9fc9c3

7 files changed

Lines changed: 103 additions & 100 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ const rawProviders = Object.values(PROVIDER_DEFINITIONS).map((provider) => {
483483
providerSlug,
484484
contextWindow: model.contextWindow ?? null,
485485
releaseDate: model.releaseDate ?? null,
486-
deprecated: model.deprecated ?? false,
486+
deprecated: !!model.sunset,
487487
pricing: model.pricing,
488488
capabilities: mergedCapabilities,
489489
capabilityTags,

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/workflow-block.tsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import { useTablesList } from '@/hooks/queries/tables'
6666
import { useWorkflowMap } from '@/hooks/queries/workflows'
6767
import { useReactiveConditions } from '@/hooks/use-reactive-conditions'
6868
import { useSelectorDisplayName } from '@/hooks/use-selector-display-name'
69-
import { isModelDeprecated } from '@/providers/models'
69+
import { getModelSunsetStatus } from '@/providers/models'
7070
import { useVariablesStore } from '@/stores/variables/store'
7171
import { useSubBlockStore } from '@/stores/workflows/subblock/store'
7272
import { useWorkflowStore } from '@/stores/workflows/workflow/store'
@@ -132,12 +132,23 @@ function getBlockSunset(
132132
}
133133
}
134134

135-
if (typeof model === 'string' && isModelDeprecated(model)) {
136-
return {
137-
status: 'legacy',
138-
kind: 'model',
139-
tooltip: `${model} is deprecated. Click to upgrade`,
140-
prompt: `The "${name}" block uses the deprecated model "${model}". Switch it to the latest equivalent model.`,
135+
if (typeof model === 'string') {
136+
const modelStatus = getModelSunsetStatus(model)
137+
if (modelStatus === 'deprecated') {
138+
return {
139+
status: 'deprecated',
140+
kind: 'model',
141+
tooltip: `${model} is no longer available. Click to switch models`,
142+
prompt: `The "${name}" block uses "${model}", which the provider has retired — calls to it now fail. Switch it to the latest equivalent model.`,
143+
}
144+
}
145+
if (modelStatus === 'legacy') {
146+
return {
147+
status: 'legacy',
148+
kind: 'model',
149+
tooltip: `${model} is deprecated. Click to upgrade`,
150+
prompt: `The "${name}" block uses the deprecated model "${model}". Switch it to the latest equivalent model.`,
151+
}
141152
}
142153
}
143154

apps/sim/blocks/utils.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type { BlockOutput, OutputFieldDefinition, SubBlockConfig } from '@/block
1111
import {
1212
getBaseModelProviders,
1313
getHostedModels,
14+
getModelSunsetStatus,
1415
getProviderIcon,
1516
getProviderModels,
1617
orderModelIdsByReleaseDate,
@@ -74,10 +75,12 @@ export function getModelOptions() {
7475
])
7576
)
7677

77-
return allModels.map((model) => {
78-
const icon = getProviderIcon(model)
79-
return { label: model, id: model, ...(icon && { icon }) }
80-
})
78+
return allModels
79+
.filter((model) => getModelSunsetStatus(model) !== 'deprecated')
80+
.map((model) => {
81+
const icon = getProviderIcon(model)
82+
return { label: model, id: model, ...(icon && { icon }) }
83+
})
8184
}
8285

8386
/**

apps/sim/lib/copilot/vfs/serializers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ function getStaticModelOptionsForVFS(): StaticModelOption[] {
460460
}
461461
if (model.recommended) option.recommended = true
462462
if (model.speedOptimized) option.speedOptimized = true
463-
if (model.deprecated) option.deprecated = true
463+
if (model.sunset) option.deprecated = true
464464
models.push(option)
465465
}
466466
}

apps/sim/providers/bedrock/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export function generateToolUseId(toolName: string): string {
8989
*/
9090
const GEO_PROFILE_UNSUPPORTED_MODEL_IDS = new Set([
9191
'mistral.mistral-large-3-675b-instruct',
92-
'mistral.mistral-large-2411-v1:0',
9392
'mistral.mistral-large-2407-v1:0',
9493
'mistral.magistral-small-2509',
9594
'mistral.ministral-3-14b-instruct',

apps/sim/providers/models.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const DYNAMIC_PROVIDERS = new Set([
2424
function firstDeprecatedModelId(): string | undefined {
2525
for (const [providerId, provider] of Object.entries(PROVIDER_DEFINITIONS)) {
2626
if (DYNAMIC_PROVIDERS.has(providerId)) continue
27-
const dep = provider.models.find((m) => m.deprecated)
27+
const dep = provider.models.find((m) => m.sunset)
2828
if (dep) return dep.id
2929
}
3030
return undefined

0 commit comments

Comments
 (0)