跳到主要内容
On this page

ReferencesThe Local Model Runner

Ollama

Run a large language model on your own machine, behind one HTTP API.

Ollama at a glance

Role
The Local Model Runner
Domain
AI & Agents
Status
v0.12.6
What it does
  • One command to fetch and run a model — `ollama pull`, then `ollama run`.
  • A local HTTP API on port 11434, with `/api/generate` and `/api/chat` endpoints.
  • An OpenAI-compatible surface at `/v1`, so existing clients need almost no changes.
  • Cloud models alongside local ones, behind the same endpoints.
  • Model management — pull, list, copy and delete — through the same API.

What it is

Ollama removes the two chores that make running a model on your own machine annoying: the dependency graph and the serving layer. You install one binary, name a model, and it is running.

The model library is a registry of tagged builds — `llama3.2`, `mistral`, `gemma4` and so on — each of which bundles the weights with everything needed to run them. That is what makes the same call work against a local server and against Ollama's hosted models.

How it works

The local server binds to 127.0.0.1 on port 11434 by default; `OLLAMA_HOST` moves it. Requests are ordinary HTTP and JSON, and the API is deliberately not versioned — it is expected to stay backwards compatible instead.

  • `/api/generate` and `/api/chat` are the Ollama-native endpoints; `/v1` is the OpenAI-compatible surface, and an Anthropic client can point its base URL at the same server.
  • Cloud requests need an API key; local requests do not — the same code can fall through to a local model when the network is gone.
  • The server can be run as a container, which is the usual way to reach it from another machine.
  • A model can be preloaded by sending an empty request, so the first real prompt does not pay for the load.

Under the hood

PieceWhat it is
Default endpointhttp://localhost:11434 — bound to loopback unless OLLAMA_HOST says otherwise
Native API/api/generate, /api/chat, /api/version, /api/tags
Compatible API/v1 — OpenAI-shaped; an Anthropic client can use the same base URL
VersioningNot strictly versioned; stability is the contract
HostingLocal server, or the same container image on another host

Where to read more