All configuration is sourced from the environment. Nothing is required for offline,
deterministic analysis — every setting has a safe default. Configuration is read once per process
and is dependency-light (no pydantic-settings requirement), so the core stays importable in
minimal environments.
| Variable | Default | Purpose |
|---|---|---|
DEVOPS_AI_PROVIDER |
null |
Active AI provider: null, anthropic, openai, gemini, ollama |
DEVOPS_AI_TIMEOUT |
60 |
Provider HTTP request timeout, in seconds |
DEVOPS_AI_MAX_CHARS |
200000 |
Max input characters analyzed (input is truncated above this) |
null is the offline default: the engine runs in pure deterministic mode and never calls out.
| Variable | Default | Purpose |
|---|---|---|
ANTHROPIC_API_KEY |
(unset) | Anthropic API key |
OPENAI_API_KEY |
(unset) | OpenAI API key |
GEMINI_API_KEY |
(unset) | Gemini API key (GOOGLE_API_KEY also accepted) |
OLLAMA_HOST |
http://localhost:11434 |
Ollama server base URL (local, no key) |
A provider is considered available only when its key (or, for Ollama, its host) is present. If you request enrichment without an available provider, the engine returns deterministic results and adds a low-severity warning — it never fails. See AI providers.
| Variable | Default |
|---|---|
DEVOPS_AI_ANTHROPIC_MODEL |
claude-sonnet-4-6 |
DEVOPS_AI_OPENAI_MODEL |
gpt-4o-mini |
OPENAI_BASE_URL |
https://api.openai.com/v1 |
DEVOPS_AI_GEMINI_MODEL |
gemini-2.0-flash |
DEVOPS_AI_OLLAMA_MODEL |
llama3.1 |
The OPENAI_BASE_URL override lets you point the OpenAI adapter at any OpenAI-compatible endpoint
(local gateways, proxies, alternative hosts).
For convenience these alternates are also recognized:
DEVOPS_AI_ANTHROPIC_KEY→ Anthropic keyDEVOPS_AI_OPENAI_KEY→ OpenAI keyDEVOPS_AI_GEMINI_KEY,GOOGLE_API_KEY→ Gemini key
Offline (default — nothing to set):
devops-ai analyze app.logAnthropic enrichment:
export DEVOPS_AI_PROVIDER=anthropic
export ANTHROPIC_API_KEY=sk-ant-...
export DEVOPS_AI_ANTHROPIC_MODEL=claude-sonnet-4-6 # optional override
devops-ai analyze app.log --enrichLocal, fully private LLM via Ollama:
export DEVOPS_AI_PROVIDER=ollama
export OLLAMA_HOST=http://localhost:11434
export DEVOPS_AI_OLLAMA_MODEL=llama3.1
devops-ai analyze app.log --enrichOpenAI-compatible gateway:
export DEVOPS_AI_PROVIDER=openai
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://my-gateway.internal/v1Tighten resource limits:
export DEVOPS_AI_MAX_CHARS=50000 # analyze at most 50k chars
export DEVOPS_AI_TIMEOUT=30 # 30s provider timeoutYou can bypass the environment entirely by constructing Settings and injecting them:
from devops_ai_toolkit import AnalysisEngine
from devops_ai_toolkit.utils.config import Settings
settings = Settings(provider="anthropic", anthropic_api_key="sk-ant-...", max_input_chars=50_000)
engine = AnalysisEngine(settings=settings)Settings.from_env() builds the same object from a dict of environment variables, which is useful
in tests. See the Testing guide.
- Explicit arguments (e.g. CLI
--provider, SDKprovider=/settings=) - Environment variables
- Built-in defaults (offline
nullprovider)
- AI providers — adapter details and how to add one
- Security — how keys are handled (read from env, sent only to the chosen provider)