A← Index

tinycode

A coding agent small enough for a small local model.

RoleSolo: design & build
TypeDeveloper tool · Coding agent
StackRust · llama-server
SourceOpen source · MIT

IThe problem

Large coding agents send long prompts and offer many tools. A small model loses track of them. tinycode is an agent built for small models. The benchmark below runs a 1.7-billion-parameter model on a 6 GB graphics card.

tinycode talks to any OpenAI-compatible server, for example llama-server. It keeps the prompt short and gives the model three tools.

3tools: bash, read, edit
18benchmark tasks
17/18passed with a 1.7B model, one run

IIHow it keeps a small model on track

Three tools
bash, read with line numbers, and edit, which replaces exact text. bash runs with pipefail, so tests | tail keeps the exit code of the tests.
A repeat guard
The agent blocks the same call twice when nothing changed between the two calls.
A short context
Old tool output is trimmed, so the context stays small. An empty reply, where the model thought too long, gets one short nudge.
Done means the tests pass
A reply without a tool call ends the task. tinycode accepts it only when the last test command passes. Otherwise it sends the failure back to the model.

IIIMeasured against opencode

The repository has 18 coding tasks. Each task has a repo, a task text and a check script. Some checks add hidden tests after the agent finishes. I ran tinycode and opencode on the same tasks with the same model.

Taskstinycodeopencode 1.19.5
01–10: small fixes and features10/1010/10
11–18: traps, hidden tests, a large file, speed, a refactor7/86/8

Setup. LFM3-1.7B (Q6_K) on llama-server, RTX 3060 6 GB, one run per task and agent.

Limits. One run per task and one model, so a one-task difference is not a result. Both agents fail task 16, a parser with strict edge cases. Run times vary up to ten times between runs, so compare pass counts first. tinycode runs shell commands without asking, so run it only in a folder you can restore, such as a git checkout.

SignedArjun