Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <path>` 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

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/workflows/blocks/agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/workflows/blocks/router.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Pass `<start.input>` as Context, describe Sales, Support, and Billing routes, an
| --- | --- |
| **Context** | Text to analyze, often `<start.input>` or `<agent.content>`. |
| **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.

Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/(auth)/components/social-login-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface SocialLoginButtonsProps {
microsoftAvailable: boolean
view: 'login' | 'signup'
callbackURL?: string
ssoEnabled?: boolean
ssoEnabled: boolean
disabled?: boolean
}

Expand Down
5 changes: 0 additions & 5 deletions apps/sim/app/(auth)/components/sso-login-button.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions apps/sim/app/(auth)/login/login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -347,7 +349,6 @@ export default function LoginPage({
}
}

const ssoEnabled = isSsoEnabled
const hasSocial = githubAvailable || googleAvailable || microsoftAvailable
const hasOnlySSO = ssoEnabled && !emailPasswordEnabled && !hasSocial
const showTopSSO = hasOnlySSO
Expand Down
3 changes: 2 additions & 1 deletion apps/sim/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -21,6 +21,7 @@ export default async function LoginPage() {
googleAvailable={googleAvailable}
microsoftAvailable={microsoftAvailable}
emailPasswordEnabled={isEmailPasswordAuthEnabled}
ssoEnabled={isSsoEnabled}
/>
</Suspense>
)
Expand Down
7 changes: 6 additions & 1 deletion apps/sim/app/(auth)/signup/page.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -45,6 +49,7 @@ export default async function SignupPage({
microsoftAvailable={microsoftAvailable}
emailSignupEnabled={isEmailSignupAllowed}
emailVerificationEnabled={isEmailVerificationEffectivelyEnabled()}
ssoEnabled={isSsoEnabled}
/>
)
}
7 changes: 5 additions & 2 deletions apps/sim/app/(auth)/signup/signup-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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({
Expand All @@ -107,6 +108,7 @@ function SignupFormContent({
microsoftAvailable,
emailSignupEnabled,
emailVerificationEnabled,
ssoEnabled,
}: SignupFormProps) {
const router = useRouter()
const searchParams = useSearchParams()
Expand Down Expand Up @@ -387,7 +389,6 @@ function SignupFormContent({
}
}

const ssoEnabled = isSsoEnabled
const hasSocial = githubAvailable || googleAvailable || microsoftAvailable
const hasOnlySSO = ssoEnabled && !emailSignupEnabled && !hasSocial
const showBottomSection = hasSocial || (ssoEnabled && !hasOnlySSO)
Expand Down Expand Up @@ -516,6 +517,7 @@ export default function SignupPage({
microsoftAvailable,
emailSignupEnabled,
emailVerificationEnabled,
ssoEnabled,
}: SignupFormProps) {
return (
<Suspense fallback={<SignupLoading />}>
Expand All @@ -525,6 +527,7 @@ export default function SignupPage({
microsoftAvailable={microsoftAvailable}
emailSignupEnabled={emailSignupEnabled}
emailVerificationEnabled={emailVerificationEnabled}
ssoEnabled={ssoEnabled}
/>
</Suspense>
)
Expand Down
1 change: 0 additions & 1 deletion apps/sim/app/_styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions apps/sim/app/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/workspace/[workspaceId]/prefetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ vi.mock('@sim/db', () => {
runOutsideTransactionContext: <T>(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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/lib/core/config/redis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})

Expand Down
6 changes: 3 additions & 3 deletions apps/sim/lib/desktop/application/executor.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -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 () => {
Expand Down
Loading
Loading