diff --git a/README.md b/README.md index 390f646094b..c570f2172c1 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ npx sim-setup reset # archive .env and wipe managed data The setup package detects how you're running and acts accordingly. Use `--dir ` to create or manage a deployment somewhere other than `./sim`. -Sim also supports local models via [Ollama](https://ollama.ai) and [vLLM](https://docs.vllm.ai/). See the [self-hosting docs](https://docs.sim.ai/self-hosting/docker) for details. +Sim also supports local models via [Ollama](https://ollama.ai), [vLLM](https://docs.vllm.ai/), and [LiteLLM](https://docs.litellm.ai/). See the [self-hosting docs](https://docs.sim.ai/self-hosting/docker) for details. ## Chat API Keys diff --git a/apps/docs/content/docs/workflows/blocks/agent.mdx b/apps/docs/content/docs/workflows/blocks/agent.mdx index 751799feead..fd5cc0c4e3b 100644 --- a/apps/docs/content/docs/workflows/blocks/agent.mdx +++ b/apps/docs/content/docs/workflows/blocks/agent.mdx @@ -32,7 +32,7 @@ Answer in two sentences, cite the doc you used, and never guess a price. ### Model -The model that runs the step. Defaults to `claude-sonnet-5-5`. Type or pick any model from OpenAI, Anthropic, Google, xAI, Groq, Cerebras, DeepSeek, Azure, AWS Bedrock, Google Vertex, or OpenRouter, or a local model through Ollama or vLLM. +The model that runs the step. Defaults to `claude-sonnet-5-5`. Type or pick any model from OpenAI, Anthropic, Google, xAI, Groq, Cerebras, DeepSeek, Azure, AWS Bedrock, Google Vertex, or OpenRouter, or a local or self-hosted model through Ollama, vLLM, or LiteLLM. For a custom cloud deployment, enter its provider prefix and model ID: `azure/my-deployment`, `azure-anthropic/my-deployment`, `bedrock/my-inference-profile`, or `vertex/my-gemini-model`. The prefix selects the provider and shows its credential fields even when the ID is absent from the catalog. Bedrock accepts full inference profile ARNs after `bedrock/`; Vertex uses the Gemini API and accepts Google model resource names. The deployment must support the selected provider's API. Custom IDs have no catalog pricing or token limits. diff --git a/apps/docs/content/docs/workflows/blocks/router.mdx b/apps/docs/content/docs/workflows/blocks/router.mdx index f2a04ac3491..15570614a3b 100644 --- a/apps/docs/content/docs/workflows/blocks/router.mdx +++ b/apps/docs/content/docs/workflows/blocks/router.mdx @@ -22,7 +22,7 @@ Pass `` as Context, describe Sales, Support, and Billing routes, an | --- | --- | | **Context** | Text to analyze, often `` or ``. | | **Routes** | Each route has a title and a description of when to choose it. It adds a separate output port. | -| **Model** | Defaults to `claude-sonnet-5-5`. Select a supported model, including a compatible local Ollama or vLLM model. | +| **Model** | Defaults to `claude-sonnet-5-5`. Select a supported model, including a compatible local Ollama, vLLM, or LiteLLM model. | Make descriptions specific and distinguishable. For example, “Payments, invoices, and refunds” separates Billing from general product support. Test the routes on representative requests rather than assuming a larger model always routes more accurately. diff --git a/apps/sim/app/(auth)/components/social-login-buttons.tsx b/apps/sim/app/(auth)/components/social-login-buttons.tsx index fa7cffde1bf..ea138482548 100644 --- a/apps/sim/app/(auth)/components/social-login-buttons.tsx +++ b/apps/sim/app/(auth)/components/social-login-buttons.tsx @@ -23,7 +23,7 @@ interface SocialLoginButtonsProps { microsoftAvailable: boolean view: 'login' | 'signup' callbackURL?: string - ssoEnabled?: boolean + ssoEnabled: boolean disabled?: boolean } diff --git a/apps/sim/app/(auth)/components/sso-login-button.tsx b/apps/sim/app/(auth)/components/sso-login-button.tsx index bf0e710ef0a..4e993d8980e 100644 --- a/apps/sim/app/(auth)/components/sso-login-button.tsx +++ b/apps/sim/app/(auth)/components/sso-login-button.tsx @@ -1,7 +1,6 @@ 'use client' import { AuthIcon, AuthButton as Chip } from '@sim/auth-ui' import { useRouter } from 'next/navigation' -import { isSsoEnabled } from '@/lib/core/config/env-flags' interface SSOLoginButtonProps { disabled?: boolean @@ -18,10 +17,6 @@ export function SSOLoginButton({ }: SSOLoginButtonProps) { const router = useRouter() - if (!isSsoEnabled) { - return null - } - const handleSSOClick = () => { const ssoUrl = `/sso${callbackURL ? `?callbackUrl=${encodeURIComponent(callbackURL)}` : ''}` router.push(ssoUrl) diff --git a/apps/sim/app/(auth)/login/login-form.tsx b/apps/sim/app/(auth)/login/login-form.tsx index 046e2830c73..5ac641a1ca1 100644 --- a/apps/sim/app/(auth)/login/login-form.tsx +++ b/apps/sim/app/(auth)/login/login-form.tsx @@ -9,7 +9,6 @@ import { useRouter, useSearchParams } from 'next/navigation' import { requestJson } from '@/lib/api/client/request' import { forgetPasswordContract } from '@/lib/api/contracts' import { client } from '@/lib/auth/client' -import { isSsoEnabled } from '@/lib/core/config/env-flags' import { validateCallbackUrl } from '@/lib/core/security/input-validation' import { getBaseUrl } from '@/lib/core/utils/urls' import { quickValidateEmail } from '@/lib/messaging/email/validation' @@ -79,12 +78,15 @@ export default function LoginPage({ googleAvailable, microsoftAvailable, emailPasswordEnabled, + ssoEnabled, }: { githubAvailable: boolean googleAvailable: boolean microsoftAvailable: boolean /** Whether `REGISTRATION_MODE` leaves email/password and email OTP sign-in on. */ emailPasswordEnabled: boolean + /** Whether SAML/OIDC single sign-on is enabled for this deployment. */ + ssoEnabled: boolean }) { const router = useRouter() const searchParams = useSearchParams() @@ -347,7 +349,6 @@ export default function LoginPage({ } } - const ssoEnabled = isSsoEnabled const hasSocial = githubAvailable || googleAvailable || microsoftAvailable const hasOnlySSO = ssoEnabled && !emailPasswordEnabled && !hasSocial const showTopSSO = hasOnlySSO diff --git a/apps/sim/app/(auth)/login/page.tsx b/apps/sim/app/(auth)/login/page.tsx index e5687891917..a53e1fb96b8 100644 --- a/apps/sim/app/(auth)/login/page.tsx +++ b/apps/sim/app/(auth)/login/page.tsx @@ -1,6 +1,6 @@ import { Suspense } from 'react' import type { Metadata } from 'next' -import { isEmailPasswordAuthEnabled } from '@/lib/core/config/env-flags' +import { isEmailPasswordAuthEnabled, isSsoEnabled } from '@/lib/core/config/env-flags' import { getOAuthProviderStatus } from '@/app/(auth)/components/oauth-provider-checker' import LoginLoading from '@/app/(auth)/login/loading' import LoginForm from '@/app/(auth)/login/login-form' @@ -21,6 +21,7 @@ export default async function LoginPage() { googleAvailable={googleAvailable} microsoftAvailable={microsoftAvailable} emailPasswordEnabled={isEmailPasswordAuthEnabled} + ssoEnabled={isSsoEnabled} /> ) diff --git a/apps/sim/app/(auth)/signup/page.tsx b/apps/sim/app/(auth)/signup/page.tsx index aed7c5093b1..2770c8fde10 100644 --- a/apps/sim/app/(auth)/signup/page.tsx +++ b/apps/sim/app/(auth)/signup/page.tsx @@ -1,6 +1,10 @@ import type { Metadata } from 'next' import type { SearchParams } from 'nuqs/server' -import { isEmailSignupAllowed, isSelfServeRegistrationClosed } from '@/lib/core/config/env-flags' +import { + isEmailSignupAllowed, + isSelfServeRegistrationClosed, + isSsoEnabled, +} from '@/lib/core/config/env-flags' import { validateCallbackUrl } from '@/lib/core/security/input-validation' import { isEmailVerificationEffectivelyEnabled } from '@/lib/messaging/email/verification' import { resolveAuthRedirect } from '@/app/(auth)/auth-redirect' @@ -45,6 +49,7 @@ export default async function SignupPage({ microsoftAvailable={microsoftAvailable} emailSignupEnabled={isEmailSignupAllowed} emailVerificationEnabled={isEmailVerificationEffectivelyEnabled()} + ssoEnabled={isSsoEnabled} /> ) } diff --git a/apps/sim/app/(auth)/signup/signup-form.tsx b/apps/sim/app/(auth)/signup/signup-form.tsx index 25cd401aa83..d9c91d4b207 100644 --- a/apps/sim/app/(auth)/signup/signup-form.tsx +++ b/apps/sim/app/(auth)/signup/signup-form.tsx @@ -10,7 +10,6 @@ import { client, useSession } from '@/lib/auth/client' import { DISPOSABLE_EMAIL_ERROR_CODE, DISPOSABLE_EMAIL_MESSAGE } from '@/lib/auth/constants' import { useTrackingConsent } from '@/lib/consent/tracking-consent' import { getEnv } from '@/lib/core/config/env' -import { isSsoEnabled } from '@/lib/core/config/env-flags' import { validateCallbackUrl } from '@/lib/core/security/input-validation' import { quickValidateEmail } from '@/lib/messaging/email/validation' import { captureEvent } from '@/lib/posthog/client' @@ -99,6 +98,8 @@ interface SignupFormProps { emailSignupEnabled: boolean /** Server-derived: verification is enabled AND a mail provider is configured. */ emailVerificationEnabled: boolean + /** Whether SAML/OIDC single sign-on is enabled for this deployment. */ + ssoEnabled: boolean } function SignupFormContent({ @@ -107,6 +108,7 @@ function SignupFormContent({ microsoftAvailable, emailSignupEnabled, emailVerificationEnabled, + ssoEnabled, }: SignupFormProps) { const router = useRouter() const searchParams = useSearchParams() @@ -387,7 +389,6 @@ function SignupFormContent({ } } - const ssoEnabled = isSsoEnabled const hasSocial = githubAvailable || googleAvailable || microsoftAvailable const hasOnlySSO = ssoEnabled && !emailSignupEnabled && !hasSocial const showBottomSection = hasSocial || (ssoEnabled && !hasOnlySSO) @@ -516,6 +517,7 @@ export default function SignupPage({ microsoftAvailable, emailSignupEnabled, emailVerificationEnabled, + ssoEnabled, }: SignupFormProps) { return ( }> @@ -525,6 +527,7 @@ export default function SignupPage({ microsoftAvailable={microsoftAvailable} emailSignupEnabled={emailSignupEnabled} emailVerificationEnabled={emailVerificationEnabled} + ssoEnabled={ssoEnabled} /> ) diff --git a/apps/sim/app/_styles/globals.css b/apps/sim/app/_styles/globals.css index 78b947eac66..ae00386a2e5 100644 --- a/apps/sim/app/_styles/globals.css +++ b/apps/sim/app/_styles/globals.css @@ -431,7 +431,6 @@ --auth-primary-btn-text: #000000; --auth-primary-btn-hover-bg: #e0e0e0; --auth-primary-btn-hover-border: #e0e0e0; - --auth-primary-btn-hover-text: #000000; /* z-index scale. The toast/notification stack is ambient: it sits above page content but BELOW the modal and the transient poppers (menus, selects, diff --git a/apps/sim/app/manifest.ts b/apps/sim/app/manifest.ts index 1a0b3f0e160..9cada5117d0 100644 --- a/apps/sim/app/manifest.ts +++ b/apps/sim/app/manifest.ts @@ -2,8 +2,6 @@ import { INTEGRATION_COUNT_LABEL } from '@sim/deployment-config/integration-clai import type { MetadataRoute } from 'next' import { WORKSPACES_PATH } from '@/lib/navigation/paths' -export const dynamic = 'force-dynamic' - export default function manifest(): MetadataRoute.Manifest { return { name: 'Sim — The AI Workspace | Build, Deploy & Manage AI Agents', diff --git a/apps/sim/app/workspace/[workspaceId]/prefetch.ts b/apps/sim/app/workspace/[workspaceId]/prefetch.ts index d69738630c8..751f55dfb40 100644 --- a/apps/sim/app/workspace/[workspaceId]/prefetch.ts +++ b/apps/sim/app/workspace/[workspaceId]/prefetch.ts @@ -27,8 +27,8 @@ import { } from '@/hooks/queries/workspace-host' /** - * Resolves and caches the route-derived host context before any workspace UI or - * host branding renders. A `null` result is an explicit access denial. + * Resolves and caches the route-derived host context before any workspace UI + * renders. A `null` result is an explicit access denial. */ export function prefetchWorkspaceHostContext( queryClient: QueryClient, diff --git a/apps/sim/lib/billing/core/organization-activity-rollup.integration.ts b/apps/sim/lib/billing/core/organization-activity-rollup.integration.ts index 31365a977fb..bda54c99bb8 100644 --- a/apps/sim/lib/billing/core/organization-activity-rollup.integration.ts +++ b/apps/sim/lib/billing/core/organization-activity-rollup.integration.ts @@ -27,7 +27,11 @@ vi.mock('@sim/db', () => { runOutsideTransactionContext: (work: () => T) => work(), } }) -vi.mock('@/lib/core/config/redis', () => ({ getRedisClient: () => null })) +vi.mock('@/lib/core/config/redis', () => ({ + getRedisClient: () => { + throw new Error('Redis is not used by this suite; the usage cache reads the ledger') + }, +})) /** * The legacy oracle is the uncached SQL (a cached settled day would hide the changes the * failure-mode cases make), so every segment misses and the window is read in one range, exactly diff --git a/apps/sim/lib/billing/core/organization-activity.integration.ts b/apps/sim/lib/billing/core/organization-activity.integration.ts index 5104e9e2604..6cf512780dd 100644 --- a/apps/sim/lib/billing/core/organization-activity.integration.ts +++ b/apps/sim/lib/billing/core/organization-activity.integration.ts @@ -8,7 +8,11 @@ const { execute, select } = vi.hoisted(() => ({ execute: vi.fn(), select: vi.fn( const databaseUrl = readTestDatabaseUrl() vi.mock('@sim/db', () => ({ dbReplica: { execute, select } })) -vi.mock('@/lib/core/config/redis', () => ({ getRedisClient: () => null })) +vi.mock('@/lib/core/config/redis', () => ({ + getRedisClient: () => { + throw new Error('Redis is not used by this suite; the usage cache reads the ledger') + }, +})) import type { ActivityScope } from '@/lib/billing/core/organization-activity' import { diff --git a/apps/sim/lib/core/config/redis.test.ts b/apps/sim/lib/core/config/redis.test.ts index 2692a262fc0..3b745d83123 100644 --- a/apps/sim/lib/core/config/redis.test.ts +++ b/apps/sim/lib/core/config/redis.test.ts @@ -320,7 +320,7 @@ describe('redis config', () => { mockRedisInstance.set.mockRejectedValueOnce(new Error('Command timed out')) // Mutates the constructed client, not the shared instance it was copied from. mockRedisInstance.eval.mockImplementationOnce(async () => { - Object.assign(getRedisClient() ?? {}, { status: 'ready' }) + Object.assign(getRedisClient(), { status: 'ready' }) return 1 }) diff --git a/apps/sim/lib/desktop/application/executor.integration.ts b/apps/sim/lib/desktop/application/executor.integration.ts index ee051214449..d9f466dbfb8 100644 --- a/apps/sim/lib/desktop/application/executor.integration.ts +++ b/apps/sim/lib/desktop/application/executor.integration.ts @@ -928,12 +928,12 @@ describe('desktop background executor protocol', () => { const desktop = await signedInDesktop() const presenceKey = `desktop:presence:${desktop.deviceId}` const redis = getRedisClient() - await redis?.del(presenceKey) + await redis.del(presenceKey) expect(await isDesktopPresent(desktop.deviceId)).toBe(false) await inbox(desktop) expect(await isDesktopPresent(desktop.deviceId)).toBe(true) - await redis?.del(presenceKey) + await redis.del(presenceKey) const stream = await openDesktopInboxStream.execute({ principal: desktop.principal, input: { deviceId: desktop.deviceId }, @@ -942,7 +942,7 @@ describe('desktop background executor protocol', () => { /** A deploy or rotation closes the stream on the server; only the TTL ends presence. */ stream.subscribe(() => {})() expect(await isDesktopPresent(desktop.deviceId)).toBe(true) - expect(await redis?.ttl(presenceKey)).toBeLessThanOrEqual(45) + expect(await redis.ttl(presenceKey)).toBeLessThanOrEqual(45) }) it('rings only the device whose inbox changed', async () => { diff --git a/apps/sim/lib/mothership/chat/post.test.ts b/apps/sim/lib/mothership/chat/post.test.ts index d26c4fca429..e1614835d23 100644 --- a/apps/sim/lib/mothership/chat/post.test.ts +++ b/apps/sim/lib/mothership/chat/post.test.ts @@ -904,7 +904,7 @@ describe('handleUnifiedChatPost', () => { it('routes workflow-attached chat requests through the copilot backend path', async () => { const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Hello', @@ -976,7 +976,7 @@ describe('handleUnifiedChatPost', () => { it('routes workspace chat requests through the mothership backend path', async () => { const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Hello', @@ -1023,7 +1023,7 @@ describe('handleUnifiedChatPost', () => { it('never persists browser tab attachments, which the desktop app restores itself', async () => { const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Continue in this browser', @@ -1059,7 +1059,7 @@ describe('handleUnifiedChatPost', () => { active: index === 11, })) const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Inspect every open shell', @@ -1085,7 +1085,7 @@ describe('handleUnifiedChatPost', () => { content: 'authorized table', }) const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Summarize this view', @@ -1138,7 +1138,7 @@ describe('handleUnifiedChatPost', () => { }) const currentView = { viewId: 'all-view', filter: null, sort: null } const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'This view', @@ -1171,7 +1171,7 @@ describe('handleUnifiedChatPost', () => { it('validates selection snapshots and omits unsafe browser source URLs', async () => { const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Explain these selections', @@ -1238,7 +1238,7 @@ describe('handleUnifiedChatPost', () => { it('rejects invalid terminal selection line ranges', async () => { const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Explain this selection', @@ -1266,7 +1266,7 @@ describe('handleUnifiedChatPost', () => { it('passes browser attachment metadata without advertising an unavailable browser agent', async () => { const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Explain the selected page', @@ -1300,7 +1300,7 @@ describe('handleUnifiedChatPost', () => { async function sendBrowserTab(tab: { title: string; url: string }): Promise { const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'What is this page?', @@ -1345,7 +1345,7 @@ describe('handleUnifiedChatPost', () => { loadChatMcpServerIds.mockResolvedValue(['mcp-server-1']) const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'now search billing', @@ -1374,7 +1374,7 @@ describe('handleUnifiedChatPost', () => { loadChatMcpServerIds.mockResolvedValue(['mcp-server-1']) const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: '/Docs /Issues cross-reference', @@ -1396,7 +1396,7 @@ describe('handleUnifiedChatPost', () => { it('persists cancelled partial responses from the server lifecycle', async () => { await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Hello', @@ -1438,7 +1438,7 @@ describe('handleUnifiedChatPost', () => { it('persists partial responses when the server lifecycle throws (onError)', async () => { await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Hello', @@ -1485,7 +1485,7 @@ describe('handleUnifiedChatPost', () => { 'persists an empty failure with result metadata present=%s', async (hasResult) => { await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Hello', @@ -1528,7 +1528,7 @@ describe('handleUnifiedChatPost', () => { it('republishes completed status when cancelled lifecycle persistence already ran', async () => { await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Hello', @@ -1572,7 +1572,7 @@ describe('handleUnifiedChatPost', () => { it('rejects requests that have neither workflow nor workspace attachment', async () => { const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Hello', @@ -1820,7 +1820,7 @@ describe('handleUnifiedChatPost copilot.use capability gate', () => { function chatRequest(body: Record = {}) { return createMockRequest({ method: 'POST', - url: 'http://localhost/api/copilot/chat', + url: 'http://localhost/api/mothership/chat', body: { message: 'Hello', workspaceId: 'ws-1', ...body }, }) } @@ -1918,7 +1918,7 @@ describe('handleUnifiedChatPost copilot.use capability gate', () => { }) const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Hello', workflowId: 'wf-1', createNewChat: true }), }) @@ -2028,7 +2028,7 @@ describe('handleUnifiedChatPost copilot.use capability gate', () => { }) const response = await handleUnifiedChatPost( - new NextRequest('http://localhost/api/copilot/chat', { + new NextRequest('http://localhost/api/mothership/chat', { method: 'POST', body: JSON.stringify({ message: 'Hello', workflowId: 'wf-1', createNewChat: true }), }) diff --git a/apps/sim/lib/projects/files/__integration__/uploads.integration.ts b/apps/sim/lib/projects/files/__integration__/uploads.integration.ts index ef7f9748f5e..8a284781337 100644 --- a/apps/sim/lib/projects/files/__integration__/uploads.integration.ts +++ b/apps/sim/lib/projects/files/__integration__/uploads.integration.ts @@ -934,7 +934,7 @@ afterAll(async () => { await db.delete(user).where(inArray(user.id, [f.ownerId, f.editorId])) } await rm(storageRoot, { recursive: true, force: true }) - if (redisKeys.length) await getRedisClient()?.del(...redisKeys) + if (redisKeys.length) await getRedisClient().del(...redisKeys) await closeRedisConnection() const report = process.env.PROJECT_UPLOAD_REPORT_PATH ?? 'test-results/project-upload.json' await mkdir(dirname(report), { recursive: true }) diff --git a/apps/sim/providers/models.ts b/apps/sim/providers/models.ts index 68848787242..a57bc29b113 100644 --- a/apps/sim/providers/models.ts +++ b/apps/sim/providers/models.ts @@ -7067,40 +7067,22 @@ export function supportsForcedToolUse(modelId: string): boolean { return capabilities?.forcedToolUse ?? capabilities?.toolUsageControl ?? false } +/** Discovered model ids as unpriced, capability-less catalog entries. */ +function toUnpricedModels(models: string[]): ModelDefinition[] { + const updatedAt = new Date().toISOString().split('T')[0] + return models.map((id) => ({ id, pricing: { input: 0, output: 0, updatedAt }, capabilities: {} })) +} + export function updateOllamaModels(models: string[]): void { - PROVIDER_DEFINITIONS.ollama.models = models.map((modelId) => ({ - id: modelId, - pricing: { - input: 0, - output: 0, - updatedAt: new Date().toISOString().split('T')[0], - }, - capabilities: {}, - })) + PROVIDER_DEFINITIONS.ollama.models = toUnpricedModels(models) } export function updateVLLMModels(models: string[]): void { - PROVIDER_DEFINITIONS.vllm.models = models.map((modelId) => ({ - id: modelId, - pricing: { - input: 0, - output: 0, - updatedAt: new Date().toISOString().split('T')[0], - }, - capabilities: {}, - })) + PROVIDER_DEFINITIONS.vllm.models = toUnpricedModels(models) } export function updateLiteLLMModels(models: string[]): void { - PROVIDER_DEFINITIONS.litellm.models = models.map((modelId) => ({ - id: modelId, - pricing: { - input: 0, - output: 0, - updatedAt: new Date().toISOString().split('T')[0], - }, - capabilities: {}, - })) + PROVIDER_DEFINITIONS.litellm.models = toUnpricedModels(models) } /** @@ -7116,66 +7098,24 @@ export function updateFireworksModels(models: string[]): void { const staticIds = new Set(STATIC_FIREWORKS_MODELS.map((model) => model.id.toLowerCase())) PROVIDER_DEFINITIONS.fireworks.models = [ ...STATIC_FIREWORKS_MODELS, - ...models - .filter((modelId) => !staticIds.has(modelId.toLowerCase())) - .map((modelId) => ({ - id: modelId, - pricing: { - input: 0, - output: 0, - updatedAt: new Date().toISOString().split('T')[0], - }, - capabilities: {}, - })), + ...toUnpricedModels(models.filter((modelId) => !staticIds.has(modelId.toLowerCase()))), ] } export function updateTogetherModels(models: string[]): void { - PROVIDER_DEFINITIONS.together.models = models.map((modelId) => ({ - id: modelId, - pricing: { - input: 0, - output: 0, - updatedAt: new Date().toISOString().split('T')[0], - }, - capabilities: {}, - })) + PROVIDER_DEFINITIONS.together.models = toUnpricedModels(models) } export function updateBasetenModels(models: string[]): void { - PROVIDER_DEFINITIONS.baseten.models = models.map((modelId) => ({ - id: modelId, - pricing: { - input: 0, - output: 0, - updatedAt: new Date().toISOString().split('T')[0], - }, - capabilities: {}, - })) + PROVIDER_DEFINITIONS.baseten.models = toUnpricedModels(models) } export function updateOllamaCloudModels(models: string[]): void { - PROVIDER_DEFINITIONS['ollama-cloud'].models = models.map((modelId) => ({ - id: modelId, - pricing: { - input: 0, - output: 0, - updatedAt: new Date().toISOString().split('T')[0], - }, - capabilities: {}, - })) + PROVIDER_DEFINITIONS['ollama-cloud'].models = toUnpricedModels(models) } export function updateOpenRouterModels(models: string[]): void { - PROVIDER_DEFINITIONS.openrouter.models = models.map((modelId) => ({ - id: modelId, - pricing: { - input: 0, - output: 0, - updatedAt: new Date().toISOString().split('T')[0], - }, - capabilities: {}, - })) + PROVIDER_DEFINITIONS.openrouter.models = toUnpricedModels(models) } export const EMBEDDING_MODEL_PRICING: Record = { diff --git a/apps/sim/providers/utils.ts b/apps/sim/providers/utils.ts index 0d210d5b064..2685fef9773 100644 --- a/apps/sim/providers/utils.ts +++ b/apps/sim/providers/utils.ts @@ -41,7 +41,9 @@ import { getProviderModels, isKnownModelLevelValue, PROVIDER_DEFINITIONS, - updateOllamaModels as updateOllamaModelsInDefinitions, + updateLiteLLMModels, + updateOllamaModels, + updateVLLMModels, } from '@/providers/models' import { getModelPricing as getRegisteredModelPricing, @@ -171,18 +173,16 @@ export const providers: Record = { } export function updateOllamaProviderModels(models: string[]): void { - updateOllamaModelsInDefinitions(models) + updateOllamaModels(models) providers.ollama.models = getProviderModels('ollama') } export function updateVLLMProviderModels(models: string[]): void { - const { updateVLLMModels } = require('@/providers/models') updateVLLMModels(models) providers.vllm.models = getProviderModels('vllm') } export function updateLiteLLMProviderModels(models: string[]): void { - const { updateLiteLLMModels } = require('@/providers/models') updateLiteLLMModels(models) providers.litellm.models = getProviderModels('litellm') } diff --git a/helm/sim/Chart.yaml b/helm/sim/Chart.yaml index 0b18ad0e06b..ed6f5842954 100644 --- a/helm/sim/Chart.yaml +++ b/helm/sim/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: sim description: A Helm chart for Sim - the open-source AI workspace where teams build, deploy, and manage AI agents type: application -version: 1.15.2 +version: 1.15.3 appVersion: "v0.8.26" kubeVersion: ">=1.25.0-0" home: https://sim.ai diff --git a/helm/sim/values.schema.json b/helm/sim/values.schema.json index fbfe4bab346..a0291befbe4 100644 --- a/helm/sim/values.schema.json +++ b/helm/sim/values.schema.json @@ -300,6 +300,22 @@ "type": "string", "description": "Ollama local LLM server URL (leave empty if not using Ollama)" }, + "VLLM_BASE_URL": { + "type": "string", + "description": "vLLM or LM Studio OpenAI-compatible URL; a trailing /v1 is optional (leave empty if not using vLLM)" + }, + "VLLM_API_KEY": { + "type": "string", + "description": "Optional bearer token for the vLLM endpoint" + }, + "LITELLM_BASE_URL": { + "type": "string", + "description": "LiteLLM proxy base URL, OpenAI-compatible (leave empty if not using LiteLLM)" + }, + "LITELLM_API_KEY": { + "type": "string", + "description": "Optional bearer token for the LiteLLM proxy" + }, "ELEVENLABS_API_KEY": { "type": "string", "description": "ElevenLabs API key for text-to-speech in deployed chat" diff --git a/helm/sim/values.yaml b/helm/sim/values.yaml index 501dcf52e34..4a2a02a506c 100644 --- a/helm/sim/values.yaml +++ b/helm/sim/values.yaml @@ -188,6 +188,10 @@ app: ANTHROPIC_API_KEY_2: "" # Additional Anthropic API key for load balancing ANTHROPIC_API_KEY_3: "" # Additional Anthropic API key for load balancing OLLAMA_URL: "" # Ollama local LLM server URL + VLLM_BASE_URL: "" # vLLM or LM Studio OpenAI-compatible URL (a trailing /v1 is optional) + VLLM_API_KEY: "" # Optional bearer token for the vLLM endpoint + LITELLM_BASE_URL: "" # LiteLLM proxy base URL (OpenAI-compatible) + LITELLM_API_KEY: "" # Optional bearer token for the LiteLLM proxy PII_URL: "" # Presidio PII service URL; auto-computed when pii.enabled, override here otherwise ELEVENLABS_API_KEY: "" # ElevenLabs API key for text-to-speech in deployed chat