Modules / AI and operations
AI providers and model policy
Configure server-owned providers and the aliases exposed to users.
Setup and configuration
The default AI_PROVIDER=fake supports local deterministic work. Real provider configuration belongs in the server environment. The provider keys listed in .env.example include OpenAI, Anthropic, and an OpenAI-compatible endpoint.
AI_MODEL_POLICY contains ordered model IDs for cheap, fast, and smart aliases. An empty alias list disables that choice. Model IDs must correspond to enabled database catalogue entries with effective immutable pricing.
AI_MODEL_POLICY='{"cheap":[],"fast":["catalog-model-id"],"smart":["catalog-model-id"]}'Implementation workflow
Configure the catalogue and workspace policy before accepting production tasks. The browser receives enabled aliases, while capability matching, model selection, entitlement checks, and budget enforcement stay on the server.
Keep credentials out of NEXT_PUBLIC_ and EXPO_PUBLIC_ variables. For bring-your-own-key mode, use the existing encrypted envelope and server decryption boundary; never return a stored provider key to the interface.
Verification and troubleshooting
Verify disabled aliases, missing capabilities, inactive entitlement, and exhausted budgets. Use a separately authorized provider smoke run for actual generation. If no alias is available, inspect server policy and catalogue configuration rather than exposing a raw model selector.