Skip to content

Practice 4 — Ollama Apps and external coding agents

Duration: ~10 min Prerequisites: Practice 3 — Compare 3 models and the Ollama desktop app installed

In the first three practices you used Ollama from the terminal, by yourself. This last one shows what becomes possible as soon as a model is sitting on 127.0.0.1:11434: any external tool that speaks the same API can plug in. The Ollama desktop app exposes some of these in an Applications tab — coding agents you can launch with one click, wired to your local model instead of a paid cloud API.

The point of this practice is discovery, not deep setup. You will see what is possible, click around, and understand that the Python demos in chapters 07-10 are the same pattern, written by hand.

Ollama exposes two things on 127.0.0.1:11434:

  1. Its own native API (/api/chat, /api/generate, /api/tags…). The Python demos in this course use exactly this.
  2. An OpenAI-compatible API (/v1/chat/completions, /v1/embeddings…). Same endpoints as OpenAI’s cloud, same JSON shape.

The OpenAI compatibility is what makes the next part possible. Any tool written against the OpenAI API can be redirected to your local Ollama by changing one URL.

flowchart LR
  Ollama["Ollama daemon<br/>127.0.0.1:11434"]
  Demos["Python demos<br/>(chapters 07-10)"]
  Apps["External coding agents<br/>Continue, Aider, OpenCode,<br/>Claude Code CLI..."]
  Browser["Web UIs<br/>Open WebUI"]
  Demos -->|"/api/chat (native)"| Ollama
  Apps -->|"/v1/chat/completions<br/>(OpenAI-compatible)"| Ollama
  Browser -->|"both APIs"| Ollama
Three families of clients, one local Ollama daemon. Same primitive, three flavours of API call.

The Applications tab in the Ollama desktop app is a launcher for tools that already speak this protocol.

In recent versions of the Ollama desktop app, the left rail shows an Applications entry. Inside, you see cards for tools the team has packaged for one-click launch:

AppWhat it isCommand shown
Claude CodeAnthropic’s terminal coding agent (CLI), pointed at your local modelollama launch claude --model <model>
Codex AppAn OpenAI-style coding REPL, local backendollama launch codex-app --model <model>
OpenCodeThe open-source CLI alternative to Claude Codeollama launch opencode --model <model>
CodexThe OpenAI-style CLI, local backendollama launch codex --model <model>
Hermes AgentAn agent framework distribution from Nous Researchollama launch hermes --model <model>

The exact list evolves with Ollama versions. What matters is the shape: every entry is a pre-wired environment that opens with OLLAMA_HOST (or OPENAI_API_BASE) already pointing to your local server, and --model <name> selects the local model you want it to use.

The Apps tab is the easy path, but the same thing works from the command line:

Terminal window
# Make sure the model you want is pulled
ollama pull qwen2.5-coder:7b
# Launch OpenCode (or any other) on it
ollama launch opencode --model qwen2.5-coder:7b

What happens under the hood:

  1. Ollama starts the named external CLI (OpenCode in this example).
  2. It sets OLLAMA_HOST=127.0.0.1:11434 (and/or OPENAI_API_BASE) in the CLI’s environment.
  3. It passes the model name through, so the CLI knows which local model to call.
  4. The CLI thinks it is talking to its usual backend — but every request lands on your machine.

When you ask the CLI to refactor a function, the reply is generated by your local model, with no network call to any cloud API, no token budget, no rate limit.

ollama launch is a convenience wrapper. The underlying technique is universal: point any OpenAI-compatible tool to your Ollama. The recipe is one or two environment variables.

For tools that follow OpenAI conventions:

Terminal window
# In PowerShell
$env:OPENAI_API_BASE = "http://127.0.0.1:11434/v1"
$env:OPENAI_API_KEY = "ollama" # any non-empty string works
$env:OPENAI_MODEL = "qwen2.5-coder:7b"
# Then launch the tool normally
aider
# or
continue --provider openai

Some examples of OpenAI-compatible tools you can wire to local Ollama with this trick:

ToolWhat it isWhere it runs
ContinueCoding assistant in VS Code and JetBrainsIDE extension
AiderPair-programming CLI tied to gitTerminal
Cline (formerly Claude Dev)Agentic VS Code extensionIDE extension
Open WebUISelf-hosted ChatGPT-style web UILocal web server
LiteLLMProxy that exposes many providers as one OpenAI endpointLocal proxy
LlamaIndex / LangChainFrameworks (see annex 13b)Your Python code

All of these work with the same Ollama daemon you have been using in practices 1-3.

How this relates to the Python demos coming next

Section titled “How this relates to the Python demos coming next”

Every demo in chapters 07-10 is the same pattern, without any external CLI:

from ollama import Client
client = Client(host="http://127.0.0.1:11434")
response = client.chat(model="llama3.1:8b", messages=[...], tools=[...])

What ollama launch opencode does is essentially: open OpenCode, give it the same primitive (an HTTP client pointed at 127.0.0.1:11434), and let it do the heavy lifting around the model.

In the demos you write that client yourself. That is why the demos are pedagogical: you see every byte. The Apps and external tools are what you reach for after you understand the demos, to get production-grade features (multi-file edits, git integration, slash commands, file diffs, prompts library, observability) for free.

  • Ollama on 127.0.0.1:11434 is infrastructure, not just a chat. Many tools plug into it without rewriting anything on your side.
  • The Applications tab in the Ollama desktop app is a one-click launcher for popular coding agents already wired to your local model.
  • The same trick works for any OpenAI-compatible tool by exporting OPENAI_API_BASE=http://127.0.0.1:11434/v1.
  • The Python demos in chapters 07-10 use the same primitive these apps wrap. After the demos, you will be able to read the source of these apps and understand what they do.
  • Curious about the easy path? Open the Ollama desktop app, click Applications, pick OpenCode or Continue, set the model to one you pulled in practice 3, and try it for 10 minutes.
  • Curious about the hard path? Move on to Demo 0 (chapter 07). It writes from scratch, in 50 lines of Python, what these apps do under the hood. Once you understand it, every “Ollama-compatible tool” stops being a black box.