Skip to content

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

Terminal
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.

Terminal
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:

Terminal
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.

Terminal
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:

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

LiteLLM or a gateway won't connect

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

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

# In LiteLLM, the model is usually declared like this:
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.

Model works but forgets earlier files or instructions? Check the context window Ollama actually loaded.

Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue