You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`OS_AUTH_URL`| url |`http://localhost:<OS_PORT>`| Public base URL of the auth server. Required behind a proxy or in production. |
62
62
|`OS_AUTH_SECRET`| string | auto-generated (dev) | Secret used to sign sessions and cookies. **Required** in production. |
63
-
|`OS_AUTH_ADMIN`| boolean |`true`| Enable the admin plugin (first user becomes admin). |
64
-
|`OS_AUTH_TWO_FACTOR`| boolean |`true`| Enable the two-factor authentication plugin. |
63
+
|`OS_AUTH_TWO_FACTOR`| boolean |`false`| Enable the low-level better-auth two-factor plugin. Keep disabled unless your UI handles enrollment, login challenge, and backup-code recovery. |
65
64
|`OS_DISABLE_SIGNUP`| boolean |`false`| When `true`, block new email/password sign-ups. The very first user can still sign up to bootstrap admin. |
65
+
|`OS_AUTH_EMAIL_PASSWORD_ENABLED`| boolean | settings default | Settings env override for `auth.email_password_enabled`. Controls local email/password login. |
66
+
|`OS_AUTH_SIGNUP_ENABLED`| boolean | settings default | Settings env override for `auth.signup_enabled`. Takes precedence over UI settings and is preferred over `OS_DISABLE_SIGNUP`. |
|`OS_AUTH_GOOGLE_ENABLED`| boolean | settings default | Settings env override for `auth.google_enabled`. Requires Google OAuth credentials from Settings or env. |
69
+
|`GOOGLE_CLIENT_ID`| string | — | Deployment-level Google OAuth client id for the open-source Google login implementation. |
70
+
|`GOOGLE_CLIENT_SECRET`| string | — | Deployment-level Google OAuth client secret for the open-source Google login implementation. |
66
71
|`OS_MULTI_ORG_ENABLED`| boolean |`false`| When `true`, expose organization creation/switching UI. When `false`, run in single-tenant mode. |
67
72
|`OS_OIDC_PROVIDER_ENABLED`| boolean |`false`| When `true`, expose this instance as an OIDC identity provider. |
|`OS_AI_MODEL`| string |`gpt-4o-mini`| Default chat model id. |
116
-
|`OS_AI_ACTION_API_BASE_URL`| url | — | Override the base URL the AI action runtime calls (useful for self-hosted proxies). |
117
-
118
-
> Provider credentials (`OPENAI_API_KEY`, `AI_GATEWAY_*`, etc.) keep their
119
-
> upstream names.
128
+
|`AI_GATEWAY_MODEL`| string | — | Vercel AI Gateway model id (for example `openai/gpt-4.1-mini` or `anthropic/claude-sonnet-4-5`). When set, the AI service boots with the gateway adapter before trying direct providers. |
129
+
|`AI_GATEWAY_API_KEY`| string | — | Vercel AI Gateway API key. Required by the gateway SDK for real gateway calls; by itself it does not select the gateway adapter. Pair it with `AI_GATEWAY_MODEL`. |
130
+
|`OPENAI_API_KEY`| string | — | Selects the direct OpenAI adapter when no gateway model is configured. Default model: `gpt-4o`. |
131
+
|`ANTHROPIC_API_KEY`| string | — | Selects the direct Anthropic adapter when gateway and OpenAI are not configured. Default model: `claude-sonnet-4-20250514`. |
132
+
|`GOOGLE_GENERATIVE_AI_API_KEY`| string | — | Selects the direct Google Gemini adapter when gateway, OpenAI, and Anthropic are not configured. Default model: `gemini-2.0-flash`. |
133
+
|`OS_AI_MODEL`| string | provider default | Overrides the model id for direct OpenAI / Anthropic / Google provider detection. Does not override `AI_GATEWAY_MODEL`; gateway model ids already include the provider prefix. |
134
+
|`OS_AI_ACTION_API_BASE_URL`| url | — | Base URL prepended to relative `type: 'api'` action targets exposed as AI tools. Without this or a plugin `apiActionBaseUrl`, relative API actions are skipped for AI exposure. |
135
+
|`OS_AI_PROVIDER`| enum | — | Settings override for the AI provider. Supported values include `gateway`, `openai`, `anthropic`, `google`, `deepseek`, `dashscope`, `cloudflare`, `siliconflow`, and `openrouter`. When set, it locks the Settings UI value. |
136
+
|`OS_AI_GATEWAY_MODEL`| string | — | Settings override for the Vercel AI Gateway model id. Use with `OS_AI_PROVIDER=gateway`. |
137
+
|`OS_AI_GATEWAY_API_KEY`| string | — | Settings override for the Vercel AI Gateway API key. Use with `OS_AI_PROVIDER=gateway`. |
138
+
|`OS_AI_OPENAI_BASE_URL`| url | — | Settings override for the OpenAI-compatible chat base URL. Use with `OS_AI_PROVIDER=openai` for Azure, local gateways, or third-party OpenAI-shaped APIs. |
139
+
|`OS_AI_OPENAI_API_KEY`| string | — | Settings override for the OpenAI-compatible API key. Stored only in env; the Settings UI cannot overwrite it while present. |
140
+
|`OS_AI_OPENAI_MODEL`| string |`gpt-4o`| Settings override for the OpenAI-compatible chat model id. |
141
+
|`OS_AI_ANTHROPIC_API_KEY`| string | — | Settings override for the Anthropic API key. Use with `OS_AI_PROVIDER=anthropic`. |
142
+
|`OS_AI_ANTHROPIC_MODEL`| string |`claude-sonnet-4-20250514`| Settings override for the Anthropic model id. |
143
+
|`OS_AI_GOOGLE_API_KEY`| string | — | Settings override for the Google Generative AI API key. Use with `OS_AI_PROVIDER=google`. |
144
+
|`OS_AI_GOOGLE_MODEL`| string |`gemini-2.0-flash`| Settings override for the Google model id. |
145
+
|`OS_AI_<PROVIDER>_API_KEY`| string | — | Settings override for preset OpenAI-compatible providers, for example `OS_AI_DEEPSEEK_API_KEY`, `OS_AI_DASHSCOPE_API_KEY`, `OS_AI_SILICONFLOW_API_KEY`, or `OS_AI_OPENROUTER_API_KEY`. |
146
+
|`OS_AI_<PROVIDER>_MODEL`| string | provider default | Settings override for preset provider model ids, for example `OS_AI_DEEPSEEK_MODEL=deepseek-chat`. |
147
+
148
+
The boot-time LLM adapter priority is:
149
+
150
+
1. Explicit `AIServicePlugin({ adapter })` or per-plugin `gatewayModel` option.
151
+
2.`AI_GATEWAY_MODEL` using `@ai-sdk/gateway`.
152
+
3.`OPENAI_API_KEY` using `@ai-sdk/openai`.
153
+
4.`ANTHROPIC_API_KEY` using `@ai-sdk/anthropic`.
154
+
5.`GOOGLE_GENERATIVE_AI_API_KEY` using `@ai-sdk/google`.
155
+
6.`MemoryLLMAdapter` echo mode when no real provider is configured.
156
+
157
+
After boot, if the Settings service is mounted, `@objectstack/service-ai`
158
+
reads the `ai` Settings namespace and swaps the adapter when the provider
159
+
comes from env or a stored Settings UI value. The manifest default
160
+
`provider=memory` is ignored so it does not mask boot-time auto-detection;
161
+
an explicit `OS_AI_PROVIDER=memory` or stored UI value does switch the runtime
162
+
back to memory. Settings values resolve as:
163
+
164
+
```text
165
+
env (`OS_<NAMESPACE>_<KEY>`) > stored Settings UI value > default
166
+
```
167
+
168
+
That means `OS_AI_PROVIDER=openai` plus `OS_AI_OPENAI_BASE_URL=...` wins over
169
+
both the Settings UI and the boot-time provider auto-detection. ObjectStack
170
+
does not read unprefixed settings override names such as `AI_PROVIDER` or
171
+
`AI_OPENAI_BASE_URL`.
172
+
173
+
For example, a third-party OpenAI-compatible provider can be deployment-locked
0 commit comments