OpenCode overrides the samplers for Qwen models to the wrong values

Reddit r/LocalLLaMA Tools

Summary

OpenCode tool incorrectly overrides sampler settings for Qwen models, leading to suboptimal performance due to wrong top-p values. The issue is identified through logging and comparison with other AI inference tools.

This is invisible with llama.cpp or derivatives, but ninfer helpfully logs the sampler settings on each request and auto-configures the correct ones for the model. Basically, OpenCode will always send top-p=1.0 (which means there is no filtering of low-probability tokens except with top-k) instead of the correct 0.95 (thinking) or 0.80 (no-thinking). The commit that added this is supposedly for another fix and has no explanation for the change whatsoever: https://github.com/anomalyco/opencode/commit/0b132c032aae15a99907a5979f471c3b5bb2e3dc You can't easily fix this per/model provider as far as I can tell, though this works, but it will affect all models/providers. "agent": { "build": { "top_p": 0.95 } }
Original Article

Similar Articles

Using Codex instead of Opencode

Reddit r/LocalLLaMA

A user compares the Codex and Opencode AI coding tools, questioning whether to switch given their local setup with Qwen 3.6 27b Q8.

Qwen 3.8 27b - PI AGENT vs OPENCODE

Reddit r/LocalLLaMA

A user compares PI Agent and OpenCode using the Qwen 3.8 27b model, finding PI Agent superior in agent environments with better output quality, less token usage, and improved context handling.