Aulafy

Fix Ollama Errors

Most local AI failures aren't mysterious: the service is off, the model name is misspelled, the port is wrong, you're out of memory, or your expectations exceed your hardware. This guide gives you a quick diagnosis before you waste the afternoon.

  • Diagnose whether Ollama is installed, running, and accessible.
  • Fix common errors when connecting apps, Claude Code, or gateways.
  • Adjust the model and workflow when your machine falls short.

60-Second Diagnosis

TerminalCode
ollama --version
ollama list
ollama ps
curl http://localhost:11434/api/tags

Error: connection refused

It means your program is calling localhost:11434, but nothing is listening.

TerminalCode
ollama serve

On macOS and Windows, Ollama usually starts as a desktop app. If you closed the app, open it again. On Linux, check the service:

TerminalCode
systemctl status ollama
sudo systemctl restart ollama

Error: model not found

The name you're using in your app doesn't match the installed model.

TerminalCode
ollama list
ollama pull qwen3:4b

Ollama responds very slowly

  • Switch to a smaller model: 1B, 3B, or 4B.
  • Close heavy apps before launching the model.
  • Reduce context and input documents.
  • Use the hybrid workflow: Claude Code for building, Ollama for processing private or repetitive data.

The app works in the terminal, but not from Docker

Inside a container, localhost points to the container, not your computer. Try Docker's host:

TerminalCode
http://host.docker.internal:11434

LiteLLM or a gateway won't connect

First test Ollama directly. Then check the gateway configuration file.

TerminalCode
curl http://localhost:11434/api/tags

# En LiteLLM, el modelo suele declararse así:
model: ollama/qwen3:4b
api_base: http://localhost:11434

Final checklist

  • The ollama --version command works.
  • ollama list shows the exact model.
  • curl /api/tags responds.
  • Your app points to http://localhost:11434 or the correct host if it uses Docker.
  • The model fits in your RAM without locking up your machine.