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.
The big picture
Section titled “The big picture”Ollama exposes two things on 127.0.0.1:11434:
- Its own native API (
/api/chat,/api/generate,/api/tags…). The Python demos in this course use exactly this. - 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
The Applications tab in the Ollama desktop app is a launcher for tools that already speak this protocol.
What the Applications tab looks like
Section titled “What the Applications tab looks like”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:
| App | What it is | Command shown |
|---|---|---|
| Claude Code | Anthropic’s terminal coding agent (CLI), pointed at your local model | ollama launch claude --model <model> |
| Codex App | An OpenAI-style coding REPL, local backend | ollama launch codex-app --model <model> |
| OpenCode | The open-source CLI alternative to Claude Code | ollama launch opencode --model <model> |
| Codex | The OpenAI-style CLI, local backend | ollama launch codex --model <model> |
| Hermes Agent | An agent framework distribution from Nous Research | ollama 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.
Quick try — launching one app
Section titled “Quick try — launching one app”The Apps tab is the easy path, but the same thing works from the command line:
# Make sure the model you want is pulledollama pull qwen2.5-coder:7b
# Launch OpenCode (or any other) on itollama launch opencode --model qwen2.5-coder:7bWhat happens under the hood:
- Ollama starts the named external CLI (OpenCode in this example).
- It sets
OLLAMA_HOST=127.0.0.1:11434(and/orOPENAI_API_BASE) in the CLI’s environment. - It passes the model name through, so the CLI knows which local model to call.
- 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.
Doing the same thing without the Apps tab
Section titled “Doing the same thing without the Apps tab”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:
# 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 normallyaider# orcontinue --provider openaiSome examples of OpenAI-compatible tools you can wire to local Ollama with this trick:
| Tool | What it is | Where it runs |
|---|---|---|
| Continue | Coding assistant in VS Code and JetBrains | IDE extension |
| Aider | Pair-programming CLI tied to git | Terminal |
| Cline (formerly Claude Dev) | Agentic VS Code extension | IDE extension |
| Open WebUI | Self-hosted ChatGPT-style web UI | Local web server |
| LiteLLM | Proxy that exposes many providers as one OpenAI endpoint | Local proxy |
| LlamaIndex / LangChain | Frameworks (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 Clientclient = 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.
What you just proved
Section titled “What you just proved”- Ollama on
127.0.0.1:11434is 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.
Where to go now
Section titled “Where to go now”- 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.