Ollama launch: integration handoff
A launcher flow that hands a local Ollama model to Codex or OpenCode. Setup walkthrough, the two gates it checks, failure modes and what fixed them.

The command, in short
ollama launch sets up a coding tool to use an Ollama model and starts it, with no environment variables or config files to write. It needs Ollama 0.15 or later, per the launch announcement.
ollama launch # pick a tool, then a model, from a menu
ollama launch codex # start one integration directly
ollama launch claude --model qwen3.5 # choose the model as well
ollama launch droid --config # configure it without starting it
The integrations listed in Ollama's CLI docs, checked 2026-10-21: OpenCode, Claude Code, Codex, VS Code and Droid (Factory's coding agent). The tool has to be installed first; the launcher tells you when it is not. For coding work, the announcement recommends raising Ollama's context length to at least 64000 tokens.
OpenCode with a local model
Checked 20 November 2026 against Ollama's and OpenCode's documentation and OpenCode's source. Nothing in this section was run for this page, and the first run further down used Codex, so none of it is tested here.
Which OpenCode you install decides how it finds Ollama. Two release lines were current on that date:
- OpenCode 1 (1.19.6, released 17 November 2026) is what
curl -fsSL https://opencode.ai/install | bashandnpm install -g opencode-aiinstall. The install script says it "only installs OpenCode 1", and npm'slatesttag pointed to 1.19.6. Its docs are at opencode.ai/v1/docs. - OpenCode 2 (2.3.2, released 18 November 2026) has its own installer,
curl -fsSL https://opencode.ai/v2/install | bash, named in the same script. The main opencode.ai/docs pages describe it. See the release list.
The short way: ollama launch
ollama launch opencode # set OpenCode up for Ollama and start it
ollama launch opencode --config # set it up without starting it
Ollama's OpenCode page says this does not overwrite ~/.config/opencode/opencode.json, so existing OpenCode settings still apply, and that models defined only in that file do not appear in the launch picker. ollama launch needs Ollama 0.15 or later.
By hand, OpenCode 1
Add a provider to OpenCode's config, ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama",
"options": { "baseURL": "http://localhost:11434/v1" },
"models": { "qwen3.5": { "name": "qwen3.5" } }
}
}
}
This is the shape both Ollama's OpenCode page and OpenCode 1's provider docs show. Each key under models is a model name as ollama list shows it. Start opencode and pick the model with /models.
OpenCode 2 finds Ollama by itself
With Ollama running on the same machine, OpenCode 2 probes http://127.0.0.1:11434 and adds the models it finds to /models without any config, per its provider docs. At 2.3.2 the source reads Ollama's model list and each model's details, keeps the models that report the completion capability, and marks tool support from the tools capability: the same list explained in Which Ollama models support tools. For an Ollama server elsewhere, the docs set providers.ollama.settings.baseURL, ending in /v1. To make a model the default, set "model": "ollama/<name>" (models docs).
Context length is where it breaks
Ollama's default context depends on GPU memory: 4k tokens below 24 GiB of VRAM, 32k from 24 to 48 GiB, and 256k at 48 GiB or more (context length docs). The two projects give different numbers for what OpenCode needs:
- Ollama's OpenCode page: "a context length of 64k or higher".
- OpenCode 1's provider docs: if tool calls are not working, raise Ollama's
num_ctx, starting around 16k to 32k.
Set it with the slider in the Ollama app's settings, or start the server with OLLAMA_CONTEXT_LENGTH=64000 ollama serve. ollama ps shows the context a loaded model is running with. A longer context needs more memory: Ollama's launch post gives about 23 GB of VRAM for glm-4.7-flash at 64000 tokens.
OpenCode 2 takes a model's context size from the model's own details (source). That is the size the model supports, which can be larger than the context your Ollama server is set to serve.
Not tested here
A tested result would record the Ollama and OpenCode versions, the model and tag, the operating system, the exact commands and output, the date, and who ran it.
The first run, January 2026
The rest of this page is the first run, from January 2026: what the flow looked like, the two places it stops, and what fixed them.
Key takeaways
ollama launchturns model selection into a single handoff step.- The integration list is the contract: install the tool before you launch it.
- A short, visible flow beats hidden config when you are new to local stacks.
This experiment is about a new entry point: ollama launch. Instead of wiring a tool to a model by hand, the launcher asks which integration you want and then routes the model into it. The result feels like a simple handoff layer for local AI tools.
Architecture map
ollama launch acts like a dispatcher. You pick a tool, then a model, and it hands the model into that tool.
What happened
The flow started with a simple command and a menu. The launcher listed available integrations (Claude, Codex, OpenCode, and others), then asked for a model. When I selected Codex without having it installed, the launcher surfaced the missing dependency clearly and told me what to install.
The two gates
The first gate is tool installation. If the integration is not installed, the launcher stops and tells you exactly what is missing.
The second gate is model availability. If the model is not local, the handoff stalls until it is pulled or selected.
Setup walkthrough
- Run the launcher.
- Select an integration (Codex, OpenCode, or another tool you have installed).
- Select a local model.
- Start the tool session.
ollama launch
First-time config
When Codex was missing, the launcher pointed to the installation command. After installing, the same launch flow worked cleanly.
npm install -g @openai/codex
Quick checks
ollama launch codex
ollama launch opencode
ollama launch claude
Failure modes
- Launching a tool before it is installed.
- Selecting a model that is not available locally.
- Assuming the launcher is a model manager rather than a handoff layer.
What made the difference
The launcher compresses setup into one visible decision tree. Instead of hunting for flags and configs, you pick a tool and a model and move on.
What I would do next time
I would pre-install the integrations I care about, then treat ollama launch as the default entry point for local tool sessions.