You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setup-llm.sh installs everything automatically — Ollama, the model, and the .env file:
chmod +x setup-llm.sh start.sh
# Option A — Ollama (100% local, free, no API key)
./setup-llm.sh
# Option B — Groq (free cloud, fast, no credit card)
./setup-llm.sh --provider groq
# Option C — OpenAI (requires billing credits)
./setup-llm.sh --provider openai
# Use a different model
./setup-llm.sh --model mistral
Provider
Cost
Privacy
Speed
Requires
Ollama (default)
Free
100% local
~2–5 s/call
Ollama installed locally
Groq
Free tier
Cloud
~0.5 s/call
Free API key at console.groq.com
OpenAI
Paid
Cloud
~1 s/call
API key + billing credits
What setup-llm.sh does automatically:
Installs Ollama via brew (macOS) or curl installer (Linux) if missing
Starts the Ollama server in the background
Pulls the configured model (llama3.2 by default)
Writes .env with the chosen provider/model/keys
Rebuilds and restarts the backend container
Verifies HolmesGPT is live via /api/ai/analyze
3. Start all services
./start.sh
start.sh is fully automatic — on first run it calls setup-llm.sh if .env is missing. On subsequent runs it just checks Ollama is still running and starts the stack.
All LLM settings live in .env (auto-generated by setup-llm.sh, never commit this file):
# ── Active provider ────────────────────────────────────────────────────────LLM_PROVIDER=ollama# ollama | groq | openaiHOLMES_MODEL=llama3.2# model name for the active provider# ── Ollama (local) ─────────────────────────────────────────────────────────OLLAMA_HOST=http://host.docker.internal:11434# ── Groq (free cloud) ──────────────────────────────────────────────────────GROQ_API_KEY=gsk_your_key_here# ── OpenAI ─────────────────────────────────────────────────────────────────OPENAI_API_KEY=sk-your_key_here
To switch provider at any time:
./setup-llm.sh --provider groq # rewrites .env and restarts backend
How HolmesGPT works
ai_agent.py contains two detection layers that run in priority order:
Layer
Class
When active
1 — HolmesGPT
HolmesGPTAnalyzer
LLM reachable and responds with valid JSON
2 — Rule-based
RuleBasedDetector
LLM unavailable, quota exceeded, or call fails
HolmesGPT sends the full metrics snapshot to the LLM with a structured system prompt and returns:
reasoning — one-sentence LLM explanation per anomaly
severity — grounded in domain thresholds (critical/high/medium/low)
insights — 4–6 emoji-prefixed fleet insights for the on-call engineer
engine — e.g. HolmesGPT/ollama (llama3.2)
RuleBasedDetector uses explicit thresholds (no ML required):
Metric
Warning
High
Critical
CPU %
>70%
>80%
>90%
Memory (MB)
>400
—
>480
Error rate %
>1%
>5%
>10%
Latency p99 (ms)
>500
>1000
>2000
Service up flag
—
—
0.0 (down)
Local Development (without Docker)
Backend
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Point at a local or remote VictoriaMetricsexport VM_URL=http://localhost:8428
export REDIS_HOST=localhost
export REDIS_PORT=6380
export LOKI_URL=http://localhost:3100
uvicorn main:app --reload --port 8001
Frontend
cd frontend
npm install
# Point at local backendecho"NEXT_PUBLIC_API_URL=http://localhost:8001"> .env.local
npm run dev # dev server at http://localhost:3000
Important: After editing frontend/app/page.tsx, the Docker image must be rebuilt (not just restarted) because Next.js compiles at build time:
Run anomaly detection, returns health score + anomaly list
Clusters & Services
Method
Endpoint
Description
GET
/api/clusters
List all clusters with status
GET
/api/services/all
List all services
Holmes (RCA)
Method
Endpoint
Description
POST
/api/holmes/investigate
Start a new investigation
GET
/api/holmes/investigations
List all investigations
GET
/api/holmes/investigations/{id}
Get investigation detail
Robusta (Playbooks)
Method
Endpoint
Description
GET
/api/robusta/playbooks
List registered playbooks
GET
/api/robusta/runs
Run history
POST
/api/robusta/event
Trigger playbook from event
Traces
Method
Endpoint
Description
GET
/api/traces
Fetch traces from Jaeger
GET
/api/traces/services
List traced services
Webhooks
Method
Endpoint
Description
POST
/webhook/alerts
Alertmanager → backend
POST
/webhook/robusta
Alertmanager → Robusta playbooks
Streaming
Protocol
Endpoint
Description
WebSocket
/ws/live-metrics
Real-time metrics push
Troubleshooting
HolmesGPT not active (falls back to rule-based)
# Check which engine is running
curl -s http://localhost:8001/api/ai/analyze | python3 -c "import json,sys; d=json.load(sys.stdin); print(d.get('engine'))"# Check backend logs for LLM errors
docker logs visibility-api 2>&1| grep -i holmesgpt
# Ollama: verify server is running and model is pulled
curl http://localhost:11434/api/tags
ollama list
ollama pull llama3.2
# Groq/OpenAI: verify API key is set in .env
grep 'GROQ_API_KEY\|OPENAI_API_KEY' .env
Re-run LLM setup (change provider or fix broken install)
./setup-llm.sh # reset to Ollama (default)
./setup-llm.sh --provider groq # switch to Groq
./setup-llm.sh --provider openai # switch to OpenAI
Ollama not starting
# Check the Ollama log
cat /tmp/ollama.log
# Start manually
ollama serve &# Verify it's up
curl http://localhost:11434/api/tags
Frontend not updating after code changes
# Must rebuild — Next.js compiles at Docker image build time
docker compose up -d --build frontend
Frontend crash-loops (ENOENT: .next/BUILD_ID)
# Stale cache — force full no-cache rebuild
docker compose build --no-cache frontend
docker compose up -d frontend