Skip to content

Commit 1b15e1a

Browse files
Chanun Chirattikanonclaude
authored andcommitted
Add community research on MiniMax-M2 latency to opencode-analysis.md
Documents Reddit/GitHub/blog findings: the 30x OpenCode latency is a generic MiniMax-M2 family issue (not JANGTQ-specific), no working disable-thinking switch exists, and anomalyco/opencode#3555 is the directly relevant tracker. Adds mitigations ranked by community effectiveness and hardware profiles of setups not hitting the wall. Co-Authored-By: Claude Opus 4.7 <[email protected]>
1 parent aff87bc commit 1b15e1a

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

‎docs/clients/opencode-analysis.md‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,56 @@ working efficiently. The latency difference is entirely token-count driven.
109109

110110
---
111111

112+
## Community research (2026-04-20)
113+
114+
Researched Reddit (r/LocalLLaMA), GitHub (MiniMax-AI/MiniMax-M2, sst/opencode, vllm-project/vllm, can1357/oh-my-pi), HuggingFace discussions, and blog posts for others running MiniMax-M2 / M2.5 / M2.7 with OpenCode, Pi, Claude Code, aider, or Cline.
115+
116+
### Headline findings
117+
118+
- The 30× agent-loop latency blowup is **the generic MiniMax-M2 family problem**, not a JANGTQ or MiniMax-M2.7 quirk. Reproduces on SGLang, vLLM, Ollama, LM Studio, and OpenCode regardless of quantization.
119+
- **No working "disable thinking" switch exists** as of April 2026. `/nothink`, `enable_thinking: false`, and Pi's `thinking: off` are explicitly ignored by the model ([oh-my-pi#626](https://github.com/can1357/oh-my-pi/issues/626), [MiniMax-M2#68](https://github.com/MiniMax-AI/MiniMax-M2/issues/68)).
120+
- **Zero public reports on `dealignai/MiniMax-M2.7-JANGTQ-CRACK` specifically.** This Mac Studio + vmlx + OpenCode combination appears unique in the public record. The HF page has a single open discussion and it is about file-size accounting, not latency.
121+
122+
### Key evidence from the community
123+
124+
- **[MiniMax-M2#77](https://github.com/MiniMax-AI/MiniMax-M2/issues/77)** — 29-case agent benchmark (M2.5): simple greeting 2.2 s vs Qwen Plus 0.76 s; file read 15.1 s vs 2.9 s; disk space query **195 s vs 0.6 s (325× slower)**. Root cause explicitly identified as `<think>` "adds verification steps even after a task is already complete."
125+
- **[MiniMax-M2#52](https://github.com/MiniMax-AI/MiniMax-M2/issues/52)** — SGLang: "`<think>` consumes nearly all `max_tokens`; 'LOW reasoning mode' system prompts did not prevent excessive thinking."
126+
- **[sst/opencode#3555](https://github.com/sst/opencode/issues/3555)** — **directly relevant to this setup**: OpenCode's OpenAI-compatible mode leaves `<think>` inside `delta.content` instead of routing it to `delta.reasoning_content`. The think block then re-enters the next agent turn as regular content, compounding the blowup across all 4 loop turns.
127+
- **[vllm-project/vllm#34625](https://github.com/vllm-project/vllm/issues/34625)** — the `minimax_m2_append_think` parser is itself broken when the think tag shares a token boundary.
128+
- **[purplemaia blog — From Benchmarks to Builders](https://blog.labs.purplemaia.org/from-benchmarks-to-builders-running-minimax-m2-1-on-our-mac-studio/)** — Mac Studio M3 Ultra **512 GB** running MiniMax-M2.1 on LM Studio (MLX 5-bit) ran the Harbor terminal-bench suite 11/18. Toggling LM Studio's "Separate reasoning from content" on MLX **caused a 10× slowdown and 5/10 timeouts** — a reasoning-parser misconfiguration hazard worth noting on Apple Silicon.
129+
130+
### Mitigations ranked by reported effectiveness
131+
132+
1. **Trim the agent system prompt.** MiniMax's own docs say: *"When using tools that support context compression (such as Claude Code), it's recommended to control the number of tokens in system prompts. M2.7 may terminate tasks early when approaching context capacity thresholds."* — [platform.minimax.io best-practices](https://platform.minimax.io/docs/token-plan/best-practices). This is the single biggest lever the community agrees on.
133+
2. **Server-side reasoning parser.** vLLM's recommended flags: `--reasoning-parser minimax_m2_append_think --tool-call-parser minimax_m2 --enable-auto-tool-choice` ([vLLM recipe](https://docs.vllm.ai/projects/recipes/en/latest/MiniMax/MiniMax-M2.html)). Moves `<think>` into a separate `reasoning_content` field so clients can strip it before the next turn. **Unknown whether vmlx exposes an equivalent flag** — worth checking before the next deploy.
134+
3. **Client-side strip of `<think>…</think>`** from prior turns before re-sending the conversation. OpenCode does not do this automatically (#3555).
135+
4. **`max_tokens` caps.** Widely tried, widely reported as partial at best — the model can hit the cap mid-think and still return nothing useful.
136+
5. **Prompt-side `/nothink` / `enable_thinking: false`.** Confirmed **ineffective** on MiniMax-M2 family. Do not rely on it.
137+
138+
### Hardware profiles of people not hitting the latency wall
139+
140+
| Setup | Stack | Notes |
141+
|-------|-------|-------|
142+
| Mac Studio M3 Ultra 512 GB | LM Studio v0.4, MLX 5-bit, MiniMax-M2.1 | 11/18 on Harbor terminal-bench; reported more stable than vllm-mlx. 5× our RAM. |
143+
| 4× H100 (TP4+EP4) or 2× B200 | vLLM with official reasoning parser | Official recommended config; 400 K KV cache. |
144+
| OpenRouter hosted API | MiniMax-hosted server with proper parser | `reasoning.effort=high` stable at ~1,000 think tokens per turn — same weights, parser is the difference. |
145+
| Cline v3.35 on hosted MiniMax-M2 | Native tool-calling, not OpenAI-compat | ~100 tok/s reported against the hosted endpoint. |
146+
147+
### Implications for this setup
148+
149+
- Your 80 s OpenCode latency is a **known OpenCode-specific compounding** of the generic MiniMax-M2 thinking problem. sst/opencode#3555 is the tracker to follow.
150+
- Two concrete next steps worth trying:
151+
1. Check whether `vmlx_engine` exposes an equivalent of vLLM's `--reasoning-parser minimax_m2_append_think` flag. If yes, OpenCode's `reasoning_content` handling may already route correctly and the per-turn think cost should drop.
152+
2. If OpenCode's agent system prompt is configurable, trim it aggressively — this is the community's single strongest recommendation, straight from MiniMax's own docs.
153+
- Hermes 4 70B on vllm-mlx (no reasoning overhead) remains the right choice for short interactive OpenCode turns until one of the above lands.
154+
155+
---
156+
112157
## See Also
113158

114159
- [`docs/server/vmlx/summary.md`](../server/vmlx/summary.md) — vmlx server overview and perf numbers
115160
- [`docs/server/vmlx/maintenance.md`](../server/vmlx/maintenance.md) — start/stop/switch commands
116161
- [`docs/clients/opencode-setup.md`](opencode-setup.md) — OpenCode installation and configuration
162+
- [sst/opencode#3555](https://github.com/sst/opencode/issues/3555) — OpenCode `<think>` handling in OpenAI-compat mode
163+
- [MiniMax-AI/MiniMax-M2#77](https://github.com/MiniMax-AI/MiniMax-M2/issues/77) — 29-case agent benchmark showing 325× regression on trivial prompts
164+
- [vLLM MiniMax-M2 recipe](https://docs.vllm.ai/projects/recipes/en/latest/MiniMax/MiniMax-M2.html) — the recommended server-side parser config

0 commit comments

Comments
 (0)