SparkGen Debug
Diagnose and troubleshoot issues. Default is general which runs all checks.
Dynamic Context
Always gather this state first:
- •Check server:
curl -sf http://localhost:8000/health - •Check Ollama:
curl -sf http://localhost:11434/api/tags - •Check Docker:
docker info 2>/dev/null && docker compose ps 2>/dev/null - •Read current
.envif exists for DEPLOYMENT_MODE and LLM_PROVIDER
Diagnostic Topics
Ollama (/sparkgen-debug ollama)
- •Check Ollama running:
curl -sf http://localhost:11434/api/tags - •List models:
ollama list - •Verify model matches
.env.localOLLAMA_MODEL (must include tag, e.g.,llama3.2:3b) - •Test model:
curl -s http://localhost:11434/api/generate -d '{"model":"<model>","prompt":"hi","stream":false}' - •Check Ollama logs:
cat ~/.ollama/logs/server.log | tail -50(macOS)
Docker (/sparkgen-debug docker)
- •Check Docker daemon:
docker info - •Check running containers:
docker compose ps - •Check agent logs:
docker compose logs --tail=50 agent - •Check DynamoDB Local:
curl -sf http://localhost:8000/shell/ - •Check Redis:
redis-cli -h localhost ping - •Check port conflicts:
lsof -i :8000 -i :8080 -i :6379 -i :11434
AWS (/sparkgen-debug aws)
- •Check credentials:
aws sts get-caller-identity - •Check region:
aws configure get region - •Test Bedrock access:
aws bedrock list-foundation-models --max-results 1 - •Check DynamoDB tables:
aws dynamodb list-tables - •Check S3 buckets:
aws s3 ls | grep <project_prefix>
Endpoint (/sparkgen-debug endpoint)
- •Health:
GET /health - •Agents:
GET /v1/agents - •Tools:
GET /v1/tools - •Workflow:
GET /v1/workflow - •Guardrails:
GET /v1/guardrails - •Prompts:
GET /v1/prompts - •Chat:
POST /v1/chatwith test message For each, report status code and whether response is valid JSON.
Guardrail (/sparkgen-debug guardrail)
- •Check guardrails endpoint:
GET /v1/guardrails - •Validate rules file:
python -m app.guardrails.test_runner --defaults guardrails/default_guardrails.yaml - •Test guardrail:
POST /v1/guardrails/testwith sample input - •Check for YAML syntax errors in
guardrails/default_guardrails.yaml
RAG (/sparkgen-debug rag)
- •Check RAG config: read
config/rag.yaml - •Check knowledge bases:
GET /v1/rag/knowledge-bases - •Check documents directory exists and has files:
ls documents/ - •Check vector index exists:
ls local_data/vectors/ - •Test query:
POST /v1/rag/querywith simple question - •Check embedding provider is available
General (/sparkgen-debug general or /sparkgen-debug)
Run ALL checks above. Output a health dashboard:
code
=== SparkGen Health Dashboard === Server: [OK|FAIL] http://localhost:8000 Ollama: [OK|FAIL|N/A] http://localhost:11434 Docker: [OK|FAIL|N/A] Env File: [OK|MISSING] .env → DEPLOYMENT_MODE=<mode> Endpoints: [OK|FAIL] <N>/7 responding Guardrails: [OK|FAIL|DISABLED] RAG: [OK|FAIL|DISABLED] Tests: <last run status if available>