ollama_troubleshooting.md
1 # Ollama / LLM Troubleshooting 2 3 Common Ollama and LLM troubleshooting steps for ECHO. 4 5 ## Ollama Not Running 6 7 **Symptom:** `Connection refused` or `Failed to get response from Ollama` 8 9 **Solution:** 10 ```bash 11 # Check if Ollama is running 12 curl http://localhost:11434/api/tags 13 14 # If not running (Docker): 15 docker ps | grep ollama 16 docker start ollama 17 18 # If not running (systemd): 19 systemctl status ollama 20 systemctl start ollama 21 ``` 22 23 ## Model Not Found 24 25 **Symptom:** `Error: model qwen2.5:14b not found` 26 27 **Solution:** 28 ```bash 29 # List installed models 30 ollama list 31 32 # Pull missing model 33 ollama pull qwen2.5:14b 34 35 # Or install all ECHO models 36 ./setup_llms.sh 37 ``` 38 39 ## Slow Responses / Timeouts 40 41 **Symptom:** LLM queries take >60 seconds or timeout 42 43 **Possible Causes:** 44 - CPU bottleneck (other processes using CPU) 45 - Memory pressure (not enough RAM for model) 46 - Model too large for hardware 47 48 **Solutions:** 49 ```bash 50 # Check system resources 51 top # Linux 52 Activity Monitor # macOS 53 54 # Use smaller model (if applicable) 55 export CEO_MODEL=qwen2.5:7b # Instead of 14b 56 57 # Increase timeout 58 export LLM_TIMEOUT=300 # 5 minutes 59 60 # Restart Ollama 61 docker restart ollama # If using Docker 62 ``` 63 64 ## Model Inference Errors 65 66 **Symptom:** `(RuntimeError) model inference failed` 67 68 **Debug:** 69 ```bash 70 # Test Ollama directly 71 curl http://localhost:11434/api/generate -d '{ 72 "model": "qwen2.5:14b", 73 "prompt": "Hello, world!", 74 "stream": false 75 }' 76 77 # Check Ollama logs 78 docker logs ollama # If using Docker 79 journalctl -u ollama -f # If using systemd 80 ``` 81 82 ## Out of Memory 83 84 **Symptom:** `Out of memory` or Ollama crashes 85 86 **Solution:** 87 ```bash 88 # Check available memory 89 free -h # Linux 90 vm_stat # macOS 91 92 # Unload unused models 93 ollama unload qwen2.5:14b 94 95 # Use smaller models 96 # See benchmark_models/claude.md for model comparison 97 ``` 98 99 ## GPU Issues 100 101 **Symptom:** `CUDA error` or `GPU not found` 102 103 **Solution:** 104 ```bash 105 # Check GPU availability 106 nvidia-smi # NVIDIA GPUs 107 108 # Verify Ollama GPU support 109 docker run --gpus all ollama/ollama:latest nvidia-smi 110 111 # Force CPU mode (if GPU unavailable) 112 export OLLAMA_GPU=false 113 ``` 114 115 **Used in:** 116 - CLAUDE.md (troubleshooting section) 117 - apps/claude.md (agent development) 118 - scripts/claude.md (LocalCode troubleshooting) 119 - benchmark_models/claude.md