Configure your AI provider via environment variables
For self-hosting, configure AI through environment variables in apps/web/.env.
If you used inbox-zero setup, many of these values are configured automatically.Start here:
For most self-hosted setups, configure the default tier and optionally override cheaper or role-specific tiers:
DEFAULT_LLMS (required): normal AI tasks.
ECONOMY_LLMS (optional): lower-cost model for high-volume tasks. If unset, it falls back to default.
CHAT_LLMS (optional): assistant chat. If unset, it falls back to default.
DRAFT_LLMS (optional): reply drafting. If unset, it falls back to default.
NANO_LLMS (optional): lightweight classification and extraction. If unset, it falls back to economy/default behavior.
Each value is an ordered comma-separated list in provider:model format. The first valid entry is the primary model. Later valid entries are ordered fallbacks. Model names can contain colons; only the first colon separates the provider from the model.Minimal example:
Provider-specific keys (for example OPENAI_API_KEY, ANTHROPIC_API_KEY) also work. See Environment Variables for the full list.
App Settings
The app also has Settings → AI for per-user keys/models, but self-hosted deployments usually keep configuration at the environment-variable level.
Sensitive Data Protection
Self-hosted deployments can choose how LLM requests handle sensitive data matches before they are sent to an AI provider. The current scanner targets likely credentials/tokens and payment-card-like numbers; it is not a full DLP or PHI classifier.
SENSITIVE_DATA_POLICY_DEFAULT=ALLOW # ALLOW, REDACT, or BLOCKNEXT_PUBLIC_SENSITIVE_DATA_POLICY_LOCKED=false
ALLOW preserves the default behavior. REDACT replaces matched values before the LLM request. BLOCK stops the request when a match is found. Leave NEXT_PUBLIC_SENSITIVE_DATA_POLICY_LOCKED=false to let users choose per account in Settings, or set it to true to enforce the deployment default for all accounts and hide the setting from the UI.
Decision Models
Some classification steps (rule selection, sender categorization, thread status, recurring-pattern detection, reply memory selection, and unsubscribe page checks) can use a decision model instead of an LLM. Cold email detection uses the LLM unless DECISION_MODEL_COLD_EMAIL_ENABLED=true. Decision models answer typed questions about structured state and return calibrated probabilities. They run through the AI SDK’s decision model interface, so switching models is a config change:
DEFAULT_DECISION_MODEL=openrouter:typesafe/jev-1.13 # or openrouter:cloudflare/clefDEFAULT_DECISION_MODEL_ENABLED=false # true: on for users who haven't chosen; false: users opt inDECISION_MODEL_COLD_EMAIL_ENABLED=false # true: the decision model also detects cold email
Use the same provider:model format as the *_LLMS variables. Supported providers are openrouter, aigateway, openai, and typesafe. Keys resolve the same way too: the provider’s key (OPENROUTER_API_KEY, AI_GATEWAY_API_KEY, or OPENAI_API_KEY), falling back to LLM_API_KEY. Direct TypeSafe always needs TYPESAFE_API_KEY.The decision model receives the same email content as the LLM it replaces, with the same sensitive data policy applied. Users who set their own AI key are not enrolled by default. If a decision call fails, that step falls back to the configured LLM.
Turning it on
Set DEFAULT_DECISION_MODEL and the provider’s API key, then restart. For example, Jev through OpenRouter: DEFAULT_DECISION_MODEL=openrouter:typesafe/jev-1.13 with OPENROUTER_API_KEY. For Clef, use openrouter:cloudflare/clef.
Each user then sees a Specialized decision model switch under Settings → AI Model. It is off until the user turns it on.
To turn it on for everyone who hasn’t chosen, set DEFAULT_DECISION_MODEL_ENABLED=true. This excludes users with their own AI key, and a user’s own choice in Settings always wins.
If NEXT_PUBLIC_AI_MODEL_SETTINGS_DISABLED=true, the switch is hidden. Then DEFAULT_DECISION_MODEL_ENABLED decides for users who haven’t chosen.
Provider-specific details
azure-foundry requires AZURE_FOUNDRY_API_KEY and AZURE_FOUNDRY_BASE_URL. Use the deployment name as the model portion of the azure-foundry:<deployment> entry.
cerebras uses CEREBRAS_API_KEY (or LLM_API_KEY) against https://api.cerebras.ai/v1. Example chat model: CHAT_LLMS=cerebras:qwen-3.8-27b.
openai-compatible also requires OPENAI_COMPATIBLE_BASE_URL. Set OPENAI_COMPATIBLE_AUTH_HEADER=api-key when the server expects an api-key header instead of bearer authorization. This can point at Cerebras (https://api.cerebras.ai/v1) if you do not want the dedicated provider, but then you cannot also use a local OpenAI-compatible server.
ollama can use OLLAMA_BASE_URL and OLLAMA_MODEL.
Ollama / OpenAI-compatible thinking
Set LOCAL_LLM_THINKING=off or on to request disabled or enabled thinking where the model and server support it. Unset or auto (the default) adds no thinking options, so nothing changes from today. With the ollama provider that means thinking stays off, because the Ollama provider library sends think: false by default; set on to turn it on.The ollama provider sends think: false/true to the native API. The openai-compatible provider sends chat_template_kwargs.enable_thinking: false/true; support depends on the server and model, and unsupported options may be ignored or rejected. No reasoning_effort is sent. Ollama’s OpenAI-compatible /v1 endpoint ignores chat_template_kwargs, so use the ollama provider to control thinking with Ollama.
Fallbacks
Add fallbacks by adding more entries to the same role list:
Unsupported providers, entries without configured credentials, entries without models, and duplicates are skipped with warnings.
Legacy variables
The old DEFAULT_LLM_PROVIDER / DEFAULT_LLM_MODEL, role-specific *_LLM_PROVIDER / *_LLM_MODEL, and *_LLM_FALLBACKS variables are deprecated but still supported for existing deployments. At startup, they are converted into the corresponding *_LLMS value. New deployments and CLI-generated env files should use *_LLMS.
CLI LLM providers
codex-cli and claude-code are experimental self-host options. They use
third-party community AI SDK provider packages that spawn local CLI tools, so
they are disabled unless CLI_LLM_ENABLED=true.Use them only on trusted self-hosted deployments. Review the provider package
source, pin exact package versions, and make sure you comply with the relevant
OpenAI or Anthropic terms for your authentication method.Codex example:
cd apps/webpnpm add ai-sdk-provider-codex-cli@1.1.0pnpm add -g @openai/codexcodex login
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Inbox Zero Documentation","colors":{"primary":"#2563eb","light":"#60a5fa","dark":"#2563eb"},"logo":{"light":"https://mintcdn.com/inboxzero/DdfmrevgGKRNBfeU/logo/light.svg?fit=max\u0026auto=format\u0026n=DdfmrevgGKRNBfeU\u0026q=85\u0026s=81151059779000ba0fadf8efae6d3ae3","dark":"https://mintcdn.com/inboxzero/DdfmrevgGKRNBfeU/logo/dark.svg?fit=max\u0026auto=format\u0026n=DdfmrevgGKRNBfeU\u0026q=85\u0026s=6fe089ef0fc981122cb19493db6de4b9"},"favicon":"https://mintcdn.com/inboxzero/wagtDAhDWuhi4Pvs/favicon.png?fit=max\u0026auto=format\u0026n=wagtDAhDWuhi4Pvs\u0026q=85\u0026s=eaad4618bb3e0339dbd09779b3e1687c","api":{"openapi":"openapi.json"},"navbar":{"links":[{"href":"mailto:support@getinboxzero.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://www.getinboxzero.com/welcome"}},"footer":{"socials":{"twitter":"https://www.getinboxzero.com/twitter","github":"https://www.getinboxzero.com/github","linkedin":"https://www.getinboxzero.com/linkedin"}},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Changelog","icon":"clock-rotate-left","href":"/changelog"},{"anchor":"Community","icon":"discord","href":"https://getinboxzero.com/discord"},{"anchor":"Blog","icon":"newspaper","href":"https://www.getinboxzero.com/blog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"inboxzero","hasAudioNarration":false,"actualSubdomain":"inboxzero","customDomains":["docs.getinboxzero.com"],"gitSource":{"type":"github","owner":"elie222","repo":"inbox-zero","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b0237549421b24d9c42c018","clientVersion":"0.0.4277","searchFilterCounts":[{"language":"default","tag":"Developers","count":36},{"language":"default","tag":"Documentation","count":32},{"language":"default","tag":"API","count":11},{"language":"default","tag":"Self-Hosting","count":8},{"language":"default","tag":"Assistant \u0026 Automation","count":6},{"language":"default","tag":"Setup Guides","count":6},{"language":"default","tag":"Channels \u0026 Integrations","count":4},{"language":"default","tag":"Early Access","count":4},{"language":"default","tag":"Safety \u0026 Help","count":4},{"language":"default","tag":"AWS Deployment","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"hosting/llm-setup","slug":"/hosting/llm-setup","pageMetadata":{"title":"LLM","description":"Configure your AI provider via environment variables","href":"/hosting/llm-setup"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Configure your AI provider via environment variables\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`For self-hosting, configure AI through environment variables in `,_jsx(_components.code,{children:`apps/web/.env`}),`.\nIf you used `,_jsx(_components.code,{children:`inbox-zero setup`}),`, many of these values are configured automatically.`]}),`\n`,_jsx(_components.p,{children:`Start here:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/hosting/environment-variables`,children:`Environment Variables`}),` (full reference)`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`API keys require billing credits on the provider’s platform. A ChatGPT Plus or Claude Pro subscription does `,_jsx(_components.strong,{children:`not`}),` include API access.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`providers`,children:`Providers`}),`\n`,_jsxs(_components.p,{children:[`Use one of these provider values before the colon in `,_jsx(_components.code,{children:`*_LLMS`}),` entries:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Provider`}),_jsx(_components.th,{children:`Value`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://platform.openai.com/docs/overview`,children:`OpenAI`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`openai`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://docs.anthropic.com/en/docs/welcome`,children:`Anthropic`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`anthropic`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://ai-sdk.dev/providers/ai-sdk-providers/azure`,children:`Azure OpenAI`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`azure`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Azure AI Foundry`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`azure-foundry`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://ai.google.dev/gemini-api/docs`,children:`Google Gemini (AI Studio)`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`google`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex`,children:`Google Vertex AI`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`vertex`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://openrouter.ai/docs/quickstart`,children:`OpenRouter`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`openrouter`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://console.groq.com/docs/quickstart`,children:`Groq`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`groq`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://inference-docs.cerebras.ai/quickstart`,children:`Cerebras`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`cerebras`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://ai-sdk.dev/providers/ai-sdk-providers/ai-gateway`,children:`Vercel AI Gateway`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`aigateway`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock`,children:`AWS Bedrock`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`bedrock`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.a,{href:`https://ollama.com/`,children:`Ollama`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`ollama`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`OpenAI-compatible (LM Studio, vLLM, LiteLLM, etc.)`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`openai-compatible`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Codex CLI (experimental, self-host only)`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`codex-cli`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Claude Code (experimental, self-host only)`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`claude-code`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`tiers`,children:`Tiers`}),`\n`,_jsx(_components.p,{children:`For most self-hosted setups, configure the default tier and optionally override cheaper or role-specific tiers:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`DEFAULT_LLMS`}),` (required): normal AI tasks.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`ECONOMY_LLMS`}),` (optional): lower-cost model for high-volume tasks. If unset, it falls back to default.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`CHAT_LLMS`}),` (optional): assistant chat. If unset, it falls back to default.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`DRAFT_LLMS`}),` (optional): reply drafting. If unset, it falls back to default.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`NANO_LLMS`}),` (optional): lightweight classification and extraction. If unset, it falls back to economy/default behavior.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Each value is an ordered comma-separated list in `,_jsx(_components.code,{children:`provider:model`}),` format. The first valid entry is the primary model. Later valid entries are ordered fallbacks. Model names can contain colons; only the first colon separates the provider from the model.`]}),`\n`,_jsx(_components.p,{children:`Minimal example:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DEFAULT_LLMS=openai:gpt-6-luna`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ECONOMY_LLMS=openai:gpt-6-luna`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`LLM_API_KEY=sk-...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Provider-specific keys (for example `,_jsx(_components.code,{children:`OPENAI_API_KEY`}),`, `,_jsx(_components.code,{children:`ANTHROPIC_API_KEY`}),`) also work. See `,_jsx(_components.a,{href:`/hosting/environment-variables`,children:`Environment Variables`}),` for the full list.`]}),`\n`,_jsx(Heading,{level:`2`,id:`app-settings`,children:`App Settings`}),`\n`,_jsxs(_components.p,{children:[`The app also has `,_jsx(_components.strong,{children:`Settings → AI`}),` for per-user keys/models, but self-hosted deployments usually keep configuration at the environment-variable level.`]}),`\n`,_jsx(Heading,{level:`2`,id:`sensitive-data-protection`,children:`Sensitive Data Protection`}),`\n`,_jsx(_components.p,{children:`Self-hosted deployments can choose how LLM requests handle sensitive data matches before they are sent to an AI provider. The current scanner targets likely credentials/tokens and payment-card-like numbers; it is not a full DLP or PHI classifier.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`SENSITIVE_DATA_POLICY_DEFAULT=ALLOW # ALLOW, REDACT, or BLOCK`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`NEXT_PUBLIC_SENSITIVE_DATA_POLICY_LOCKED=false`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`ALLOW`}),` preserves the default behavior. `,_jsx(_components.code,{children:`REDACT`}),` replaces matched values before the LLM request. `,_jsx(_components.code,{children:`BLOCK`}),` stops the request when a match is found. Leave `,_jsx(_components.code,{children:`NEXT_PUBLIC_SENSITIVE_DATA_POLICY_LOCKED=false`}),` to let users choose per account in Settings, or set it to `,_jsx(_components.code,{children:`true`}),` to enforce the deployment default for all accounts and hide the setting from the UI.`]}),`\n`,_jsx(Heading,{level:`2`,id:`decision-models`,children:`Decision Models`}),`\n`,_jsxs(_components.p,{children:[`Some classification steps (rule selection, sender categorization, thread status, recurring-pattern detection, reply memory selection, and unsubscribe page checks) can use a decision model instead of an LLM. Cold email detection uses the LLM unless `,_jsx(_components.code,{children:`DECISION_MODEL_COLD_EMAIL_ENABLED=true`}),`. Decision models answer typed questions about structured state and return calibrated probabilities. They run through the AI SDK’s decision model interface, so switching models is a config change:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DEFAULT_DECISION_MODEL=openrouter:typesafe/jev-1.13 # or openrouter:cloudflare/clef`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DEFAULT_DECISION_MODEL_ENABLED=false # true: on for users who haven't chosen; false: users opt in`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DECISION_MODEL_COLD_EMAIL_ENABLED=false # true: the decision model also detects cold email`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Use the same `,_jsx(_components.code,{children:`provider:model`}),` format as the `,_jsx(_components.code,{children:`*_LLMS`}),` variables. Supported providers are `,_jsx(_components.code,{children:`openrouter`}),`, `,_jsx(_components.code,{children:`aigateway`}),`, `,_jsx(_components.code,{children:`openai`}),`, and `,_jsx(_components.code,{children:`typesafe`}),`. Keys resolve the same way too: the provider’s key (`,_jsx(_components.code,{children:`OPENROUTER_API_KEY`}),`, `,_jsx(_components.code,{children:`AI_GATEWAY_API_KEY`}),`, or `,_jsx(_components.code,{children:`OPENAI_API_KEY`}),`), falling back to `,_jsx(_components.code,{children:`LLM_API_KEY`}),`. Direct TypeSafe always needs `,_jsx(_components.code,{children:`TYPESAFE_API_KEY`}),`.`]}),`\n`,_jsx(_components.p,{children:`The decision model receives the same email content as the LLM it replaces, with the same sensitive data policy applied. Users who set their own AI key are not enrolled by default. If a decision call fails, that step falls back to the configured LLM.`}),`\n`,_jsx(Heading,{level:`3`,id:`turning-it-on`,children:`Turning it on`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Set `,_jsx(_components.code,{children:`DEFAULT_DECISION_MODEL`}),` and the provider’s API key, then restart. For example, Jev through OpenRouter: `,_jsx(_components.code,{children:`DEFAULT_DECISION_MODEL=openrouter:typesafe/jev-1.13`}),` with `,_jsx(_components.code,{children:`OPENROUTER_API_KEY`}),`. For Clef, use `,_jsx(_components.code,{children:`openrouter:cloudflare/clef`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Each user then sees a `,_jsx(_components.strong,{children:`Specialized decision model`}),` switch under `,_jsx(_components.strong,{children:`Settings → AI Model`}),`. It is off until the user turns it on.`]}),`\n`,_jsxs(_components.li,{children:[`To turn it on for everyone who hasn’t chosen, set `,_jsx(_components.code,{children:`DEFAULT_DECISION_MODEL_ENABLED=true`}),`. This excludes users with their own AI key, and a user’s own choice in Settings always wins.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`NEXT_PUBLIC_AI_MODEL_SETTINGS_DISABLED=true`}),`, the switch is hidden. Then `,_jsx(_components.code,{children:`DEFAULT_DECISION_MODEL_ENABLED`}),` decides for users who haven’t chosen.`]}),`\n`,_jsx(Heading,{level:`2`,id:`provider-specific-details`,children:`Provider-specific details`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`azure-foundry`}),` requires `,_jsx(_components.code,{children:`AZURE_FOUNDRY_API_KEY`}),` and `,_jsx(_components.code,{children:`AZURE_FOUNDRY_BASE_URL`}),`. Use the deployment name as the model portion of the `,_jsx(_components.code,{children:`azure-foundry:\u003cdeployment>`}),` entry.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`cerebras`}),` uses `,_jsx(_components.code,{children:`CEREBRAS_API_KEY`}),` (or `,_jsx(_components.code,{children:`LLM_API_KEY`}),`) against `,_jsx(_components.code,{children:`https://api.cerebras.ai/v1`}),`. Example chat model: `,_jsx(_components.code,{children:`CHAT_LLMS=cerebras:qwen-3.8-27b`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`openai-compatible`}),` also requires `,_jsx(_components.code,{children:`OPENAI_COMPATIBLE_BASE_URL`}),`. Set `,_jsx(_components.code,{children:`OPENAI_COMPATIBLE_AUTH_HEADER=api-key`}),` when the server expects an `,_jsx(_components.code,{children:`api-key`}),` header instead of bearer authorization. This can point at Cerebras (`,_jsx(_components.code,{children:`https://api.cerebras.ai/v1`}),`) if you do not want the dedicated provider, but then you cannot also use a local OpenAI-compatible server.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`ollama`}),` can use `,_jsx(_components.code,{children:`OLLAMA_BASE_URL`}),` and `,_jsx(_components.code,{children:`OLLAMA_MODEL`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`ollama-/-openai-compatible-thinking`,children:`Ollama / OpenAI-compatible thinking`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`LOCAL_LLM_THINKING=off`}),` or `,_jsx(_components.code,{children:`on`}),` to request disabled or enabled thinking where the model and server support it. Unset or `,_jsx(_components.code,{children:`auto`}),` (the default) adds no thinking options, so nothing changes from today. With the `,_jsx(_components.code,{children:`ollama`}),` provider that means thinking stays off, because the Ollama provider library sends `,_jsx(_components.code,{children:`think: false`}),` by default; set `,_jsx(_components.code,{children:`on`}),` to turn it on.`]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`ollama`}),` provider sends `,_jsx(_components.code,{children:`think: false/true`}),` to the native API. The `,_jsx(_components.code,{children:`openai-compatible`}),` provider sends `,_jsx(_components.code,{children:`chat_template_kwargs.enable_thinking: false/true`}),`; support depends on the server and model, and unsupported options may be ignored or rejected. No `,_jsx(_components.code,{children:`reasoning_effort`}),` is sent. Ollama’s OpenAI-compatible `,_jsx(_components.code,{children:`/v1`}),` endpoint ignores `,_jsx(_components.code,{children:`chat_template_kwargs`}),`, so use the `,_jsx(_components.code,{children:`ollama`}),` provider to control thinking with Ollama.`]}),`\n`,_jsx(Heading,{level:`2`,id:`fallbacks`,children:`Fallbacks`}),`\n`,_jsx(_components.p,{children:`Add fallbacks by adding more entries to the same role list:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DEFAULT_LLMS=openrouter:anthropic/claude-sonnet-5,openai:gpt-6-luna`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ECONOMY_LLMS=openrouter:openai/gpt-6-luna,google:gemini-3.1-flash-lite`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`CHAT_LLMS=openrouter:anthropic/claude-haiku-4.5,openai:gpt-6-luna`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Unsupported providers, entries without configured credentials, entries without models, and duplicates are skipped with warnings.`}),`\n`,_jsx(Heading,{level:`3`,id:`legacy-variables`,children:`Legacy variables`}),`\n`,_jsxs(_components.p,{children:[`The old `,_jsx(_components.code,{children:`DEFAULT_LLM_PROVIDER`}),` / `,_jsx(_components.code,{children:`DEFAULT_LLM_MODEL`}),`, role-specific `,_jsx(_components.code,{children:`*_LLM_PROVIDER`}),` / `,_jsx(_components.code,{children:`*_LLM_MODEL`}),`, and `,_jsx(_components.code,{children:`*_LLM_FALLBACKS`}),` variables are deprecated but still supported for existing deployments. At startup, they are converted into the corresponding `,_jsx(_components.code,{children:`*_LLMS`}),` value. New deployments and CLI-generated env files should use `,_jsx(_components.code,{children:`*_LLMS`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`cli-llm-providers`,children:`CLI LLM providers`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`codex-cli`}),` and `,_jsx(_components.code,{children:`claude-code`}),` are experimental self-host options. They use\nthird-party community AI SDK provider packages that spawn local CLI tools, so\nthey are disabled unless `,_jsx(_components.code,{children:`CLI_LLM_ENABLED=true`}),`.`]}),`\n`,_jsx(_components.p,{children:`Use them only on trusted self-hosted deployments. Review the provider package\nsource, pin exact package versions, and make sure you comply with the relevant\nOpenAI or Anthropic terms for your authentication method.`}),`\n`,_jsx(_components.p,{children:`Codex example:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apps/web`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pnpm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ai-sdk-provider-codex-cli@1.1.0`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pnpm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -g`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @openai/codex`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`codex`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` login`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`CLI_LLM_ENABLED=true`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DEFAULT_LLMS=codex-cli:gpt-5.3-codex`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`CODEX_CLI_ALLOW_NPX=false`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Claude Code example:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apps/web`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`pnpm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ai-sdk-provider-claude-code@4.3.1`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`claude`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` auth`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` login`})]}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`CLI_LLM_ENABLED=true`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`DEFAULT_LLMS=claude-code:sonnet`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"LLM","description":"Configure your AI provider via environment variables","href":"/hosting/llm-setup"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Providers","slug":"providers","depth":2,"children":[]},{"title":"Tiers","slug":"tiers","depth":2,"children":[]},{"title":"App Settings","slug":"app-settings","depth":2,"children":[]},{"title":"Sensitive Data Protection","slug":"sensitive-data-protection","depth":2,"children":[]},{"title":"Decision Models","slug":"decision-models","depth":2,"children":[{"title":"Turning it on","slug":"turning-it-on","depth":3,"children":[]}]},{"title":"Provider-specific details","slug":"provider-specific-details","depth":2,"children":[{"title":"Ollama / OpenAI-compatible thinking","slug":"ollama-/-openai-compatible-thinking","depth":3,"children":[]}]},{"title":"Fallbacks","slug":"fallbacks","depth":2,"children":[{"title":"Legacy variables","slug":"legacy-variables","depth":3,"children":[]},{"title":"CLI LLM providers","slug":"cli-llm-providers","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"inboxzero","siteName":"Inbox Zero Documentation","title":"LLM - Inbox Zero Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-30T03:14:09.320Z","originalFileLocation":"hosting/llm-setup.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Configure your AI provider via environment variables\">\u003cmeta data-mint-head name=\"application-name\" content=\"Inbox Zero Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"LLM - Inbox Zero Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Configure your AI provider via environment variables\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Inbox Zero Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.getinboxzero.com/hosting/llm-setup\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://inboxzero.mintlify.site/_mintlify/api/og/v2?division=Setup+Guides\u0026amp;title=LLM\u0026amp;description=Configure+your+AI+provider+via+environment+variables\u0026amp;theme=4663a26da0160d9209c6eb4e\u0026amp;signature=ba0958bb8ae098b2870ff6a4b75448a281ff58173801d697697a7749f513d89d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"LLM - Inbox Zero Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Configure your AI provider via environment variables\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://inboxzero.mintlify.site/_mintlify/api/og/v2?division=Setup+Guides\u0026amp;title=LLM\u0026amp;description=Configure+your+AI+provider+via+environment+variables\u0026amp;theme=4663a26da0160d9209c6eb4e\u0026amp;signature=ba0958bb8ae098b2870ff6a4b75448a281ff58173801d697697a7749f513d89d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/inboxzero/IQcRpnjUMR6zhHwi/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Inbox Zero Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563eb\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.getinboxzero.com/hosting/llm-setup\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/hosting/llm-setup.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.getinboxzero.com/#organization\",\"name\":\"Inbox Zero Documentation\",\"url\":\"https://docs.getinboxzero.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/inboxzero/DdfmrevgGKRNBfeU/logo/light.svg?fit=max\u0026auto=format\u0026n=DdfmrevgGKRNBfeU\u0026q=85\u0026s=81151059779000ba0fadf8efae6d3ae3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.getinboxzero.com#website\",\"name\":\"Inbox Zero Documentation\",\"url\":\"https://docs.getinboxzero.com\",\"publisher\":{\"@id\":\"https://docs.getinboxzero.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.getinboxzero.com/hosting/llm-setup#webpage\",\"url\":\"https://docs.getinboxzero.com/hosting/llm-setup\",\"name\":\"LLM\",\"description\":\"Configure your AI provider via environment variables\",\"dateModified\":\"2026-10-30T03:14:09.320Z\",\"isPartOf\":{\"@id\":\"https://docs.getinboxzero.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.getinboxzero.com/hosting/llm-setup#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.getinboxzero.com/hosting/llm-setup#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Setup Guides\",\"item\":\"https://docs.getinboxzero.com/hosting/setup-guides\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LLM\",\"item\":\"https://docs.getinboxzero.com/hosting/llm-setup\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.getinboxzero.com/hosting/llm-setup#article\",\"headline\":\"LLM\",\"name\":\"LLM\",\"description\":\"Configure your AI provider via environment variables\",\"url\":\"https://docs.getinboxzero.com/hosting/llm-setup\",\"mainEntityOfPage\":{\"@id\":\"https://docs.getinboxzero.com/hosting/llm-setup#webpage\"},\"dateModified\":\"2026-10-30T03:14:09.320Z\",\"publisher\":{\"@id\":\"https://docs.getinboxzero.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.getinboxzero.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Inbox Zero Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Inbox Zero Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/hosting/llm-setup.md","siteName":"Inbox Zero Documentation","nav":{"global":{"anchors":[{"anchor":"Changelog","icon":"clock-rotate-left","href":"/changelog"},{"anchor":"Community","icon":"discord","href":"https://getinboxzero.com/discord"},{"anchor":"Blog","icon":"newspaper","href":"https://www.getinboxzero.com/blog"}]},"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/introduction"}]},{"anchor":"Developers","icon":"code","groups":[{"group":"Quick Start","pages":[{"title":"Quick Start","href":"/hosting/quick-start"},{"title":"Self-Hosting Setup CLI","icon":"terminal","href":"/hosting/setup-cli-reference"}]},{"group":"Setup Guides","pages":[{"title":"Overview","href":"/hosting/setup-guides"},{"title":"Google OAuth","href":"/hosting/google-oauth"},{"title":"Google PubSub","href":"/hosting/google-pubsub"},{"title":"Microsoft OAuth","href":"/hosting/microsoft-oauth"},{"title":"Enterprise SSO and SCIM","description":"Configure SAML SSO and SCIM user provisioning for organization deployments.","href":"/hosting/sso"},{"title":"LLM","href":"/hosting/llm-setup"}]},{"group":"Self-Hosting","pages":[{"title":"Docker/VPS Deployment Guide","description":"Production deployment on your own VPS with Docker and Docker Compose","href":"/hosting/self-hosting"},{"title":"Environment Variables","href":"/hosting/environment-variables"},{"title":"Production Operations","icon":"server","href":"/hosting/production-operations"},{"title":"Security Hardening","icon":"lock","href":"/hosting/security-hardening"},{"title":"Vercel Deployment","href":"/hosting/vercel"},{"title":"Kubernetes Deployment","href":"/hosting/kubernetes"},{"title":"Troubleshooting","href":"/hosting/troubleshooting"},{"title":"Image Proxy","href":"/hosting/image-proxy"}]},{"group":"AWS Deployment","pages":[{"title":"AWS Deployment","href":"/hosting/aws"},{"title":"EC2 Deployment","href":"/hosting/ec2-deployment"},{"title":"Terraform Deployment","href":"/hosting/terraform"},{"title":"Copilot Deployment","href":"/hosting/aws-copilot"}]},{"group":"GCP Deployment","pages":[{"title":"GCP + Cloudflare Tunnel","href":"/hosting/gcp-cloudflare-tunnel"}]},{"group":"Contributing","pages":[{"title":"Contributing","href":"/contributing"}]},{"group":"Integrations","pages":[{"title":"Slack Integration Setup","href":"/slack/setup"},{"title":"Microsoft Teams Integration Setup","href":"/teams/setup"},{"title":"Telegram Integration Setup","href":"/telegram/setup"}]},{"group":"API","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"CLI","href":"/api-reference/cli"},{"title":"MCP server","href":"/api-reference/mcp"},{"title":"Get stats by period","openapi":"GET /stats/by-period","href":"/api-reference/endpoint/get-statsby-period"},{"title":"Get stats response time","openapi":"GET /stats/response-time","href":"/api-reference/endpoint/get-statsresponse-time"},{"title":"List rules","openapi":"GET /rules","href":"/api-reference/endpoint/get-rules"},{"title":"Create rule","openapi":"POST /rules","href":"/api-reference/endpoint/post-rules"},{"title":"Get rule","openapi":"GET /rules/{id}","href":"/api-reference/endpoint/get-rules-id"},{"title":"Update rule","openapi":"PUT /rules/{id}","href":"/api-reference/endpoint/put-rules-id"},{"title":"Delete rule","openapi":"DELETE /rules/{id}","href":"/api-reference/endpoint/delete-rules-id"},{"title":"Unsubscribe sender","openapi":"POST /senders/unsubscribe","href":"/api-reference/endpoint/post-senders-unsubscribe"}]}]}]},"basePath":"","title":"LLM - Inbox Zero Documentation","deploymentId":"dpl_BzgRxZmUbhHRoPLkBx1DiVRSyQhV","buildId":"dpl_BzgRxZmUbhHRoPLkBx1DiVRSyQhV","dynamics":[],"chunks":[]}