Run an AI agent on a local model with Ollama and Ropu
How to run AI agent with Ollama: pull a tool-capable model, open a password-protected tunnel, add it in Ropu and keep a hosted backup.
On this page
To run AI agent with Ollama, start by installing a tool-capable model on your own computer, giving it a public https address with a tunnel, and adding that address on Ropu's Models page. After that, any teammate can use your model instead of a hosted one. This guide walks through each step, and is honest about what "local" does and does not mean here.
Why run an agent on your own model
There are two practical reasons people do this:
- Cost. Calls to a local model cost 0 credits and no OpenRouter spend. A run still counts as a run, and tokens are still recorded so you can see usage. See the pricing page for how credits work.
- Control. You choose the model, the size and the hardware. If you already run a capable machine, you get to use it.
Ropu works with any OpenAI-compatible endpoint: Ollama, LM Studio, llama-server from llama.cpp, vLLM and similar. This post uses Ollama.
The honest privacy note
What you gain is control over which model generates the answer, not a promise that nothing leaves your building. If that distinction matters for your business, read the security page before you connect anything sensitive. Your endpoint key or password is encrypted in the vault and is never shown again after you save it.
Step 1: Install Ollama and pull a model that can use tools
Install Ollama, then download a model that supports tool calling. Agents depend on tools to do work. A model without tool support can chat, but it cannot act.
ollama pull qwen2.5:7b
ollama pull llama3.1:8b
ollama run qwen2.5:7b "Say hello"Bigger is better for agents. Tiny models (3B and under) often fail multi-step tasks. Start with 7B to 8B if you have the memory, and go bigger if you can.
Step 2: Make it reachable with a tunnel
Your computer is not on the public internet, so you need a tunnel. Ropu only talks to public https addresses. These are refused: localhost, private networks (10.x, 172.16-31.x, 192.168.x), link-local and cloud-metadata addresses, and plain http. Redirects are re-checked the same way, requests have time and size limits, and the connection goes to the address Ropu vetted, so DNS cannot be swapped after the check.
One detail trips most people up. Ollama only accepts requests whose Host header looks local, so your tunnel must rewrite the Host header to localhost. Without it, Ollama answers 403 Forbidden.
With ngrok, save this as ollama.yaml. It asks for a username and password and rewrites the header. Choose your own long password (8 to 128 characters):
on_http_request:
- actions:
- type: basic-auth
config:
credentials:
- "ropu:CHOOSE-A-LONG-PASSWORD"
- type: add-headers
config:
headers:
host: localhostThen start the tunnel:
ngrok config add-authtoken YOUR_AUTHTOKEN
ngrok http 11434 --traffic-policy-file ollama.yamlngrok prints a Forwarding URL such as https://your-name.ngrok-free.app. The random URL changes every restart. To keep it stable, reserve a free static domain in the ngrok dashboard and add --url https://your-name.ngrok-free.app to the command.
You do not need to change OLLAMA_HOST for a tunnel running on the same computer. Cloudflare Tunnel and Tailscale Funnel can also provide the address. Quick Cloudflare tunnels have no password and Funnel has no password layer, so treat those URLs as secrets. Ropu has not tested Funnel.
Step 3: Add the endpoint on the Models page
A workspace admin does this once, and then every member's teammates can use the model.
- Open Models (in the sidebar, or under More on a phone) and find Local models.
- For URL, enter your tunnel address plus
/v1, for examplehttps://your-name.ngrok-free.app/v1. - For authentication, choose Custom header. The header name is
Authorization, and the value isBasicfollowed by the base64 ofusername:password. You can make it withprintf 'ropu:CHOOSE-A-LONG-PASSWORD' | base64. - Press Fetch models, or type the model id, such as
qwen2.5:7b. - Press Test connection.
Ropu sends the ngrok-skip-browser-warning header automatically to common ngrok addresses, so the ngrok interstitial page does not get in the way.
Read the test result
Test connection sends one tiny chat request that includes a tool, then reports how long it took and one of three outcomes:
| Result | What it means |
|---|---|
| Works | The endpoint is reachable and the model called the tool. Agents can use it. |
| Reachable but no tool support | The endpoint answers, but the model did not call tools. Pick a tool-capable and larger model. |
| Cannot reach it | The message names the cause: 401, 403, 404, the ngrok warning page, tunnel offline, DNS, timeout, refused or a blocked address. |
Step 4: Give a teammate the model, and a backup
Go to Settings, then Agents, and pick Local: your-model as the teammate's model. Then add a hosted model as its backup.
The backup matters. If your computer sleeps or the tunnel stops, a teammate on a local model fails. With a backup set, Ropu switches to the hosted model and the run log says so. Hard multi-step tasks are also a good reason to keep a hosted backup around.
You can also set a workspace Default model on the Models page.
Fixing the common problems
- 403 Forbidden. The Host header was not rewritten to
localhost. Check the tunnel policy. - 401 Unauthorized. The header name must be
Authorization, the value must start withBasic, and the base64 must match your username and password exactly. - 404. The URL must end in
/v1. If the message mentions the model, runollama pull <model>. - Timeouts on the first message. The first request loads the model into memory, which can take a minute for large models. Ollama unloads idle models after 5 minutes by default; set
OLLAMA_KEEP_ALIVE=30mto keep it loaded. Ropu waits up to about 170 seconds per model call. - Works, then stops. The computer went to sleep or the tunnel closed. Keep the machine awake while agents run, or rely on the backup model.
- Agents loop or give up. The model is probably too small. Try a larger one.
What a local model does not change
Approvals work the same way whatever model you pick. Teammates still draft and propose, and sending an email or taking another external action still waits for you. A smaller model can make more mistakes on multi-step work, which is one more reason to read drafts before approving them.
Local models and custom tools pair well. If you want your agent to reach your own systems, read how to connect a custom MCP server, which uses the same tunnel approach. When you are ready to try it, start free and open the Models page.
Frequently asked questions
Does a local model keep my data on my own computer?
No. Ropu runs in the cloud, so prompts and run content, including the text of emails and documents your agent reads, pass through Ropu's servers on the way to your endpoint.
Do local model calls use credits?
No. Calls to a local model cost 0 credits and no OpenRouter spend. A run still counts as a run, and tokens are still recorded.
Why can't I just paste http://localhost?
Ropu runs in the cloud and cannot reach your computer's localhost. It also refuses private network addresses and plain http. You need a public https address, which a tunnel gives you.
What happens if my computer goes to sleep?
A teammate on a local model fails unless it has a hosted backup model. If you set one under Settings, then Agents, Ropu switches to it and the run log says so.
Which model size should I start with?
Start with a 7B to 8B model that supports tools, such as qwen2.5:7b or llama3.1:8b. Models of 3B and under often fail multi-step tasks.
Hand off the busywork, keep the final say
Ropu's AI teammates draft and propose. Nothing is sent or posted until you approve it.
This article was drafted with AI assistance and reviewed by the Ropu team before publishing. Facts about Ropu come from how the product works today.