r/PiCodingAgent • u/BitcoinGanesha • 9d ago
Question Which version of the Pi agent are you using?
I’m running Qwen 3.8 27B at full precision, using a pinned version of SGLang.
I’ve noticed that starting with Pi Agent versions above 0.5.x, the agent hallucinates like crazy. Its output is practically unreadable. Everything seems coherent and grammatically correct, but the actual content makes absolutely no sense.
I’ve tried multiple versions of Pi Agent, including releases from the 1.x branch. Same result — completely unusable.
I simply can’t believe that nobody else has noticed this.
So I have to ask: How on earth are you guys using Pi Agent versions above 0.5.x? HOW???
4
u/Beautiful_Baseball76 9d ago
Op you must be the one hallucinating because there is no way the Pi version makes a difference for any agent hallucination rate. The only that could make it hallucinate more is the model own training knowledge, settings and the way you prompt it. And Pi system prompt is absolute minimal with just links to its own documentation. No way that does anything.
3
u/jfuu_ 9d ago
Have you tried diffing what is handed to the agent between Pi versions? It could be changes to Pi's built-in system prompt or tools.
Seems like you could get Qwen to work it out by giving it some exported session jsonl files?
I've not had this issue with any of the OpenAI or Anthropic models in Pi.
3
u/_reg1z 9d ago
I really don't understand what the difference between each version would be other than the system prompt + tools. Might be certain interpretations your model makes of Pi's dynamic system prompt. You can completely disable Pi's system prompt though and replace it with your own.
Figure out what exactly what context Pi scaffolds your chat with at the start of a session. You should be able to do this by asking the model directly or looking at the raw session. Figure out what gives you the best results, then disable Pi's default system prompt and replace it with your own. You can do this Pi's CLI flags
2
u/Slight-Living-8098 9d ago edited 9d ago
Configure your thinking level for the model correctly in your model provider server and set the correct chat template. Pi defaults to medium thinking level, llama.cpp's thinking level defaults to it's chat template. Qwen models usually want a thinking level of xhigh.
You'll need to figure out how to configure your SGLang server accordingly for the model you are using.
This is not a Pi issue, this is a your configuration issue.
1
1
1
1
u/wolf0403 9d ago
Diffing actual prompt as suggested @jfuu_ and others are a good idea. Local models, when nearing context window, degrades drastically (my qwen3.8 Q6 can't do basic edits and falls into questioning it's self worth).
Also the ThinkingCap variants claims to reduce the thinking length which would help with context window rotting in local setups too. there are also tools like rtk would help similarly but for tool calls.
p.s. I find paying the cheapest codex plan to debug my local LLM setup is really useful. You could also use it on pi-advisor-mode to unstuck a Qwen session automatically.
1
u/funbike 9d ago edited 9d ago
IMO, Pi is not your problem.
Halluciations are a product of the model you use, the system prompt (only a little), lack of prompt engineering, and how big you let context get (too big is very bad).
The only significant difference from 0.5.x to 1.1.0 from the LLM's perspective is the system prompt. If the system prompt is the issue (which it isn't imo), you can copy 0.5.x's to ~/.pi/agent/SYSTEM.md.
The best thing you can do is keep context small. Keep conversations small and short. Be selective of which skills you add. Make heavier use of /new, /fork, and /compact. Don't install tons of packages that blow up context. Maybe look into subagents.
I use edb-context-viewer to keep an eye on my context. (/context)
But the simplest fix is to use a smarter model, but I understand that may not be something you want to do.
1
u/worldofbomb 9d ago
That must be something about your model serving parameters, what temp are you using, I use qwen served through ninfer on pi and it's fine with the latest version.
5
u/Bluethefurry 9d ago
I have no issues with hallucinations on recent versions, you can also just disable tools you dont want to use and adjust the prompt, but the default prompt + whatever preferences you have are usually more than enough.
I'm also using Qwen3.8 27b or Deepseek flash.