Skip to content

Commit 60802ea

Browse files
committed
chore(access-control): reuse canonical DYNAMIC_MODEL_PROVIDERS from providers/models
1 parent c29d4da commit 60802ea

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

apps/sim/ee/access-control/components/access-control.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ import {
4545
import { useBlacklistedProviders } from '@/hooks/queries/allowed-providers'
4646
import { useProviderModels } from '@/hooks/queries/providers'
4747
import { useWorkspacePermissionsQuery } from '@/hooks/queries/workspace'
48-
import { PROVIDER_DEFINITIONS } from '@/providers/models'
48+
import {
49+
DYNAMIC_MODEL_PROVIDERS,
50+
getProviderModels,
51+
PROVIDER_DEFINITIONS,
52+
} from '@/providers/models'
4953
import type { ProviderId } from '@/providers/types'
50-
import { getAllProviderIds, getProviderFromModel, getProviderModels } from '@/providers/utils'
54+
import { getAllProviderIds, getProviderFromModel } from '@/providers/utils'
5155
import type { ProviderName } from '@/stores/providers'
5256

5357
const logger = createLogger('AccessControl')
@@ -256,15 +260,6 @@ function AccessControlSkeleton() {
256260
)
257261
}
258262

259-
/** Providers whose models are fetched at runtime (on row expand) rather than from {@link PROVIDER_DEFINITIONS}. */
260-
const DYNAMIC_MODEL_PROVIDERS = new Set<ProviderName>([
261-
'ollama',
262-
'vllm',
263-
'litellm',
264-
'openrouter',
265-
'fireworks',
266-
])
267-
268263
interface ModelDenylistControls {
269264
isModelAllowed: (model: string) => boolean
270265
onToggleModel: (model: string) => void
@@ -391,7 +386,7 @@ function ProviderRow({
391386
const providerName =
392387
PROVIDER_DEFINITIONS[providerId]?.name ||
393388
providerId.replace(/-/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase())
394-
const isDynamic = DYNAMIC_MODEL_PROVIDERS.has(providerId as ProviderName)
389+
const isDynamic = (DYNAMIC_MODEL_PROVIDERS as readonly string[]).includes(providerId)
395390
const checkboxId = `provider-${providerId}`
396391

397392
return (

0 commit comments

Comments
 (0)