Can you "vibe code" with local models? Part 1
Vibe coding a complete Go ray tracer with Qwen3.8 27B running locally on a Mac, using Mini Me: the result, the time it takes, and the agent settings that make it work.

It's a question I often ask myself: can you do vibe coding (you describe what you want, the agent writes the code, you adjust the course from time to time) using only models running on your own machine, without a single call to an LLM in the cloud?
Until now, my answer was no. You can do lots of things with local models, but given the constraints that come with them, vibe coding was a dream for me (unless you have an extremely powerful server and a "very big" model). But models keep improving, and I'm changing my mind "a little".
My answer today is: yes. But with a few conditions 🙂, and these conditions, or constraints, are not trivial:
- you need a big machine. I ran the experiment on a Mac M5 Max with 128 GB of RAM;
- you need a good enough model: I used Qwen3.8 27B (in
Q4_K_M, served by llmman). Bigger than that, it gets complicated, or even impossible, with this machine, which is already a powerful one; - you need patience: the Mac will get hot (very hot), and it's going to take a while. But it remains doable;
- and you need an agent tuned for this model. That's where Mini Me comes in.
To prove it (at least to myself), I had the agent write a complete library: pov-ray-go, a small ray tracer in Go. I kept the principle of POV-Ray, but the scene is described in Go.
Why a ray tracer?
Because it fascinated me many years ago. POV-Ray (Persistence of Vision Raytracer) is the software where you describe a scene as text (spheres, planes, boxes, materials, lights, a camera), and the engine "casts rays" to compute the image, pixel by pixel. Back then, you started the render and went for a coffee (or several) while waiting to see the image appear line after line.
So it was a good theme to test my coding agent (Mini Me) and its settings:
- it's a serious subject: maths (vectors, 4×4 matrices, ray/object intersections, refraction), parallelism, image encoding;
- it's verifiable: either the image is right, or it isn't. And unit tests can check the simple geometric cases (a ray hitting a sphere head-on, a ray missing it, ...);
- and it's fun, I'm getting back to one of my hobbies from long ago.
The initial prompt
The initial prompt was very simple:
Create a Go library that renders scenes like POV-Ray (ray tracing), with the scene as a Go program using the library, and provide runnable sample programs.
Then I "drove" the agent with very short requests, in French or in English, as you would with any coding agent.
The result
A Go library with zero dependencies (even the PNG encoder is hand-written with the standard library):
- objects:
Sphere,Plane,Box,Group; - transformations (translation, rotation, scaling) with 4×4 matrices;
- materials: color, specular highlights, mirror, glass (refraction);
- procedural textures: checkerboard, gradient, noise;
- a parallel
Renderer(goroutines) with anti-aliasing; - and a
PathTracer(global illumination, soft shadows); - unit tests, 7 examples, and an 8-level tutorial to learn how to make good-looking images.
A scene is simply a Go program:
package main
import (
"go-povray"
)
func main() {
scene := povray.NewScene()
scene.Background = povray.Color{0.45, 0.7, 1.0} // blue sky
scene.AddObject(povray.Sphere{Center: povray.Vec3{0, 2, 0}, Radius: 2},
povray.Material{Diffuse: povray.Red, Specular: povray.White, Shininess: 60, Ambient: 0.2})
scene.AddObject(povray.NewPlaneXY(0),
povray.Material{Diffuse: povray.Gray, Ambient: 0.3})
key := povray.NewLight(povray.Vec3{4, 8, 6}, povray.White)
key.Intensity = 1.6
fill := povray.NewLight(povray.Vec3{-6, 5, 8}, povray.White)
fill.Intensity = 0.7
scene.Lights = []povray.Light{key, fill}
cam := povray.NewCamera(povray.Vec3{0, 2.5, 10})
r := povray.Renderer{Scene: scene, Width: 800, Height: 600, Samples: 2}
img := r.Render(cam)
img.SavePNG("out.png")
}
And here is the render of this example:

And also, a scene generated with loops:

It's not POV-Ray, of course, but for a library written entirely by a local model, I'm rather happy 😃.
How long does it take?
Let's be honest, it's long. Mini Me records its sessions (in .mm/sessions), so I have the numbers:
- 1st session (the library, the transformations, anti-aliasing, path tracing, the tutorial and the handoff): about 2h30, with 94 replies from the model and 89 tool calls (reading/writing files,
go build,go test,go runon the examples, ...); - 2nd session (the textures, the new examples, the commit and the merge): about 1h40.
All that time, the Mac heats up, you can hear the fans, and you have plenty of time to go make yourself a coffee (just like in the POV-Ray days 😉). I even got a generation timed out (stalled) at the start of the second session: just start again.
But in the end, it works: the code compiles, go test ./... passes, and the examples produce their images.
Starting the agent
This is the easy part. You need the model and llmman:
llmman pull hf.co/unsloth/Qwen3.8-27B-GGUF:Q4_K_M # ~17 GB, only once
llmman serve # 127.0.0.1:17434
Then, at the root of the project:
mm tui
That's it. Mini Me detects the agent's configuration in the .mm/ folder by itself:
pov-ray-go/
├── .mm/
│ ├── agent.yaml ← configuration and system prompt
│ ├── skills/ ← new-app, simplify
│ └── sessions/ ← recorded sessions
└── *.go, examples/, docs/ …
How I tuned agent.yaml
This is where the difference between "it goes round in circles" and "it works" is made. A 27B model running locally is not a frontier model in the cloud: you have to prepare the ground for it. Here are the main settings of the .mm/agent.yaml file, and why.
The model and the server
provider: llmman
model: hf.co/unsloth/Qwen3.8-27B-GGUF:Q4_K_M
baseUrl: http://127.0.0.1:17434/v1
# The host's llmman seen from a Docker sandbox (sbx).
fallback: http://host.docker.internal:17434/v1
contextWindow: 0
Why Qwen3.8 27B? It's a dense model with 27 billion parameters and hybrid attention: only 16 of its 64 layers use full attention, which greatly reduces the KV cache. The weights take about 17 GB in Q4_K_M, but using the full native 262,144-token window can add roughly 16 GiB of KV cache in FP16/BF16, not counting other allocations.
contextWindow: 0 asks Mini Me to read the window size from llmman once the model is loaded, instead of hard-coding it. And the fallback lets you use the same configuration from an sbx sandbox.
The system prompt: Qwen Code's
Rather than inventing a system prompt, I started from the one of Qwen Code, the Qwen team's terminal coding agent (under the Apache-2.0 license). The idea is simple: the model was very probably trained to work with this kind of prompt, so you might as well speak "its language". I kept all the sections, in the same order (Core Mandates, Task Management, Software Engineering Tasks, ...), and I only changed what didn't match Mini Me.
Sampling
sampling:
temperature: 0.6
top_p: 0.95
top_k: 20
min_p: 0.0
max_tokens: 32768
parallel_tool_calls: false
temperature: 0.6,top_p: 0.95,top_k: 20: these are the values Qwen recommends for a "thinking" model doing precise work (the GGUF says1.0, for general use). And above all, never0.0with reasoning on: Qwen warns that "greedy" decoding makes reasoning models loop.max_tokens: 32768: one reply is the reasoning plus the answer or a tool call. When the agent writes a whole file withwrite_fileafter thinking for a long time, it needs room, otherwise the reply gets cut in the middle of the file.parallel_tool_calls: false: only one tool call per reply. One step after the other is slower, but much more reliable.
Reasoning
chat_template_kwargs:
enable_thinking: true
reasoning_effort: medium
showThinking: true
By default, Qwen3.8's chat template turns reasoning on in xhigh mode. That's great for quality... but on a local machine, every reasoning token is paid for in time (and in heat 🔥). medium is a good trade-off: with this setting, the agent passed 14 cases out of 14 on my small test bench (fixing a bug, adding a function with its tests, making a clean commit, honestly reporting a failing test, creating a small app, ...).
⚠️ Watch out, the template only accepts low, medium or xhigh (high = xhigh): any other value makes every request fail.
showThinking: true displays the reasoning (dimmed) in the TUI. It's display only, but when a reply takes several minutes to arrive, it's reassuring to see that the model is "thinking" and hasn't crashed. And it's very instructive.
Timeouts
firstTokenTimeout: 5m
watchdogTimeout: 5m
bashTimeout: 5m
With a model of this size, everything is slower. Here, the first question has to load ~17 GB into memory, then read a system prompt of about 6,000 tokens. And a go test or the render of a path-traced example (~40 seconds) takes time. With timeouts that are too short, Mini Me would "cut off" the model while it is working.
The agent loop
maxTurns: 60
maxOutput: 20000
yolo: false
maxTurns: 60: Qwen Code's prompt says "Keep going until the user's query is completely resolved". Implementing a path tracer takes many round trips (write, compile, fix, test, run again): you have to give the agent some leeway.yolo: false: like Qwen Code, the agent asks before every change ([a]once,[s]for the whole session,[r]reject,[n]never).
Context management (the most important setting)
context:
enabled: true
threshold: 30
keepLastTurns: 3
summaryMaxTokens: 2000
This is the setting that makes local vibe coding "bearable". The model has a 262k-token window, but a dense 27B model reads a long prompt slowly: on every turn, the whole history (the system prompt, the files read, the go test output, ...) is read again. The bigger the history, the longer each reply takes to start.
So I ask Mini Me to compress the history as soon as it reaches 30 % of the window (~79k tokens): the older messages are replaced by a structured summary (goal, files touched, decisions, errors met and their fixes, what's done), and the last 3 turns are kept as they are.
The agent remembers its mistakes, without dragging along the 80,000 tokens that produced them.
The extra tools: lsp, skills, sessions
lsp:
servers:
- name: gopls
command: gopls
extensions: [".go"]
# + rust-analyzer, tsc --lsp
skillsDir: .mm/skills
agentsMd:
enabled: true
path: AGENTS.md
sessions:
enabled: true
dir: .mm/sessions
lsp: withgopls, the agent can ask for definitions, references, diagnostics, or do an exact rename, instead of runninggrepand editing by hand. For a local model, that means fewer tokens and fewer mistakes.- The skills
new-appandsimplify, adapted from Qwen Code's. AGENTS.mdfor the project's own rules. This project has noAGENTS.mdfile.- Sessions are recorded: that's what let me resume the work and give you the numbers in this post.
A tip: the handoff file
One last trick, which isn't in agent.yaml but in the way of working: at the end of the first session, I asked the agent "cree un fichier de handoff dans le dossier. Cela nous permettra de reprendre plus tard" ("create a handoff file in the folder. It will let us pick up later").
The result, HANDOFF.md, holds the state of the project, the decisions not to reopen, the useful commands and, above all, a "Known pitfalls (already fell into them, don't fall again)" section. A few days later, the second session started with "read the @HANDOFF.md and @ROADMAP.md then ...", and the agent went straight to the textures, without rediscovering everything. With a local model, every token saved counts: no point making it re-read the whole project.
So, what's the verdict?
Yes, you can vibe code with local models. Not on just any machine, not as fast as with a model in the cloud, and the Mac will get hot. But with a good model like Qwen3.8 27B, a system prompt that speaks the model's language, and an agent tuned for it (medium reasoning, one tool at a time, generous timeouts, aggressive context compression), you get a real library, tested and documented, without a single line of code leaving the machine.
And for me, as a bonus, I found again the pleasure of watching shiny spheres appear on a checkered floor, like many years ago 😊.
The project is here: pov-ray-go, and the agent's full configuration (commented setting by setting) is in .mm/agent.yaml.
That's all for today. See you soon for new experiments with Mini Me (and part 2 of "Can you "vibe code" with local models?").
Written by
Keep reading
Hello Mini Me: an agent born while preparing a talk for Devoxx
Meet Mini Me, a coding agent born from a Devoxx talk on the agent loop, built for small local models with guardrails against loops and hallucinations.

Using Mini Me as a library, thanks to ACP
Drive Mini Me from your own Node.js apps over ACP: ask questions, stream answers, allow or deny tools and cancel requests, with the official SDK and no server.

Mini Me `v2.0.0`: everything that changed since `v1.0.6`
A tour of Mini Me from v1.0.7 to v2.0.0: the .mm project folder, new commands and providers, and the new guardrails that keep small coding models on track.

No comments yet. Be the first to comment!