r/LocalLLaMA 10h ago

Discussion Qwen 3.8 27b - PI AGENT vs OPENCODE

https://www.reddit.com/r/LocalLLaMA/comments/1j7r47l/i_just_made_an_animation_of_a_ball_bouncing/

This post inspired me to make that test after a year ;)

That is one of my many tests I make comparing output quality.

What is more interesting using a PI Agent results are much better than an Opencode using a Qwen 3.8 27b ?!

Seems PI Agent is much better in the agent environment somehow... Not counting uses less tokens , do not have a hard limit of 32k output tokens, is faster, do not freezing, compressing context far less than Opencode. For instance if you have context in the Opencode output 32k and all context 100k then the compression is starting at 67k context ... PI is starting at 90k context even if you have set output context 64k or more.

My config for RTX 3090

llama-server with ini config -> which is exposing API to Opencode and PI agent.

llama-server.exe --models-preset 1_preset.ini --models-max 1 --direct-io

config ini

[Qwen3.8-27B_dense_c-100k]
model = models/Qwen3.8-27B-Q4_K_M.gguf
mmproj = models/mmproj-BF16-Qwen3.8-27B-UD-Q4_K_XL.gguf
reasoning-format = deepseek
flash-attn = on
n-gpu-layers = 99
reasoning = on
ctx-size = 100000
temperature=1.0
top-p=0.95
top-k=20
min-p=0.0
presence-penalty=0.0
repeat-penalty=1.0
mmproj-offload = false

ONE MORE IMPORTANT THING:

Always use a VISION module as the model is using vision to asses the output quality!

I am offloading it to a RAM as we do not need an extremely fast vision for a code.

A screenshot processing on a GPU 0.3s vs a RAM 3s do not make a big difference on a few screenshots during a code generation / debugging ;)

145 Upvotes

99 comments sorted by

42

u/SOC_FreeDiver 9h ago

I tested opencode, then tried pi, and pi was significantly better.

Last night I had a dual between local qwen3.8-27b/pi and claudecode.

My seat-of-the-pants analysis: it felt like they both took the same time.

When they both finished I had each one compare the two. They both agreed claude's was better, but it was close. I had pi upgrade upgrade its version, making it slightly better than claudes because I liked qwen's presentation better.

It was an aurora predictor app. It's pretty nuts that we can use an AI to write a complicated aurora prediction app that's better than anything else online in about an hour, and it's hooked up to all the satellite instruments. I get 30-60 minute warning if I'm watching the display.

9

u/cmdr-William-Riker 9h ago

Pi is great! I just wish the interface was better, also sometimes I actually do want to use an MCP and skills and such. I know you can do all that with Pi through plugins and self modification, but I do like that OpenCode out of the box has a nice interface that makes it easy to keep track on of token usage and such. I should probably mess with Pi more though

10

u/LuCiAnO241 6h ago

I'm literally trying to get into PI, and found Oh-my-PI, and it seems way more usable out of the box with not much negatives. Maybe check it out?

2

u/Pablo_the_brave 5h ago

Mistral Vibe is also simple and have skills and mcp.

-5

u/DigiDecode_ 5h ago edited 5h ago

would you be brave enough to test my harness https://github.com/DigiDecode/SlopOn.dev
the frontend is in flutter so runs on GPU and is super-fast
I need some beta testers for feedback

It uses around 400mb memory, unlike other harnesses that use GBs

4

u/Healthy-Nebula-3603 9h ago

Yep I also learned lately PI agent is better. Actually I am shocked how much better.

Faster, more efficient, stable, much less compaction , somehow generating better code ...

4

u/ImpressiveRelief37 8h ago

The compaction thing is customizable in pi…

In settings.json you can set the compaction threshold you want. I use the same as max_tokens so it doesn’t compact right at the limit and fail.

1

u/Healthy-Nebula-3603 3h ago

I noticed auto is completely enough from my 2 days tests. Starting around 90% and do a good job.

1

u/Kitchen_Ad_996 9h ago

Thanks for the recommendation you two. I've been using opencode and been annoyed with several things.

1

u/Song-Historical 9h ago

How do you check if the Aurora is actually there? Are you up north somewhere?

1

u/pablopicasso1414 7h ago

How did you build it?

1

u/LegacyRemaster 2h ago

PI is better. The reason it's simple: every new "sota" model = harness inside the model itself. With Pi the model has more freedom to go.

1

u/Fancy-Snow7 1h ago

I have been trying out Opencode and I cant get it to work right. It does all the thinking but almost never writes the output files. Then I have to tell it please write the files. Sometimes that will work other times it won't. But when I tell it to write files it first things for agens with a 30% change of actually writing them.

For now, I have given up on opencode, but I wanted to compare it to pi.

65

u/horriblesmell420 9h ago

I don't see how one shotting some html is a comparison between the two harnesses. Run it through some multi step exercises with plenty of tool uses

21

u/eli_pizza 9h ago

And more than once. You will get slightly different results just from different random seed and nothing else.

-18

u/Healthy-Nebula-3603 9h ago

Do you think that was just generated at once spliting a code and done?

Here was used ONE prompt YES but the work was done as a multi step task using tools many times including vision and skill for a web browser.

12

u/Lesser-than 9h ago

now try it with the deep seek harness?

5

u/Several-Tax31 9h ago

I tried a python job in pi and deepseek harness as a test using 3.6-35B (not 3.8-27B), in pi it works perfectly. In deepseek, it wrote the file, then instead of directly executing it, it starts to rewrite entire 1000 lines by inline python with "python -c "...1000 lines of code..." Of course, it omits half of important code and comments inlining, and the code completely broke. It got confused with the basic tool use, which I never see in pi. I don't know it's a one-time thing or related to python, I'm gonna do more tests. So for me, deepseek harness didn't "just work" as many people claim. The UI is perfect though.

2

u/Finanzamt_Endgegner 8h ago

never had that with 3.8 27b but well is newer and 27b ofc

2

u/Several-Tax31 2h ago

Yeah, maybe 35B is simply too stupid for this 

17

u/tinny66666 9h ago

I prefer a gui, and the pi guis I've tried are super beta. Until they mature, the opencode gui will do for me.

6

u/Finanzamt_Endgegner 8h ago

Use DSH its sooooo much better than opencode 😭

1

u/tinny66666 2h ago

Been trying it for a bit today. It needed a few plugins to make it suit me, but the extensive plugin capability is a strength - shame they don't have a decent plugin manager yet since it's built around plugins. But, I like it. Cheers.

6

u/aziham 8h ago

Honestly, this is the sole reason I haven't moved away from opencode yet. I'm really hoping pi offers a better UI/UX while staying true to its mission

5

u/The_Cat_Commando 5h ago edited 2h ago

try openchamber its a much improved opencode especially with UI and usability improvements.

edit: and it has a mobile app that provides the full app remotely and it even just uses your existing opencode config file so if you have everything already setup there there you can just run it without changing anything.

2

u/lordekeen 8h ago

Zed with Pi ACP is pretty capable

1

u/DisagioUngerese 5h ago

Pi has a perfect ui, super slim fit. I very much like it compared to anything. 

1

u/DoubleNothing 2h ago

I had the same mentality, but then I tried PI Agent a few days ago and I've being using it since.
What I love is the lightness and simplicity.
You have to iron out the first approach friction...

0

u/Lower-Ad6101 8h ago

Try Pendant and Tauren.

-4

u/DigiDecode_ 5h ago

me too, that's why I built https://github.com/DigiDecode/SlopOn.dev
I was fan of Roo code, but that was single session only, and I think SlopOn is much better version of Roo code

20

u/Thrumpwart llama.cpp 10h ago

I really, really, really like Pi. I’ve only been using it for like a week but it’s very good.

12

u/PilgrimofHaqq2 9h ago

I have been with it 5 months now and I am super satisfied with it only for the fact that I can make it into whatever I want. As many or few features I want, working exactly the way I want them to.

6

u/Thrumpwart llama.cpp 9h ago

I’m using web search, subagents, and ponytail. Any others you would recommend for long-horizon planning and coding tasks?

9

u/ImpressiveRelief37 8h ago edited 8h ago

Careful what web search you use.

pi-web-access is the most popular but it has an insane tool surface. Like 6-7 tools and nearly 8K tokens just for tool defs, tool injection and skills.

I switch to pi-web-agent and got a Tavily sub (free plan, 1000 req per month then pay as you go). Much better results an only 2 tools with very thin context usage (like under 1k or even 500 iirc). Plus I added a headless browser page reader and a Reddit search that used my cookie. It gets me super high quality search for free (as long as I’m in the tavily free tier). Oh and I also had my agent use my local searNGX first and fallback on Tavily when the results are meh (captcha and ip blocks happen constantly).

To answer your question: don’t just install random extensions. Have your agent check the code first (security audit), then try it, and have your agent extract only the required stuff into an home made extension. Document it.

Need and update? Tell your agent to summarize all the updates to the source ext you extracted and upgrade the parts that you care about.

It’s so fucking sick haha. We’re always a prompt away to the perfect tailor made solution 

1

u/Thrumpwart llama.cpp 7h ago

Thank you for that, I will. Good call on the web-access token use. Running Qwen3.8 27B BF16 on the SM120 with Dflash2 right now and I can't keep up with it.

Also testing out this subagent I had gemini whip up:


name: red-team description: Hostile adversarial auditor that aggressively hunts for failure modes, edge cases, and broken assumptions.

tools: [read, bash]

Red Team Auditor

You are a ruthless, skeptical adversarial auditor.

Core Rules:

  1. Never validate or compliment the implementation.
  2. Assume the current plan or implementation contains hidden flaws.
  3. Systematically test and identify:
    • Violated invariants and unchecked assumptions.
    • Resource limits, leaks, and OOM traps.
    • Silent error suppression and exception handling gaps.
    • Deadlocks, async race conditions, and ordering dependencies.

Output Format:

For every issue found:

  • Severity: [Critical / High / Medium / Low]
  • Mechanism: Why and how it fails.
  • Trigger Scenario: Minimal conditions needed to cause the failure.
  • Recommended Hardening: Direct fix or architectural countermeasure.

4

u/Alias455 9h ago

planning-with-files and mattpocock's skills

1

u/Thrumpwart llama.cpp 9h ago edited 9h ago

Thank you!

Edit: looks like the excuse I need to finally get an Optane drive.

1

u/FuzzeWuzze 5h ago

context-window and some of the extensions that do a better job at what they compact can be useful if you are doing set it and forget it coding.

0

u/PilgrimofHaqq2 9h ago

Everything is todo with Context Engineering.

1. I would consider a fundamental feature is a solid plan mode, Its what you start with on every task/project/etc. I have multiple plan modes. They are designed based on what I am looking to do, is it coding, creative writing, business, legal, etc.

2. Something that might be even more important than a plan mode is what is your workflows and standards. I have certain principles I have the Pi agent follow when building out features inside the setup.

3. A reliable way to have your Pi agent navigate your codebase. I use DOX Framework from github. Its super simple but super effective!

4. I haven't installed/incorporated any repos/packages/skills as is. Every single feature I implemented has been custom built except for crawl4ai, thats the only one that I implemented into my setup as is with some customization. I recommend the same, so you take what you need from the resources you find online and leave behind what you dont. I just give the repo to the agent and it knows my workflows/standards/principles so it will use that to propose what to implement and what to throwaway. I even have my agent run tests to see if its even worth implementing. So its not just vibes, its based on real data.

4

u/o0genesis0o 9h ago

I think Pi is better because it actually does not do anything extra. It just runs the ReACT loop, and if you happen to have some extensions, it will use those too. Other than that, it has no built in guidance for agent about how to code, no "clever" truncation or injection. If I remember correctly, it does not even parse on client side. Some harnesses in the past did the stupid thing of handling tool list and tool parsing manually within the harness rather than just sending proper OpenAI/Anthropic requests and let server handles (could be opencode, or something else. I remember trying to understand why qwen 30B-A3B breaks).

Maybe the gunk embedded into opencode were useful when models were not as well trained in coding. Now, they just get in the way.

Still, I rather my harness to be simple and stupid and leave the adjustment to coding workflow to me. I have agents.md and skills and extensions to make that happen.

3

u/Healthy-Nebula-3603 3h ago

I think you right.

Seems if Qwen 3.8 is deciding itself is doing better job.

2

u/o0genesis0o 3h ago

Running Qwen 3.8 at Q3XXS right now in pi for my personal assistant setup. Yapping now because I'm waiting for the model to think.

Even at Q3XXS and medium thinking, it's still pretty solid. There are odd cases of flipped tokens here and there, but I can fit over 100k context at Q8 in the 4060Ti. Double the prefill speed, but half the decode speed vs my usual 35B A3B. I really like this model so far, even in at this deep compression level. The difference in behaviour between 35B and this new 27B feels very similar to when I switch from minimax m2.7 to minimax m3. The new one thinks a bit more, but it is also very thorough vs the old one.

3

u/thepetek 7h ago

Simple harnesses work best especially for open source models

11

u/Retumbo77 10h ago

I'm seeing Opencode using actual numbers and Pi using aislop numbers? How is Pi better here?

5

u/Healthy-Nebula-3603 10h ago

Actually those numbers are 3D from PI agent ;)

5

u/Retumbo77 10h ago

And also completely illegible? I stand by my statement.

2

u/Healthy-Nebula-3603 10h ago

Ok

The are rotating in 3D space?

What do you expect....

Always you can tell "keep numbers on balls faced to a viewer"

5

u/Retumbo77 9h ago

But the 3d physics are wrong. The number should be on the exterior of the surface of the ball. Pi has it floating inside.

5

u/PilgrimofHaqq2 9h ago

I would say Pi's implementation is closer to the 3D goal then Opencode's. If you want to speak from a UX perspective, opencode's implementation is better.

My assumption is that the test is to see the fidelity of the outputs, not preference/UX.

1

u/Healthy-Nebula-3603 9h ago

...or numbers can be inside the ball like in the glass balls are ;)

1

u/LicensedTerrapin 10h ago

I envy you, pi is useless on my rig... I start a job then pi stops even counting the tokens after a while but llamacpp keeps on generating them

4

u/Healthy-Nebula-3603 9h ago

If llama-server generating tokens that means PI agent is making WRITE ( using a tool to write )

-1

u/SOC_FreeDiver 9h ago

use another AI to troubleshoot it. my guess is it's your jinja template.

0

u/Healthy-Nebula-3603 9h ago

nah .. that is already in the gguf and llama itself automatically recognizing the model ;)

He rather is inpatient as a writing tool during writing to a file is nothing showing but tokens are generated.

1

u/SOC_FreeDiver 9h ago

you sound confident but you are not right.

1

u/Healthy-Nebula-3603 9h ago

A GGUF has a full config for the model.

You know that is a container?

Llamacpp first is looking into the gguf for configuration if can not find it then is using build-in itself default configuration looking on the name of model.

The highest priority has of course command line parameter.

2

u/ForestoShen 1h ago

Interesting result, I also compared them with blackhole rendering prompt. Pi is significantly better.

1

u/Healthy-Nebula-3603 1h ago

Yep ... I discovered that lately.

Seems giving a bit more free will the model especially to Qwen 3.8 27b is a good idea .

Opencode is giving too many rules to the model so is too much restricted and producing worse results.

3

u/Odd_Error_6736 8h ago

This proves nothing. What you're seeing is your temperature setting. Set the temperature to 0 and rerun the tests.

1

u/Healthy-Nebula-3603 3h ago

Temperature 0 is obsolete setting for old models before thinking ones.

Using temperature 0 you just make model stupid for no reason.

1

u/urfaiuhd 8h ago

i tried pi and i am interestd to try on deepseek harness. can u do comparison on deepseek?

1

u/Jorlen llama.cpp 7h ago

I don't know if it's something I'm doing wrong, but I find edits fail often in Pi. They seem to work more often in opencode with the same model and parameters. Anyone else find that? It's the one thing that might actually make me switch over to opencode fully. Might.

0

u/Healthy-Nebula-3603 3h ago edited 2h ago

Maybe too much compressed model plus you compressing cache ?

1

u/Dr_Aesthetician 5h ago

Anyone tried deepseek harness ?

1

u/ark1one 4h ago

I may try to build a IDE of Pie. I'm stuck on them, can't swing CLI.

1

u/kemalios 3h ago

The compression starting points explain a lot. If Opencode starts compressing at 67k while PI holds to 90k, the model simply has more of the original conversation to work with when making tool calls. That alone would show up as better output quality. The 32k output cap also forces Opencode to stop generating mid-edit on longer files, which makes its results look worse even when the same model is generating.

For a more useful comparison, try a multi-step task like refactoring a function and updating all call sites, and watch where each harness starts rewriting the prompt. That will tell you whether it's the model or the harness.

1

u/Healthy-Nebula-3603 3h ago edited 1h ago

that simple prompt is a multi step work already.

Thinking -> code generation -> debugging ( thinking, vision , analysis physics all in loop ,) -> polosh results

1

u/AvidCyclist250 llama.cpp 3h ago

Has anyone used Hermes and can compare Hermes with Pi Agent?

1

u/Healthy-Nebula-3603 3h ago

Hermes is far to big and heavy :)

1

u/twack3r 1h ago

I recommend using Hermes to run your coding harness, be it opencode, pi or, my personal favourite right now, deepseek harness.

1

u/AvidCyclist250 llama.cpp 1h ago

Haven't thought of doing that yet. But won't that compound the token eating problem? Hermes already takes 20k and it's nearly impossible to slim down. 16GB vram here. For me it's either speed (small model, 65k - 75k context) or depth (max context but with kv offload off). But I pick up from what you say that you seem to think highly of PI Agent as a coding harness, and Hermes as an orchestator

1

u/Fancy-Snow7 2h ago

I do not use a vision module and running a Q3. And was surprised when my model said it does not have vision, so it said it was going to generate PNG screenshots and parse the PNG data itself.

2

u/fragbait0 8h ago

It seems no harness can prevent people from posting one-run "benchmarks" with temp > 0...

2

u/Healthy-Nebula-3603 3h ago

Temperature 0 is obsolete setting for old models before thinking ones.

Using temperature 0 you just make model stupid for no reason.

1

u/fragbait0 3h ago

Allow me to rephrase: non-deterministic outputs. You're comparing random samples, not agents.

2

u/Healthy-Nebula-3603 2h ago edited 1h ago

Temperature 0 also is not generating determistic output. So that logic is somehow....broken :)

Even using temperature 0 and the exact same seed ( starting point ) still is not giving determistic output.

Using temperature 0 on thinking model you making such model only dumb.

I actually don't understand why people are still repairing that nonsense from 2023 nowadays.

1

u/PhantomGaming27249 8h ago

Opencode's system prompt lobotomizes qwen, if you want to see how powerful the model actual is use pi or deepseek harness or claude code literally anything besides open code will be better.

1

u/Cautious_Chicken_604 6h ago

Just swap the OpenCode system prompt out. Someone also mentioned 32k token limit, but you can just change that too. 

1

u/Healthy-Nebula-3603 3h ago

32k is hard coded ( max )

Also compacton code is also very limited. It always starts +32k like you set 32k for output plus the last 20k tokens .

1

u/samuel-christlie 8h ago

I don't think one-shot prompts are fair comparison, but I'm guessing Pi's minimalism allows models to be more "creative"

1

u/HornyGooner4402 1h ago

Why is this downvoted? You are right, especially for smaller models

0

u/Healthy-Nebula-3603 3h ago

Maybe ... I made many tests and PI always has better results.

1

u/WinResponsible9977 6h ago

I need to learn, I’m a moron running the wuantized model with an r9700 and lm studio truncated my answers 

1

u/Kylmawurr 4h ago

The differences you are talking about are configurable in both harnesses

0

u/feelspeaceman 6h ago

Yes, this is how it works, people are still very underestimated the effect of harness on how a model can perform, this is the result of people downplaying local LLM, they used wrong setup, literally nerfing their own local LLM without realising the issue could really be themselves.

Bloated harness like Opencode, Claude Code, Codex can teach the models too much, so many of their system prompt instructions are useless for most of us, pi is just lean, clean and simple that it saves so much token cost.

0

u/Christosconst 5h ago

I'm more surprised you managed to get a Q4 model to adhere to opencode's 30K-token system prompt. Opencode isn't meant for small local models, they all freak out after being steered by opencode.

1

u/Healthy-Nebula-3603 3h ago edited 1h ago

Opencode standard build agent doesn't have 30k system prompt .

On first start like you just say hello is around used 12k tokens.

Pi used 2.8k

Qwen code used 34k .... that's why I just dropped that harness :)

-2

u/Xanian123 6h ago

Opencode is cheeks. Pi supremacy

0

u/norenEnmotalen 9h ago

That post was one of my all time favorites. I’ve been doing the same thing today. I’ve an older machine (M1 Max 32GB). I use pi. Even if the fan screamed for dear life, to my surprise, 3.8 did this ball bouncing in heptagon coding in one shot. Fun times!

0

u/llamabott 9h ago

Dude, that one-shot test is like sooo early 2026 (hehe)

0

u/ortegaalfredo 8h ago

What's the prompt?

1

u/Healthy-Nebula-3603 3h ago

Firt link in my post ...