Open-Source Wikis

/

Ollama

/

Lore

ollama/ollama

Lore

The story of the ollama/ollama codebase. Dates are derived from git tags and commit timestamps. Where the why is uncertain, the language is hedged.

Eras

The wrapper era (Jun – Sep 2023)

The first commit landed on 2023-06-22 with the message initial commit, followed the next day by llama server wrapper and Exploratory client. The early shape of the project is visible in those messages: a Go process that wraps llama.cpp's server binary and exposes a friendlier interface. Versions in this period start at v0.0.1 and progress quickly through v0.0.x and into v0.1.x as the surface stabilizes.

The CLI built on cobra in cmd/cmd.go and the daemon in server/ date back to this era. The Modelfile DSL is also from this period — it's how the project originally let users assemble a model from base weights, a template, and parameters without becoming an OCI maintainer.

Scheduler and registry (late 2023 – 2024)

As multiple models needed to coexist on one machine, the scheduler in server/sched.go was added to track loaded runners, serialize loads, and evict on keep-alive. The model store grew into a full content-addressed layout under ~/.ollama/models/ with manifests in manifest/ and blobs uploaded through /api/blobs/:digest in server/routes.go.

/api/pull and /api/push (server/download.go, server/upload.go) made the registry on ollama.com first-class. The Go API client at api/client.go was published as part of the same module so external Go programs could call the daemon.

OpenAI compatibility (2024)

openai/openai.go and the middleware in middleware/openai.go added /v1/chat/completions, /v1/completions, /v1/embeddings, and /v1/models endpoints. This let the same daemon serve any tool already pointed at the OpenAI API.

A Go-native engine (2024 – 2025)

A second runner backend appeared: ollamarunner (runner/ollamarunner/) — a pure-Go inference loop with its own tensor abstractions in ml/ and model definitions in model/models/. Selectable via --ollama-engine, it began with a handful of architectures (gemma, llama, qwen) and now lives alongside model-specific renderers in model/renderers/ and parsers in model/parsers/.

The harmony (harmony/) and thinking (thinking/) packages came in as model families adopted structured prompt/response formats and reasoning tokens. tools/ followed as function-calling became a routine feature.

Cloud and broader compatibility (2025)

server/cloud_proxy.go added a passthrough that lets the local daemon serve cloud-only models from ollama.com. The Anthropic Messages API gained its own translation in anthropic/anthropic.go and middleware in middleware/anthropic.go. /v1/responses, /v1/images/generations, /v1/images/edits, and /v1/audio/transcriptions followed in openai/responses.go and middleware/openai.go.

Web search and web fetch landed as POST /api/experimental/web_search and POST /api/experimental/web_fetch (handlers in server/routes.go) — both forwarded through the cloud proxy.

The launcher era (late 2025 – 2026)

ollama launch arrived under cmd/launch/ and reshaped the front door of the project. Instead of (or in addition to) running models in a TTY, users can now ollama launch claude or ollama launch droid and have the integration configured for them. A bubbletea TUI in cmd/tui/ replaced raw terminal I/O for selectors and sign-in.

By the most recent commits, integrations exist for Claude Code, Codex, Copilot CLI, Droid, OpenCode, Hermes, Kimi, Pi, Poolside, Cline, VS Code, and OpenClaw. Recent commit titles such as launch: harden OpenClaw onboarding flow and launch: keep launch recommended models in a fixed canonical order suggest active polishing of this surface.

The desktop app under app/ was reworked in parallel — app: align the app launch page with ollama launch (#15753) from late April 2026 is one of several commits unifying the desktop experience with the CLI's launcher.

Longest-standing features

  • The Modelfile — the parser at parser/parser.go implements the original DSL from 2023 and still carries deprecated parameters (mirostat, low_vram, f16_kv, vocab_only, use_mlock, penalize_newline) listed at the top of the file. The DSL has gained directives but never broke compatibility with older Modelfiles.
  • The /api/generate and /api/chat shape — the JSON contracts in api/types.go have grown but maintained backward compatibility, in line with CONTRIBUTING.md: "Changes that break backwards compatibility in Ollama's API … may not be accepted."
  • The cobra CLIserve, run, pull, push, list, show, cp, rm have been the public CLI surface since the early days.

Deprecated features

  • Mirostat / low_vram / f16_kv / vocab_only / use_mlock / penalize_newline — listed as deprecatedParameters in parser/parser.go and ignored by the create flow. They date back to llama.cpp's earlier sampling and memory parameters that Ollama no longer exposes.
  • use_imagegen_runner — explicitly deleted from request options in server/routes.go (scheduleRunner). It was a transitional flag between the legacy and new image-generation paths.
  • mllama projector path for llama3.2-visionscheduleRunner returns an error directing users to re-pull the model. The format changed and old downloads are no longer compatible.

Major rewrites

  • From "wrapper" to engine — adding ollamarunner (runner/ollamarunner/) was effectively a parallel runtime. Rather than replacing llama.cpp, the project kept both and let users opt in via --ollama-engine.
  • Selectors moved to bubbletea — the init() block at the top of cmd/cmd.go overrides every launch.Default*Selector with the bubbletea implementations in cmd/tui/. Earlier versions used raw terminal I/O.
  • Server routes table — additions to server/routes.go introduced the OpenAI compat layer, the Anthropic compat layer, web search/fetch, image generation, and /v1/responses. Each addition is wrapped in middleware (middleware/) so the underlying handlers stay close to a single shape.

Growth trajectory

  • 2023-06: project starts (initial commit).
  • 2023 H2: registry, scheduler, Modelfile reach maturity.
  • 2024: OpenAI compat, Go API client, large language coverage in convert/.
  • 2025: cloud proxy, Anthropic compat, native Go runner expands, web search/fetch arrive as experimental endpoints.
  • 2025–2026: launcher era; bubbletea TUI; desktop app convergence with ollama launch.
  • By 2026-04: ~600 unique committers in history, ~100 commits/month, and the repo's biggest active surface is cmd/launch/ (largest test files in that directory rival the server's own).

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Lore – Ollama wiki | Factory