AI Query Generation
Logchef turns natural-language questions into queries for whichever datasource and editor mode you are using. It generates LogchefQL in the shared builder, ClickHouse SQL in ClickHouse native mode, and LogsQL in VictoriaLogs native mode. The assistant is schema-aware: it sees the selected source’s columns or discovered fields and types.
- Open any log source
- Click the AI assistant button (wand icon) in the query editor
- Describe what you want in plain English
- Review the generated query, then insert it into the editor
If you already have a query in the editor, the AI uses it as context for refinements. Logchef validates the generated query for the active target and makes one repair attempt when it can identify a syntax error.
Example Queries
Section titled “Example Queries”"Show error logs from the last 6 hours""Count logs by severity for today""Find logs containing 'connection refused' from the payments service""Top 10 most frequent error messages this week""Logs where trace_id = 'abc123'"Configuration
Section titled “Configuration”Configure via Administration → System Settings → AI:
| Setting | Description | Default |
|---|---|---|
| Enabled | Toggle AI features | true |
| Provider | openai or native bedrock transport |
openai |
| API Key | Your OpenAI API key | — |
| Base URL | API endpoint | https://api.openai.com/v1 |
| Region | AWS region when using Bedrock | — |
| Model | Model name | gpt-4o |
| Max Tokens | Max tokens to generate | 1024 |
| Temperature | Randomness (0.0–1.0) | 0.1 |
Supported Providers
Section titled “Supported Providers”Use an OpenAI-compatible API or AWS Bedrock:
| Provider | Base URL |
|---|---|
| OpenAI | https://api.openai.com/v1 (default) |
| OpenRouter | https://openrouter.ai/api/v1 |
| Azure OpenAI | Your Azure endpoint |
| Local models | Your local server URL |
| AWS Bedrock | Native Converse API using the standard AWS credential chain |
Environment Variables
Section titled “Environment Variables”For containerized deployments, seed the initial config via env vars:
export LOGCHEF_AI__ENABLED=trueexport LOGCHEF_AI__PROVIDER=openaiexport LOGCHEF_AI__API_KEY="sk-your-key"export LOGCHEF_AI__MODEL="gpt-4o"For Bedrock, set LOGCHEF_AI__PROVIDER=bedrock,
LOGCHEF_AI__REGION, and a Bedrock model ID or inference-profile ARN. Logchef
uses the normal AWS credential chain, so no API key is stored.
After first boot, the Admin UI takes precedence over env vars.
MCP Integration
Section titled “MCP Integration”For AI assistant integration outside the web UI (e.g., Claude Desktop), see MCP Server.
Limitations
Section titled “Limitations”Always review AI-generated queries before running them. The model can get complex aggregations or unfamiliar schemas wrong, so start with simple questions and iterate from there.