Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

CQLAI AI Providers

Configure AI providers for natural language query generation in CQLAI.

ProviderModelsBest For
OpenAIGPT-4, GPT-4 Turbo, GPT-3.5 TurboBest accuracy
AnthropicClaude 3 Opus, Sonnet, HaikuComplex reasoning
Azure OpenAIGPT-4, GPT-3.5Enterprise compliance
AWS BedrockClaude, TitanAWS integration
Google Vertex AIGemini ProGoogle Cloud
OllamaLlama 3, Mixtral, etc.Local/private
OpenAI-compatibleVariousCustom endpoints
Terminal window
# Environment variable
export CQLAI_AI_PROVIDER=openai
export CQLAI_AI_KEY=sk-...
# Or command line
cqlai --ai-provider openai --ai-key sk-...
~/.cqlai/config.yaml
ai:
provider: openai
model: gpt-4-turbo
# key from CQLAI_AI_KEY environment variable
options:
temperature: 0.1
max_tokens: 1000
ModelSpeedAccuracyCost
gpt-4-turboFastHighest$$$$
gpt-4SlowHighest$$$$
gpt-3.5-turboFastestGood$
Terminal window
export CQLAI_AI_PROVIDER=anthropic
export CQLAI_AI_KEY=sk-ant-...
ai:
provider: anthropic
model: claude-3-sonnet-20240229
options:
temperature: 0.1
max_tokens: 1000
ModelSpeedAccuracyCost
claude-3-opusSlowHighest$$$$
claude-3-sonnetFastHigh$$
claude-3-haikuFastestGood$
Terminal window
export CQLAI_AI_PROVIDER=azure
export CQLAI_AI_KEY=your-azure-key
export CQLAI_AZURE_ENDPOINT=https://your-resource.openai.azure.com
export CQLAI_AZURE_DEPLOYMENT=your-deployment-name
ai:
provider: azure
azure:
endpoint: https://your-resource.openai.azure.com
deployment: gpt-4-deployment
api_version: "2024-02-15-preview"
Terminal window
export CQLAI_AI_PROVIDER=bedrock
export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
ai:
provider: bedrock
model: anthropic.claude-3-sonnet-20240229-v1:0
bedrock:
region: us-east-1
Terminal window
export CQLAI_AI_PROVIDER=vertex
export GOOGLE_CLOUD_PROJECT=your-project
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
ai:
provider: vertex
model: gemini-pro
vertex:
project: your-project
location: us-central1

Run AI models locally without cloud dependencies.

Terminal window
# Linux
curl -fsSL https://ollama.com/install.sh | sh
# macOS
brew install ollama
# Start Ollama
ollama serve
Terminal window
# Recommended for CQL generation
ollama pull llama3
ollama pull codellama
ollama pull mixtral
Terminal window
export CQLAI_AI_PROVIDER=ollama
export CQLAI_OLLAMA_HOST=http://localhost:11434
ai:
provider: ollama
model: llama3
ollama:
host: http://localhost:11434
ModelParametersRAMBest For
llama38B8GBGeneral use
codellama7B8GBCode generation
mixtral8x7B48GBComplex queries

Use any OpenAI-compatible API endpoint.

ai:
provider: openai-compatible
model: your-model
openai_compatible:
endpoint: https://your-api.example.com/v1
api_key_env: YOUR_API_KEY_VAR
Accuracy: Claude 3 Opus ≈ GPT-4 > GPT-4 Turbo > Claude Sonnet > GPT-3.5
Speed: GPT-3.5 > Claude Haiku > GPT-4 Turbo > Claude Sonnet > GPT-4
Cost: Ollama (free) < GPT-3.5 < Claude Haiku < Sonnet < GPT-4
Privacy: Ollama (local) > Azure (enterprise) > Cloud providers
Use CaseRecommended Provider
DevelopmentOllama (free, local)
Production (accuracy)OpenAI GPT-4 or Claude Opus
Production (cost)Claude Haiku or GPT-3.5
Enterprise/ComplianceAzure OpenAI
AWS EnvironmentAWS Bedrock
Privacy-criticalOllama (local)
ai:
provider: openai
model: gpt-4-turbo
options:
# Lower = more deterministic (recommended for CQL)
temperature: 0.1
# Maximum response length
max_tokens: 1000
# Include table schemas in context
include_schema: true
# Number of schema tables to include
schema_context_limit: 10
# Retry failed requests
retry_count: 3
retry_delay: 1s
ai:
context:
# Always include current keyspace schema
include_current_keyspace: true
# Include table statistics for optimization hints
include_statistics: true
# Maximum schema size to send
max_schema_size: 50000
  1. Never commit API keys - Use environment variables
  2. Use Azure/Bedrock for enterprise - Better compliance
  3. Consider Ollama - No data leaves your network
  4. Rotate keys regularly - Set up key rotation
  5. Monitor usage - Track API costs and calls
Terminal window
# Secure key storage
# Store in environment, not config file
export CQLAI_AI_KEY=$(cat ~/.secrets/openai_key)
Error: Invalid API key
Solutions:
1. Verify key is correct
2. Check key permissions
3. Ensure key is not expired
4. Verify environment variable is set
Error: Rate limit exceeded
Solutions:
1. Use a model with higher limits
2. Add retry configuration
3. Implement request caching
4. Upgrade API plan
Error: Connection refused
Solutions:
1. Ensure Ollama is running: ollama serve
2. Check port: http://localhost:11434
3. Verify model is pulled: ollama list