Troubleshooting
Common issues and solutions for DSPy Code.
Installation Issues
Command Not Found
Solution:
Permission Denied
Solution:
pip install --user dspy-code
# Or use virtual environment
python -m venv venv
source venv/bin/activate
pip install dspy-code
Connection Issues
Model Not Connected
Solution:
Ollama Connection Failed
Solutions: 1. Start Ollama: ollama serve 2. Check Ollama is running: ollama list 3. Pull model: ollama pull llama3.1:8b
API Key Invalid
Solution:
Code Generation Issues
No Code Generated
Solutions: 1. Check model connection: /status 2. Reconnect: /connect ollama llama3.1:8b 3. Try simpler request 4. Check model is responding
Code Has Errors
Solution:
Optimization Issues
Not Enough Examples
Solution:
GEPA Fails
Solutions: 1. Check training data: /data validate 2. Ensure enough examples (50+ recommended) 3. Check model connection 4. Try with smaller dataset first
Index Issues
Index Build Failed
Solutions: 1. Check Python packages are readable 2. Run /refresh-index 3. Check permissions 4. Continue anyway (optional feature)
Index Stale
Solution:
Session Issues
Session Not Found
Solution:
Cannot Save Session
Solutions: 1. Check disk space 2. Check write permissions 3. Try different name
Performance Issues
Slow Response
Solutions: 1. Use a faster/cheaper model (for example gpt-5-nano vs gpt-4o) 2. Use local model (Ollama) 3. Reduce example count 4. Check internet connection
High Memory Usage
Solutions: 1. Reduce batch size in optimization 2. Use smaller model 3. Clear cache: rm -rf .cache/
Common Error Messages
"DSPy not found"
Solution:
"No code to save"
Solution: 1. Generate code first 2. Check /status to see context
"Validation failed"
See validation errors and fix:
Getting Help
If you can't find a solution:
- Check FAQ: FAQ
- GitHub Issues: Report Issue
- Check Status:
/statusto see current state - Debug Mode: Start with
dspy-code --debug
Debug Mode
For detailed error information:
Shows: - Full error traces - API calls - Internal state - Detailed logs