# How to run a coding agent on free, open models

> Source: https://minniai.com/learn/run-a-coding-agent-on-free-open-models (canonical HTML page)

[Guides](https://minniai.com/learn)


You can run a terminal coding agent without paying per token: NVIDIA and OpenRouter both give out free keys for open models, and a model on your own computer costs nothing per call. The catch is attention. A free model has less of it than a frontier one, so the agent around it has to send less: short instructions, tools loaded only when a task needs them, and every edit shown before it lands. That is what MinniCode is built for. This guide is the honest version of what you get.

Updated 2026-10-25

## Where the free models come from

Two providers hand out keys for open models at no charge. [NVIDIA](https://build.nvidia.com) hosts its own Nemotron family and other open models behind one API key. [OpenRouter](https://openrouter.ai) lists models from many labs and marks the free ones with `:free`; the key is free, the free models have a daily call allowance, and a paid balance unlocks the rest. Both speak the same chat-completions format, so an agent built for one works with the other.

The third option is a model on your own computer through [Ollama](https://ollama.com) or [LM Studio](https://lmstudio.ai). No key, no allowance, no network. The limit is your hardware: a coding model that fits in a consumer graphics card is smaller than the hosted ones, and it shows in longer tasks.

- **NVIDIA key:** sign in at build.nvidia.com, create an API key, paste it when the agent asks. Requests go from your computer to NVIDIA.
- **OpenRouter key:** sign up at openrouter.ai, create a key, pick a model ending in `:free`. The agent can switch models between tasks.
- **Local:** install Ollama or LM Studio, pull a coding model, point the agent at the local address. Nothing leaves the machine.

## Why the agent matters more than the model

A coding agent is a loop: read the task, look at the code, call a tool, read the result, decide the next step. Every step sends the whole conversation again, plus the agent’s own instructions and the list of tools it can call. On a frontier model that overhead is tolerable. On a free model it is the difference between a correct edit and a confused one, because a smaller model has less attention to spend and the overhead spends it first.

So the agent has to be lean. Its instructions stay short. Its notes about your project load every turn only as a small core, with the rest loaded when a task asks for it. Tool results that are no longer needed drop out of the conversation. The model sees your code, not the agent’s plumbing.

That is measurable. In a warm session MinniCode wrote 5,286 tokens to the model’s cache against 8,273 for Claude Code on the same tasks, 36% less, three sessions each, every task checked correct (measured 21 October 2026 on Claude Sonnet through the claude provider, so the comparison is like for like). The same discipline is what lets a free model keep up.

## The approval step is the safety model

A free model will sometimes be wrong with confidence. The protection is not a better prompt; it is that nothing changes until you say so. In MinniCode every file edit is shown as a diff first and lands only when you accept it. Running a command, deleting a file and pushing to GitHub need a clear yes every time by default. That turns a wrong guess into a diff you decline, not a broken branch.

The flip side: if you want an agent that applies edits and runs commands with no questions, this is the wrong tool. The approval step is the product.

## What a turn looks like

- You type a task in the terminal, in your project folder: "add tests for sample.py and fix whatever fails".
- The agent reads and searches first: the files the task names, the tests that exist, the project’s notes.
- It proposes an edit. You see the diff and accept or decline it.
- It asks to run the tests. You say yes. It reads the result and goes again until they pass or it tells you why they cannot.
- When the work is done it can open a pull request, with your yes.

install MinniCode

```
$ irm https://minniai.com/install | iex      # Windows, PowerShell
$ curl -fsSL https://minniai.com/install | sh  # macOS and Linux
```

The first run asks for a key, or for your Claude subscription through Claude Code if you have one, or for a local model. `/settings` changes the provider later. `minnicode update` fetches the newest release; the installer always does.

## What a free model will not do well

- **Very long tasks.** A free allowance is per day and a long task is many calls. Break big work into smaller asks.
- **Reasoning-heavy refactors.** A smaller model loses the thread across many files. Give it one file or one function at a time and let the tests judge.
- **Local models under about fourteen billion parameters** tend to write prose instead of calling tools on a hard task. They are fine for small, well-described edits.

When a task needs more, switch to a paid model for that task and back again. The agent stays the same; only the model behind it changes.

## Where your code goes

With a hosted model, each request goes from your computer straight to the provider you chose, under your own key. Minni’s servers are not in the path and never see the key or the code. With a local model nothing leaves the machine at all. The [privacy policy](https://minniai.com/privacy) says the same in more words.

Try MinniCode

An open-LLM optimized low token terminal coding agent. Free to run on your own NVIDIA or OpenRouter key, your Claude subscription, or a local model. The [product page](https://minniai.com/minnicode) and the [docs](https://minniai.com/minnicode/docs) cover the rest.

install it (PowerShell on Windows, sh on macOS and Linux)

```
$ irm https://minniai.com/install | iex
$ curl -fsSL https://minniai.com/install | sh
```

## More guides

- [How to reduce Claude Code token usage Where the tokens go each turn, and eight ways to spend fewer.](https://minniai.com/learn/reduce-claude-code-token-usage)
- [Why Claude Code sessions get expensive Every turn re-sends the whole session. What makes that grow.](https://minniai.com/learn/why-claude-code-sessions-get-expensive)
- [Claude Code memory: CLAUDE.md vs MinniMemoryMCP What belongs in CLAUDE.md, and splitting the rest out by hand or with a tool.](https://minniai.com/learn/claude-code-memory-claude-md-vs-minnimemorymcp)
- [What a Windows PC optimization agent should and should not touch The settings worth changing, the ones that are placebo, and the ones that break things.](https://minniai.com/learn/what-a-pc-optimization-agent-should-touch)

---

Index for agents: https://minniai.com/llms.txt. Doing a task: https://minniai.com/agents.md
