Connect AI to your own product
Connect a model provider on the server and inject it into your own product features.
The template supplies a stateless model adapter in foundation/aix and a backend configuration factory in internal/ai. It accepts explicit messages and returns a text completion. There is no default customer chat page, chat API, conversation database or daily usage policy.
Configure a provider supporting the Chat Completions protocol, then create the adapter in your product composition code with the injected HTTP client. Configuration alone does not expose an AI endpoint. Keep the API key on the server and pass the request context into every model call.
Your product owns its prompts, customer authorization, conversation history, task lifecycle and charging policy. Reuse the credit ledger if your feature charges credits; decide when to reserve, charge or refund in that business service. Product-specific screens and workflows are not included in the default customer area.
APP_HOST_AI_ENABLED=true
APP_HOST_AI_BASE_URL=https://api.openai.com/v1
APP_HOST_AI_API_KEY=<your-server-side-provider-key>
APP_HOST_AI_MODEL=<your-compatible-chat-model>
APP_HOST_AI_MAX_OUTPUT_TOKENS=1024