What Is Ollama

Ollama is a local LLM runtime developed by a San Francisco startup. It packages model downloading, quantization, and inference into a single command.

No Python scripts, no CUDA version management, no manual weight downloads. It handles everything.

Quick Start

curl -fsSL https://ollama.com/install.sh | sh
ollama run llama3.2        # 3B, ~2GB
ollama run qwen2.5:7b      # better Chinese support

REST API

Ollama exposes an OpenAI-compatible API on localhost:11434:

curl http://localhost:11434/api/generate -d '{
  "model": "qwen2.5:7b",
  "prompt": "Explain Transformer Self-Attention",
  "stream": false
}'

Custom Modelfile

FROM qwen2.5:7b
SYSTEM "You are an AI technical writing assistant."
PARAMETER temperature 0.7
ollama create ai-writer -f Modelfile
ollama run ai-writer
ModelSizeStrength
llama3.2:3b2GBLightweight general use
qwen2.5:7b4.5GBBest Chinese support
mistral:7b4.1GBSmooth English prose
deepseek-r1:7b4.7GBStrong reasoning

For performance optimization, see LLM Inference Optimization.