A small local coding model is good enough when it produces an accepted patch on your repository with less total waiting and review than your alternative. Start with two reproducible maintenance bugs, and judge the complete edit-and-test loop rather than a single generated function.
Budget context for the complete coding session
An agent's working context includes instructions, tool definitions, source files, search results, previous edits and test output. Reserve space for the next response as well. As of November 2026, Ollama's context documentation recommends at least 64,000 tokens for agents and coding tools. Start there if your memory budget permits, then check placement and response time.
Here is an illustrative 64,000-token allocation: 4,000 for instructions and tools + 30,000 for source + 12,000 for history and test output + 8,000 for the next answer = 54,000, leaving 10,000 tokens of margin. Replace them with counts from your agent's actual requests before sizing hardware.
In the Ollama desktop app, change the context slider in settings. For a manually launched server on macOS or Linux, stop the existing server first and use:
OLLAMA_CONTEXT_LENGTH=64000 ollama serve
In another terminal, use ollama ps to inspect the loaded model's context and processor placement. The environment variable applies to the server you launch; use the settings slider for an already running desktop app. Larger context requires more memory, so keep irrelevant logs and repeated file dumps out of the conversation.
Choose candidates by their job and actual artifact
The live TrustedRouter catalog on 2026-11-22 includes the following open-weight candidates. A catalog model ID identifies a hosted offering; use the corresponding Ollama tag or local artifact for local runs. Record the upstream checkpoint and quantization separately. Use your installed local model as the baseline, compare Qwen3-Coder-30B-A3B locally if its artifact fits, and use DeepSeek-V3.2 as a hosted reference unless you have hardware for its much larger weights.
| Catalog model ID | Why include it | What to verify locally |
|---|---|---|
qwen/qwen3-coder-30b-a3b-instruct |
Dedicated agentic coding model | Its function-call template and repository task accuracy |
deepseek/deepseek-v3.2 |
Larger reasoning and tool-use comparison | Hosted reference unless you can fit its much larger weights |
Qwen's model card specifies 30.5 billion total parameters, 3.3 billion activated parameters and a native 262,144-token context. The activated count describes computation through the mixture of experts; use the total parameter count when estimating weight storage. Its card also documents a specialized function-call format, making template compatibility part of the coding test.
DeepSeek-V3.2's publisher describes reasoning and agent training and releases the weights under MIT terms. Its repository reports approximately 685 billion parameters. Check every candidate against your installed dependency versions and project conventions.
Parallelize independent work in separate worktrees
Coding is an especially useful place to add parallel agents because maintenance work often divides into independently testable changes. One agent can fix date formatting while another repairs a command-line error message and a third investigates a failing fixture. Each gets a bounded task, a test command and its own working directory. Review and integration remain explicit steps.
Git worktrees provide multiple working trees attached to one repository. Starting from your chosen baseline, these commands create two new branches and directories on macOS or Linux:
git worktree add -b agent-date ../agent-date HEAD
git worktree add -b agent-cli ../agent-cli HEAD
Run each agent inside its assigned directory. Give it only the files and dependencies relevant to its task, and keep separate output paths for generated artifacts. Worktrees separate file edits; coordinate design decisions and isolate shared external databases separately.
On one local GPU, concurrent agents share available throughput and queue when capacity is occupied. Ollama's FAQ also explains that parallel requests increase context allocation. Four requests configured for 64,000 tokens represent 4 × 64,000 = 256,000 context tokens under that allocation rule. Budget memory and throughput together when adding agents.
For an illustrative local scheduling example, suppose four independent tasks each take 15 minutes when run alone. Serial time is 4 × 15 = 60 minutes. Four separately provisioned local machines could each run one 15-minute task, followed by review and integration. Compare that hardware requirement with your actual task volume.
Try it on your workload
Freeze a revision with a known formatting bug and an existing test that exposes it. Supply every candidate with the same issue description, relevant files and permitted commands. Require a patch, the test result and a short explanation of why the change fixes the case. Do not reveal a reference patch in the prompt.
Record time to the first passing patch, total time including review, failed test runs, unrelated changed lines and invented APIs. Check a neighboring case the agent did not see. If the repository uses two languages, repeat with a second bug in the other language. A model that succeeds on Python should still earn its place on your TypeScript task.
Next run the two tasks simultaneously in separate worktrees. Compare wall-clock time and accepted patches per hour against the serial run. Keep the same model, prompt and test environment so the experiment isolates scheduling rather than a simultaneous model upgrade.
How to decide
Keep local coding for focused changes that pass tests and review within your working time budget. Improve file selection when context is crowded. Compare a stronger model when the agent sees the right evidence but repeatedly produces incorrect fixes. Rent additional capacity when independent tasks are ready and inference queues, rather than human review, delay completion.
Run ten coding agents at once for about 23 cents
Ten coding agents working at once on qwen/qwen3-coder-30b-a3b-instruct cost about 23 cents in tokens on TrustedRouter. In this illustrative workload, each agent consumes 100,000 input and 20,000 output tokens across its repository task. On 2026-11-22, catalog prices rounded to $0.132 per million input and $0.475 per million output tokens. Input = 10 × 100,000 = 1,000,000; output = 10 × 20,000 = 200,000. Cost = 1 × $0.132 + 0.2 × $0.475 = $0.227, about 23 cents.
On one local GPU, those agents share its throughput, and requests beyond its parallel capacity wait in line; through a per-token API they can run at the same time, with the same token bill as running them one after another. Assign separate worktrees and test commands, then review and integrate each patch. Extra retries and duplicated context add tokens.
TrustedRouter uses an OpenAI-compatible API. Prices change; check current models and agent configuration. For approved source code, review confidential inference and eligible prices in provider routing. Local remains better for repositories that must stay on the machine or a single task that already runs well.
Sources
- Ollama: agent context recommendation and configuration
- Qwen: coding model card, parameters and context
- DeepSeek: V3.2 model card
- Git: creating separate working trees
- Ollama: concurrent requests and memory allocation
- TrustedRouter: current catalog models and prices