Ollama — CLI for Claude Code and Codex

Ollama runs open models on your own machine and serves them to agents through a local API compatible with OpenAI and Anthropic.

Install in Claude Code, Codex and OpenCode

Other ways to install

Access and checks

How we review

Extended access. The tool runs code or makes network calls and only reads external data.

  • The install script downloads and runs code as the user
  • The local API has no key: exposing it through OLLAMA_HOST lets anyone on that network use the model

This is third-party code. Review the repository files before installing.

What it does

Ollama downloads an open model with one command and runs it on your machine: `ollama run gpt-oss:20b` opens a chat right in the terminal. The library includes gpt-oss, Qwen, Gemma, DeepSeek and Llama in several sizes. A running Ollama listens on 127.0.0.1:11434 and serves an OpenAI-style API (`/v1/chat/completions`, `/v1/responses`) and an Anthropic-style one (`/v1/messages`), so the model plugs into Claude Code, Codex, OpenCode and Cline without a separate proxy. `ollama launch` configures an agent for the local model by itself: `ollama launch claude`, `ollama launch codex`, `ollama launch opencode`.

Who it is for. Developers who need a model without a cloud account or per-token billing, and anyone who does not want code to leave the machine.

Good fit when

  • You want Claude Code, Codex or OpenCode on a local model
  • You need to work without a foreign account and without per-token billing
  • You want to try an open model on your own tasks
  • You need one local model server for several agents

Not a fit when

  • You need the quality of large cloud models on hard tasks
  • The machine has 8–16 GB of memory and the tasks need code and tool calls: small models handle that worse

Example request

Run Claude Code on the local qwen3.5 model through Ollama and check that tool calls work

Limitations

The default context depends on video memory: below 24 GiB it is 4K tokens, while agents need 64K or more. Raise it with `OLLAMA_CONTEXT_LENGTH` or the slider in the app.

An agent needs a model with tool support, which the model page marks as tools.

Cloud models tagged `:cloud` are not downloaded and run through an Ollama account: the free Pay as you go plan charges per token and allows three concurrent requests, while Pro and Max add included usage and more concurrency.

How to disable. Stop the server (`ollama stop` for a model or quit the app) and remove models you no longer need with `ollama rm`. On macOS models live in `~/.ollama/models`.

FAQ

How much memory does Ollama need?

It depends on the model: gpt-oss:20b is 14 GB and targets systems with 16 GB of memory, qwen3-coder:30b is 19 GB. Small models such as gemma4 e4b take 6–10 GB.

How do I connect Ollama to Claude Code?

Run `ollama launch claude`, or set ANTHROPIC_BASE_URL=http://localhost:11434, ANTHROPIC_AUTH_TOKEN=ollama, an empty ANTHROPIC_API_KEY and run `claude --model qwen3.5`.

How do I connect Ollama to Codex?

Run `ollama launch codex`, or use `codex --oss`, which picks Ollama as the local provider.

Why does an agent on Ollama not call tools?

Usually the context is too small or the model lacks tool support. Raise the context to 64K tokens and pick a model marked tools.

Is Ollama paid?

Running locally is free and unlimited. Cloud models tagged `:cloud` run on the free Pay as you go plan with per-token billing and three concurrent requests, and Pro and Max add included usage.

How do I install Ollama?

Run npx skillfoxx add cli/ollama in a terminal.

Discussion

No questions or reviews yet.

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialRepository starsMain difference
Ollama (this card)yes188,360
LM StudioyesLM Studio is a closed desktop app, Ollama is an open command-line project
MCP Client for Ollama (ollmcp)no840ollmcp is a client that connects MCP servers to Ollama models, not Ollama itself
Ollayano1,484Ollaya skill and MCP server

README in short

The README covers installation on macOS, Linux and Windows, the Docker image, the model library, the REST API and `ollama launch` for Claude Code, Codex, OpenCode, Copilot CLI and OpenClaw.

README badge

Report a problem