This is a fork of ollama/ollama
Everything below this banner is upstream's README, describing upstream's work. Ollama is theirs; this fork only adds to it, and tries to add as little as possible.
It tracks upstream releases and carries a narrow set of changes:
- Vision-model correctness. Image token budgets and native-aspect dynamic resolution for gemma4 and nemotron, and an fp32-accumulation gate for qwen2.5-vl that closes an fp16 overflow in the vision tower — a few elements in millions reach
infon CUDA and the caption collapses into a repeated glyph. Offered upstream as ollama#18070.- A vision regression suite. A preflight harness with recorded per-model expectations, generated (public, no-download) trigger images, and env-gated node-level instrumentation, run against every build before it deploys.
- Fixes carried until upstream takes them, each tracked against an upstream issue or PR, and deleted from here when it lands there — the retirement register lists every carried item, what retires it, and the test that gates its deletion.
- An experimental MLX runtime for Apple Silicon and CUDA — see the caveats below before using it for anything that matters.
Current fold:
v0.34.1-dynres— upstream v0.34.1, llama.cppb10864, MLXd9add9d1.mainmoves ahead of this between folds; the tag is the fixed point to build and roll back to. Deployed:mainat16649e8, stamped0.34.1-dynres-16-g16649e8, on the CUDA host since 2026-09-18 22:30 — the tag's native payload with a Go-only rebuild that adds ADR 0036 (a gemma4 vision runner starts from the batch rung holding its image ceiling), withOLLAMA_MLX_DRAFT_UNDER_GRAMMAR=0on the container (ADR 0033; see the fold's memory finding indocs/maxusai/tasks/upstream-sync-0.34.1.md). The matrix below is the tag's full preflight run; the rebuild changes no native input, and its verification on production is in the task doc's deploy section. On the Apple Silicon host the same commit has served the mlx-metal surface on:11435since 2026-09-18, stamped0.34.0-maxusai-8a7ba949— the same build as0.34.1-dynres-0-g8a7ba94(ADR 0032, 2026-09-19 amendment) — and was promoted on 2026-09-19 with the MLX #3912 kernel fix kept (ADR 0037), withOLLAMA_MLX_DRAFT_UNDER_GRAMMAR=0in its launchd environment as on the CUDA container. The AMD/gfx1151 host joined on 2026-09-19 18:55, stamped0.34.1-dynres-16649e8cfrom a fullFLAVOR=rocmbuild of the same commit, when the upgrade gate lifted — it had held that host on 0.32.1 since 2026-07-31, and all three platforms now serve one commit. That build must carryllama/compat/906-revert-hip-integrated-flag.patch: llama.cpp b10864 misses upstream's HIP revert by 78 minutes, and without it vision output on gfx1151 is silently wrong — no crash, no warning, unchanged token counts.
Fork builds are stamped
<upstream-version>-dynres-<n>-g<sha>;dynresnames the change that started the fork, not the company that runs it. Fork-specific documentation, ADRs and measurements live indocs/maxusai/.
| surface | Build identity | Image size ladder | Pinned image budget | thinking on/off | Output quality | fp16 overflow canary | Runner isolation | measured on |
|---|---|---|---|---|---|---|---|---|
| cuda | green | green | green | green | skipped | green | green | 0.34.1-dynres-0-g8a7ba94 |
| mlx-cuda | not run | not run | not run | not run | not run | not run | not run | — |
| mlx-metal | skipped | green | skipped | green | not run | skipped | green | 0.34.0-maxusai-8a7ba949 |
| apple-silicon-mlx | not run | not run | not run | not run | not run | not run | not run | — |
| rocm | not run | not run | not run | not run | not run | not run | not run | — |
| cpu | not run | not run | not run | not run | not run | not run | not run | — |
Generated by release_matrix.py from recorded preflight runs. A surface with no run for this release reads not run — absence is shown, never assumed green. A group is reported at its weakest check, so one skipped probe does not read as a pass.
cuda here is the deployed serving surface. apple-silicon-mlx is the
deprecated alias for mlx-metal and will disappear from the generator with it.
Measured against upstream ollama v0.34.1 at llama.cpp b10864. Every row is a
capability the fork has and upstream does not; the record column is where the
decision and its measurements live (docs/maxusai/).
Vision correctness on the llama.cpp path — the deployed engine
| upstream ollama | this fork | record | |
|---|---|---|---|
| nemotron-3 vision | fixed 512×512 canvas — 256 tokens per image, whatever the aspect ratio | native-aspect dynamic resolution, 256–3,328 tokens, position embeddings interpolated to the patch grid in-graph | patch 002, ADR 0001 |
| gemma4 image budget | default limits 70–1,120 tokens (40–280 before b10864); an under-budget image keeps its natural rounded grid and is letterbox-padded | every image scaled to fill the requested budget and snapped to gemma4's supported ladder (70/140/280/560/1120), never padded — off-ladder grids measurably break box_2d vertical grounding. The budget is a per-request option (image_min_tokens/image_max_tokens, defaults 70/1120) and the scheduler reloads when the resolved flags change. Upstream has since adopted the same default limits; the fill is still fork-only |
patch 004, ADR 0003/0008/0016 |
| qwen2.5-vl on CUDA | f16 vision matmuls accumulate in fp16; on some ordinary images a few elements of millions reach inf at v.blk.31.ffn_down and the caption collapses into one repeated glyph |
fp32 accumulation forced for every qwen25vl runner, keyed on the GGUF architecture. Offered upstream as ollama#18070 |
llm/llama_server.go |
| MoE + MMQ on CUDA | ids-path tail padding sized from ne11; under broadcast ne11 == 1, so the buffer gets no padding and the kernel overruns by up to a 512-row tile |
padding sized from the flattened row count. Reported as llama.cpp#27044 | patch 903 |
| transparent images | pixels as decoded | composited over white before the resize, matching the mlx-vlm reference | ADR 0015 |
Structured output and generation control
| upstream ollama | this fork | record | |
|---|---|---|---|
think + format in one request |
defers the grammar until the thinking→content transition and folds pass-one metrics into the final response | the same, plus: a model with a known think-close marker stops pass one exactly there and continues textually, so runaway thinking cannot burn the budget; pass-one metrics are reconstructed when a runner does not report them; the second pass is pinned to pass one's truncation window | ADR 0002/0004/0010 |
| drafting under a grammar (MLX) | always on | on by default to match upstream; OLLAMA_MLX_DRAFT_UNDER_GRAMMAR=0 restores the gate |
ADR 0033 |
| stop sequences (MLX) | not honoured by the MLX runner | honoured, with a possible stop prefix held back until it matches or the stream ends | mlxrunner/stopper.go |
| KV cache type | one global OLLAMA_KV_CACHE_TYPE |
per model, with K/V pair syntax and a policy for reasoning models | ADR 0005 |
Serving and scheduling
| upstream ollama | this fork | record | |
|---|---|---|---|
| MLX admission | weights against free device memory (and, since v0.34.1, a system-memory bound on integrated GPUs) | weights + KV priced at the requested num_ctx + a per-architecture headroom; an explicit rung that does not fit is refused, an automatic one is clamped |
ADR 0034 |
| MLX memory ceiling | none | OLLAMA_MLX_MEMORY_LIMIT and a cache limit, set per runner from the admitted budget |
runner knobs |
| nvfp4 global scales | — | held in MLX's m × 2688 representation and divided back out by every wrapper that applies the scale itself, which is not the identity in float32 (17 of 31b's 191 vision scales move one ulp) |
ADR 0039 (proposed) |
| model identity in a record | a tag | the manifest digest: the library re-published gemma4:*-nvfp4 with bf16 vision towers under unchanged tags and config blobs |
ADR 0038 (proposed) |
| gemma4 image chunk vs. generation batch (GGUF) | the batch follows num_ctx (1024 above 4096), so a top-rung gemma4 image (up to 1120 tokens) is decoded in two pieces, bidirectional only within each |
a gemma4 vision runner starts from the batch rung that holds its image ceiling (2048 at 1120) and steps down only when it does not fit | ADR 0036 |
| gemma4 on MLX | upstream's own vision and audio tower with a fixed per-checkpoint soft-token set, no per-request budget | vision through upstream's MediaModel with a per-request budget seam; audio not shipped |
ADR 0021 |
| media prompts on MLX | — | prefill chunks span-aligned around image blocks; a late image is refused | ADR 0014 |
| scheduler | — | log sites never drop fields under contention; head-of-line and evict-all-wait fixes; attached media charged against capabilities before the load; capability advertising corrected for MLX architectures | server/sched.go, images.go |
| panic hygiene (MLX) | — | a cleanup that fails while a request is unwinding never replaces the panic that caused it | mlxrunner/unwind.go |
Measurement — nothing comparable upstream
| this fork | record | |
|---|---|---|
| vision regression suite | preflight with versioned per-model expectations, generated (public, no-download) trigger images, an env-gated node-level meter, and a generated release matrix — run before every deploy | ADR 0011/0012, patch 801 |
| campaigns | five report templates rendered only by generators; per-request memory and drafting analysis; bbox conformance scoped to image geometry | ADR 0012/0028/0030 |
| bounding-box protocol | requests pin norm-1000 and carry a self-calibrating anchor, so the model's internal resize cannot contaminate coordinates: 111 of 112 cells convert cleanly across 14 geometries × 4 models × 2 think modes. A protocol and its measurements, not a runtime change | ADR 0027/0030 |
| fork identity | builds stamped <upstream>-dynres-<n>-g<sha>, a tag per fold, release notes carrying the generated matrix |
ADR 0032 |
It works. Models load, stay resident and generate correct output on both Metal and CUDA. But it is not the path to reach for by default:
- On CUDA it runs at 34–75% of the
cudapath's decode throughput, median 46%. Measured across four matched model pairs on one host, one server process — full report. "Roughly half" is a fair central estimate and a poor description of any single case: the spread is 2.2× and it is not architectural (the two dense pairs sit at 75% and 53%, the two MoE at 34% and 39%). Two of the fourmlx-cudaarms had no stable throughput to quote at all. - Its bigger cost is variance, not speed.
mlx-cuda's per-request spread is ~5× thecudapath's and reaches 46% within a single arm — same host, same prompt, back to back — while everycudaarm held inside ±1.5% first time. For anything that sets a timeout or compares two builds, that matters more than the ratio. It is per-model:gemma4:31b-nvfp4reproduced to 1.1% across four independent measurements. - On Metal it is the other way round. A matched campaign measured MLX ~2.4× faster than llama-server (gemma4 12b: 121 vs 50 tok/s decode). So the CUDA gap is CUDA-specific, not an MLX property — do not generalise either number to the other platform.
- Engine and quantization move together in every figure above — nvfp4 on MLX against q4_K_M on GGUF, because those are the artefacts that exist. So the throughput numbers describe the two stacks as shipped, not the engine in isolation, and the same confound makes MLX-vs-GGUF quality an uncontrolled comparison: a quality difference cannot be attributed to the engine either. Nobody has separated them; until someone does, treat "which is better" as open.
- It is converging with upstream's own MLX work and is expected to be superseded by it; the fork has already retired its constrained-sampling layer in favour of upstream's engine (ADR 0033).
Use GGML/llama-server for anything where throughput or comparability matters.
Every row above is a delta we would rather not have. Each is offered upstream where
it is upstream's to take, and deleted from here once it lands there — the
qwen25vl gate and the MMQ padding fix are both filed and pending.
Start building with open models.
curl -fsSL https://ollama.com/install.sh | shirm https://ollama.com/install.ps1 | iexcurl -fsSL https://ollama.com/install.sh | shThe official Ollama Docker image ollama/ollama is available on Docker Hub.
ollama
You'll be prompted to run a model or connect Ollama to your existing agents or applications such as Claude Code, OpenClaw, OpenCode , Codex, Copilot, and more.
To launch a specific integration:
ollama launch claude
Supported integrations include Claude Code, Codex, Copilot CLI, DeepSeek Harness, Droid, and OpenCode.
Use OpenClaw to turn Ollama into a personal AI assistant across WhatsApp, Telegram, Slack, Discord, and more:
ollama launch openclaw
Run and chat with Gemma 4:
ollama run gemma4
See ollama.com/library for the full list.
See the quickstart guide for more details.
Ollama has a REST API for running and managing models.
curl http://localhost:11434/api/chat -d '{
"model": "gemma4",
"messages": [{
"role": "user",
"content": "Why is the sky blue?"
}],
"stream": false
}'
See the API documentation for all endpoints.
pip install ollama
from ollama import chat
response = chat(model='gemma4', messages=[
{
'role': 'user',
'content': 'Why is the sky blue?',
},
])
print(response.message.content)npm i ollama
import ollama from "ollama";
const response = await ollama.chat({
model: "gemma4",
messages: [{ role: "user", content: "Why is the sky blue?" }],
});
console.log(response.message.content);- llama.cpp project founded by Georgi Gerganov.
Want to add your project? Open a pull request.
- Open WebUI - Extensible, self-hosted AI interface
- Onyx - Connected AI workspace
- LibreChat - Enhanced ChatGPT clone with multi-provider support
- Lobe Chat - Modern chat framework with plugin ecosystem (docs)
- NextChat - Cross-platform ChatGPT UI (docs)
- Perplexica - AI-powered search engine, open-source Perplexity alternative
- big-AGI - AI suite for professionals
- Lollms WebUI - Multi-model web interface
- ChatOllama - Chatbot with knowledge bases
- Bionic GPT - On-premise AI platform
- Chatbot UI - ChatGPT-style web interface
- Hollama - Minimal web interface
- Chatbox - Desktop and web AI client
- chat - Chat web app for teams
- Ollama RAG Chatbot - Chat with multiple PDFs using RAG
- Tkinter-based client - Python desktop client
- Dify.AI - LLM app development platform
- AnythingLLM - All-in-one AI app for Mac, Windows, and Linux
- Maid - Cross-platform mobile and desktop client
- Witsy - AI desktop app for Mac, Windows, and Linux
- Cherry Studio - Multi-provider desktop client
- Ollama App - Multi-platform client for desktop and mobile
- PyGPT - AI desktop assistant for Linux, Windows, and Mac
- Alpaca - GTK4 client for Linux and macOS
- SwiftChat - Cross-platform including iOS, Android, and Apple Vision Pro
- Enchanted - Native macOS and iOS client
- RWKV-Runner - Multi-model desktop runner
- Ollama Grid Search - Evaluate and compare models
- macai - macOS client for Ollama and ChatGPT
- AI Studio - Multi-provider desktop IDE
- Reins - Parameter tuning and reasoning model support
- ConfiChat - Privacy-focused with optional encryption
- LLocal.in - Electron desktop client
- MindMac - AI chat client for Mac
- Msty - Multi-model desktop client
- BoltAI for Mac - AI chat client for Mac
- IntelliBar - AI-powered assistant for macOS
- Kerlig AI - AI writing assistant for macOS
- Hillnote - Markdown-first AI workspace
- Perfect Memory AI - Productivity AI personalized by screen and meeting history
- Ollama Android Chat - One-click Ollama on Android
SwiftChat, Enchanted, Maid, Ollama App, Reins, and ConfiChat listed above also support mobile platforms.
- Cline - VS Code extension for multi-file/whole-repo coding
- Continue - Open-source AI code assistant for any IDE
- Void - Open source AI code editor, Cursor alternative
- Copilot for Obsidian - AI assistant for Obsidian
- twinny - Copilot and Copilot chat alternative
- gptel Emacs client - LLM client for Emacs
- Ollama Copilot - Use Ollama as GitHub Copilot
- Obsidian Local GPT - Local AI for Obsidian
- Ellama Emacs client - LLM tool for Emacs
- orbiton - Config-free text editor with Ollama tab completion
- AI ST Completion - Sublime Text 4 AI assistant
- VT Code - Rust-based terminal coding agent with Tree-sitter
- QodeAssist - AI coding assistant for Qt Creator
- AI Toolkit for VS Code - Microsoft-official VS Code extension
- Open Interpreter - Natural language interface for computers
- LiteLLM - Unified API for 100+ LLM providers
- Semantic Kernel - Microsoft AI orchestration SDK
- LangChain4j - Java LangChain (example)
- LangChainGo - Go LangChain (example)
- Spring AI - Spring framework AI support (docs)
- LangChain and LangChain.js with example
- Ollama for Ruby - Ruby LLM library
- any-llm - Unified LLM interface by Mozilla
- OllamaSharp for .NET - .NET SDK
- LangChainRust - Rust LangChain (example)
- Agents-Flex for Java - Java agent framework (example)
- Elixir LangChain - Elixir LangChain
- Ollama-rs for Rust - Rust SDK
- LangChain for .NET - .NET LangChain (example)
- chromem-go - Go vector database with Ollama embeddings (example)
- LangChainDart - Dart LangChain
- LlmTornado - Unified C# interface for multiple inference APIs
- Ollama4j for Java - Java SDK
- Ollama for Laravel - Laravel integration
- Ollama for Swift - Swift SDK
- LlamaIndex and LlamaIndexTS - Data framework for LLM apps
- Haystack - AI pipeline framework
- Firebase Genkit - Google AI framework
- Ollama-hpp for C++ - C++ SDK
- PromptingTools.jl - Julia LLM toolkit (example)
- Ollama for R - rollama - R SDK
- Portkey - AI gateway
- Testcontainers - Container-based testing
- LLPhant - PHP AI framework
- AutoGPT - Autonomous AI agent platform
- crewAI - Multi-agent orchestration framework
- Strands Agents - Model-driven agent building by AWS
- Cheshire Cat - AI assistant framework
- any-agent - Unified agent framework interface by Mozilla
- Stakpak - Open source DevOps agent
- Hexabot - Conversational AI builder
- Neuro SAN - Multi-agent orchestration (docs)
- RAGFlow - RAG engine based on deep document understanding
- R2R - Open-source RAG engine
- MaxKB - Ready-to-use RAG chatbot
- Minima - On-premises or fully local RAG
- Chipper - AI interface with Haystack RAG
- ARGO - RAG and deep research on Mac/Windows/Linux
- Archyve - RAG-enabling document library
- Casibase - AI knowledge base with RAG and SSO
- BrainSoup - Native client with RAG and multi-agent automation
- LangBot - Multi-platform messaging bots with agents and RAG
- AstrBot - Multi-platform chatbot with RAG and plugins
- Discord-Ollama Chat Bot - TypeScript Discord bot
- Ollama Telegram Bot - Telegram bot
- LLM Telegram Bot - Telegram bot for roleplay
- aichat - All-in-one LLM CLI with Shell Assistant, RAG, and AI tools
- oterm - Terminal client for Ollama
- gollama - Go-based model manager for Ollama
- tlm - Local shell copilot
- tenere - TUI for LLMs
- ParLlama - TUI for Ollama
- llm-ollama - Plugin for Datasette's LLM CLI
- ShellOracle - Shell command suggestions
- LLM-X - Progressive web app for LLMs
- cmdh - Natural language to shell commands
- VT - Minimal multimodal AI chat app
- AppFlowy - AI collaborative workspace, self-hostable Notion alternative
- Screenpipe - 24/7 screen and mic recording with AI-powered search
- Vibe - Transcribe and analyze meetings
- Page Assist - Chrome extension for AI-powered browsing
- NativeMind - Private, on-device browser AI assistant
- Ollama Fortress - Security proxy for Ollama
- 1Panel - Web-based Linux server management
- Writeopia - Text editor with Ollama integration
- QA-Pilot - GitHub code repository understanding
- Raycast extension - Ollama in Raycast
- Painting Droid - Painting app with AI integrations
- Serene Pub - AI roleplaying app
- Mayan EDMS - Document management with Ollama workflows
- TagSpaces - File management with AI tagging
- Opik - Debug, evaluate, and monitor LLM applications
- OpenLIT - OpenTelemetry-native monitoring for Ollama and GPUs
- Lunary - LLM observability with analytics and PII masking
- Langfuse - Open source LLM observability
- HoneyHive - AI observability and evaluation for agents
- MLflow Tracing - Open source LLM observability
- pgai - PostgreSQL as a vector database (guide)
- MindsDB - Connect Ollama with 200+ data platforms
- chromem-go - Embeddable vector database for Go (example)
- Kangaroo - AI-powered SQL client
- Google Cloud
- Fly.io
- Koyeb
- Harbor - Containerized LLM toolkit with Ollama as default backend