iqtoolkit-analyzer

🚀 5-Minute Ollama Setup for IQToolkit Analyzer

Get Ollama running locally in 5 minutes for private AI analysis of your database logs.

Step 1: Install Ollama (2 minutes)

# macOS/Linux (one command)
curl -LsSf https://ollama.com/install.sh | sh

# Alternative: Download from https://ollama.com/download

Step 2: Start Ollama & Pull Model (2 minutes)

# Start the Ollama server
ollama serve

# In a new terminal, pull a model (specialized for SQL)
ollama pull a-kore/Arctic-Text2SQL-R1-7B

Why Arctic-Text2SQL-R1 7B? This model is specifically fine-tuned for SQL tasks, making it ideal for database query analysis and optimization recommendations.

Step 3: Configure Slow Query Doctor (1 minute)

Create .iqtoolkit-analyzer.yml in your project:

llm_provider: ollama
ollama_model: a-kore/Arctic-Text2SQL-R1-7B
top_n: 5
output: reports/report.md

Step 4: Test & Run

# Test Ollama setup
uv run python scripts/test_ollama.py

# Analyze your logs (no API key needed!)
uv run python -m iqtoolkit_analyzer your_postgresql.log

✅ Benefits

Troubleshooting

Model not found?

ollama list  # Check installed models
ollama pull a-kore/Arctic-Text2SQL-R1-7B  # Pull if missing

Connection refused?

ollama serve  # Make sure server is running

Need different model?

# Alternative SQL-focused models
ollama pull codellama     # General code analysis
ollama pull sqlcoder      # SQL-specific (if available)
ollama pull llama3.2        # General purpose fallback

# Update .iqtoolkit-analyzer.yml with your chosen model:
# ollama_model: your-model-name

🎯 Goal: Your database logs analyzed by AI in minutes, completely private and free.