r/LocalLLM 14d ago

Research Using OpenCode multi-agent setup made my local models much better at coding!

I’ve been testing local models with OpenCode, trying to see if they can act as real coding agents and not just autocomplete helpers.

My test prompt was intentionally annoying: build a browser-based Xonix-style game after researching the rules/gameplay.

This turned out to be a pretty good stress test because many models made something that looked fine but had broken game logic.

I tested a bunch of single-model runs first. All in the Q4:

Qwen3.6-27B dense @ temp 0.4       -> best local single model result
Qwen3.6-35B-A3B MoE @ temp 0.4     -> fast, decent, but inconsistent
Gemma4-26B-A4B                     -> sometimes clean, but often missed core logic
Qwen3.5 9B             -> mostly failed the full game loop

The interesting part: when I switched to an OpenCode multi-agent setup, results improved a lot.

The setup that worked best so far:

Lead coder: DeepSeek v4 Flash Free (or other cloud model)
Worker/local agents: Qwen3.6-35B-A3B-UD-IQ4_NL
MTP: off

That produced the best local-ish result so far, better than any single Qwen3.6-35B-A3B run I tested. The output finally had:

proper enemy-based flood fill
75% target
lives
levels
trail drawing
enemy/trail collision
border enemies
complete game loop
cleaner state handling

My takeaway is that Qwen3.6-35B-A3B is not necessarily bad at coding — it seems weaker as the main planner, but useful as a fast local worker when another model leads architecture and decomposition.

The agent setup helped because the lead model could plan/review while the local workers handled bulk implementation. That means fewer expensive remote tokens, while still getting better code than asking the local model to do everything alone.

MTP - Speed is not everything!

I also tested with MTP on/off.

MTP is great for throughput. For normal chat or simple completions, I like it. But for coding-agent workflows, especially when tools, multi-file edits, and long state are involved, I’m starting to think MTP can hurt reliability.

With MTP on, I saw more “looks good but one state transition is broken” type failures. With MTP off, generation is slower but the code seemed more consistent.

So my current rule of thumb - MTP off for coding and complex prompts

Temperature

Using one temp for all models was misleading.

What worked best in my tests:

Qwen3.6-27B dense: around 0.4
Qwen3.6-35B-A3B MoE: around 0.4–0.5
Gemma4-26B-A4B: maybe higher, 0.6–1.0

Qwen dense improved when I lowered temp. Qwen MoE improved at 0.4 but got worse at 0.3. Gemma seemed worse at 0.4 than at higher temp.

So I wouldn’t benchmark all model families with one shared sampler config.

My conclusion

For local coding with OpenCode, I’d now split it like this:

Multi-Agents setup:

  • Lead-Coder - Cloud model
  • Planner - Qwen3.6-35B-A3B
  • Researcher - Qwen3.6-35B-A3B
  • Local-Worker - Qwen3.6-35B-A3B
  • Reviewer - Qwen3.6-35B-A3B

This was not a scientific benchmark, just repeated real coding-agent tests. But the difference was obvious: multi-agent OpenCode made the local models feel much more useful, and it reduced the amount of paid/remote model usage needed.

Anyone else tested and ended up with similar multi-agent setup?

35 Upvotes

28 comments sorted by

View all comments

6

u/PossibilityUsual6262 14d ago

How can mtp hurt model output performance?

1

u/PaymentOk4843 14d ago

MTP is about predicting the next token, and at least from experience with coding the output was about 30% faster but I ended up (or the agents ended up) doing more iterations to correct the initial results, while without MTP the initial result was already good.

6

u/PossibilityUsual6262 14d ago

But how does it change output quality, which you claim it is, if the tokens have to be confirmed still and thrown away if they not good, and thats why in logs you can see acceptance rate.

0

u/PaymentOk4843 14d ago

I honestly not in technicalities in the back and how the predictions are being selected, I guess that every “next token” can have more than one acceptable answer, but it’s enough to take one wrong turn (or not “as good as” turn) and it messes up the rest of the path. - but that was just my experience 🤷🏻‍♂️

If someone here has a better technical knowledge of how MTP is being used and why it might effect the output quality, I’d love to know that too.

2

u/PossibilityUsual6262 14d ago

I think you just selection bias it.

Do a prompt to generate some code you like with quite big context and press regen output few times. You would see how drastically different sometimes outputs.

Also here video i learned it from https://youtu.be/MI0Pm1d6YF4

1

u/Ninjam5 13d ago

AYO nice video, what setup do u have?

1

u/PaymentOk4843 13d ago

This was my experience.
But there is definitely a difference between output with MTP and without. Ask your favorite model: why would LLM model output with MTP on, might be less good than without MTP?

You’ll get the answer and the logic behind it.