Skip to main content

AI Configuration

Aicser Enterprise Edition uses Azure OpenAI for natural language queries and AI chart generation.

Create an Azure OpenAI resource

  1. Log in to the Azure portal
  2. Create an Azure OpenAI resource in your subscription
  3. Go to Model deployments and deploy a model (GPT-4.1-mini or GPT-4o-mini recommended)
  4. Note the:
    • API key (from Keys and Endpoint)
    • Endpoint URL (from Keys and Endpoint)
    • API version (use 2024-02-15-preview or latest stable)
    • Deployment name (the name you gave the deployment)

Configure environment variables

In deploy/.env:

AZURE_OPENAI_API_KEY=your-api-key
AZURE_OPENAI_ENDPOINT=https://your-resource-name.openai.azure.com/
AZURE_OPENAI_API_VERSION=2024-02-15-preview
AZURE_OPENAI_DEPLOYMENT_NAME=your-deployment-name

The endpoint must end with a /.

Two-model setup (optional)

EE supports routing between a primary and secondary model:

# Primary model — used for most queries
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4.1-mini

# Secondary model — used for complex reasoning
AZURE_OPENAI_GPT41_API_KEY=your-api-key
AZURE_OPENAI_GPT41_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_GPT41_API_VERSION=2024-02-15-preview
AZURE_OPENAI_GPT41_DEPLOYMENT_NAME=gpt-4.1

If only the primary model is configured, EE uses it for all queries.

Verify

After starting EE, try a natural language question in a chart. If AI is not working:

docker compose -f docker-compose.ee.yml logs server | grep -i "openai\|azure"

Common errors:

ErrorCause
AuthenticationErrorAZURE_OPENAI_API_KEY is wrong
DeploymentNotFoundAZURE_OPENAI_DEPLOYMENT_NAME does not match your Azure deployment
ResourceNotFoundAZURE_OPENAI_ENDPOINT URL format is wrong — must end with /