Configure zymtrace AI Assistant
The AI Assistant feature enables AI-powered analysis capabilities directly in the zymtrace UI. You can configure one or multiple AI providers to get intelligent insights about your performance data.
Supported Providers​
zymtrace supports the following AI providers:
| Provider | Get API Key |
|---|---|
| Anthropic Claude | console.anthropic.com |
| Google Gemini | aistudio.google.com/apikey |
| OpenAI | platform.openai.com/api-keys |
| Custom LLM | Any OpenAI-compatible chat completions endpoint (Coming soon) |
Prerequisites​
- zymtrace backend version
25.12.3or later - API key from at least one supported AI provider
Configuration​
- Helm
- Docker Compose
Enable AI Assistant with Helm​
To enable the AI Assistant, set aiAssistant.enabled=true and provide API key(s) for your chosen provider(s). You can configure one or multiple providers:
helm upgrade --install backend zymtrace/backend \
--namespace zymtrace \
--set aiAssistant.enabled=true \
--set aiAssistant.anthropic.apiKey="$ANTHROPIC_API_KEY" \
--set aiAssistant.gemini.apiKey="$GEMINI_API_KEY" \
--set aiAssistant.openai.apiKey="$OPENAI_API_KEY"
You only need to configure the providers you want to use. For example, to use only Anthropic Claude, simply omit the other --set flags.
Using a Values File​
For more maintainable configuration, use a custom values file:
aiAssistant:
enabled: true
# Anthropic Claude - https://console.anthropic.com/
anthropic:
apiKey: "sk-ant-api03-..."
# Google Gemini - https://aistudio.google.com/apikey
gemini:
apiKey: "AIzaSy..."
# OpenAI - https://platform.openai.com/api-keys
openai:
apiKey: "sk-proj-..."
Then install or upgrade with:
helm upgrade --install backend zymtrace/backend \
--namespace zymtrace \
-f custom-values.yaml
For production deployments, consider using external secrets management (like External Secrets Operator or Sealed Secrets) rather than storing API keys directly in values files.
Enable AI Assistant with Docker Compose​
Add the following environment variables to your docker-compose.yml file for the web service:
services:
web:
# ... other configuration ...
environment:
# Enable one or more AI providers
WEB__ASSISTANT__API_KEYS__ANTHROPIC: "${ANTHROPIC_API_KEY}"
WEB__ASSISTANT__API_KEYS__GEMINI: "${GEMINI_API_KEY}"
WEB__ASSISTANT__API_KEYS__OPENAI: "${OPENAI_API_KEY}"
Then set the environment variables before starting the containers:
export ANTHROPIC_API_KEY="sk-ant-api03-..."
export GEMINI_API_KEY="AIzaSy..."
export OPENAI_API_KEY="sk-proj-..."
docker compose up -d
Alternatively, create a .env file in the same directory as your docker-compose.yml:
ANTHROPIC_API_KEY=sk-ant-api03-...
GEMINI_API_KEY=AIzaSy...
OPENAI_API_KEY=sk-proj-...
Never commit .env files containing API keys to version control. Add .env to your .gitignore file.
Configuration Reference​
| Parameter | Description |
|---|---|
aiAssistant.enabled | Enable AI Assistant features (Helm only) |
aiAssistant.anthropic.apiKey | Anthropic Claude API key |
aiAssistant.gemini.apiKey | Google Gemini API key |
aiAssistant.openai.apiKey | OpenAI API key |
Verify Configuration​
After deploying, you can verify the AI Assistant is enabled:
- Open the zymtrace UI in your browser
- Navigate to any flamegraph or performance view
- Look for the AI Assistant icon or panel
- Try asking a question about your performance data
Troubleshooting​
AI Assistant not appearing in UI​
- Verify
aiAssistant.enabledis set totrue(Helm deployments) - Check that at least one API key is configured
- Ensure you're using zymtrace backend version
25.12.0or later - Check the web service logs for any API key validation errors:
kubectl logs -l app=zymtrace-web -n zymtrace
API errors or rate limiting​
- Verify your API key is valid and has not expired
- Check your API provider's usage dashboard for rate limits
- Ensure your API key has the necessary permissions/scopes
Connection issues​
- If using a proxy, ensure the web service can reach the AI provider's API endpoints
- Check network policies if running in a restricted Kubernetes environment
Security Considerations​
- API keys are stored as Kubernetes Secrets when using Helm, providing encryption at rest (if enabled in your cluster)
- Rotate API keys periodically according to your organization's security policies
- Use separate API keys for development and production environments
- Monitor API usage through your provider's dashboard to detect any anomalies