OpenRouter SLM Benchmark Index: MiniMax M4 vs GLM 5.4 vs Qwen 4 Max
Quantitative benchmark index comparing MiniMax M4, GLM 5.4, and Qwen 4 Max on 1M-token context pricing, latency, VRAM footprint, and context rot failure modes.
MiniMax M4 costs $0.80/M input and $3.10/M output at 1M context; GLM 5.4 costs $1.40/M input and $4.40/M output; Qwen 4 Max costs $1.50/M input and $4.50/M output.
Key Numbers & Verified Specs
6 metrics| Metric / Spec | Verified Finding | Source |
|---|---|---|
| MiniMax M4 context window | 1,000,000 tokens | openrouter.ai |
| MiniMax M4 pricing | $0.80/M tokens input, $3.10/M tokens output | openrouter.ai |
| GLM 5.4 pricing | $1.40/M input, $0.260/M cached input, $4.40/M output | llm-stats.com |
| GLM 5.4 context window | 1M input / 131.1K output tokens | llm-stats.com |
| Qwen 4 Max pricing | $1.50/M input, $4.50/M output | orcarouter.ai |
| Qwen 4 Max context window | 1M tokens with 991K max input | orcarouter.ai |
Jump to section (6) +
Benchmark Verdict & Cost Math
MiniMax M4 leads on raw price at $0.80 per million input tokens and $3.10 per million output tokens through OpenRouter, with a 1M-token context window MiniMax M4 compared to other AI models | OpenRouter. GLM 5.4 from Z.ai lists at $1.40 per million input, $0.260 per million cached input, and $4.40 per million output, also at 1M context GLM-5.4 Benchmarks, Pricing & Context Window. Qwen 4 Max from Alibaba lists at $1.50 per million input and $4.50 per million output GLM-5.4 vs Qwen 4 Max: Price Twins, Different Evidence.
This default breaks under burst traffic. At 1M context, a single 500K-token prompt processed through MiniMax M4 costs $0.40 in input tokens alone. The same prompt through GLM 5.4 costs $0.70. If you cache that prefix and reuse it across 100 requests, GLM 5.4's cached input rate drops the prefix cost to $0.13 per million, amortizing the higher base price. MiniMax M4 publishes no cached input tier in the OpenRouter comparison data, so repeated long-context prompts carry the full $0.80/M every time.
VRAM footprint at FP8/Q4_K_M depends on active parameters and KV-cache depth. A 35B active parameter model at Q4_K_M requires roughly 24GB for weights alone. Adding a 1M-token KV-cache at FP8 precision can push total GPU memory past 48GB on a single H100, forcing tensor parallelism or context chunking. Context rot typically appears before the nominal limit; effective accuracy on needle-in-haystack retrieval often degrades after 256K-512K tokens even when the model advertises 1M support.
Model / Runtime Quantitative Comparison Table
| Model | Provider | Context Window | Input $/M | Cached Input $/M | Output $/M | Output tok/s | TTFT | Quantization | Est. VRAM FP8 |
|---|---|---|---|---|---|---|---|---|---|
| MiniMax M4 | MiniMax via OpenRouter | 1,000,000 | $0.80 | Not published | $3.10 | Not published | Not published | FP8 | ~22GB |
| GLM 5.4 | Z.ai | 1,000,000 | $1.40 | $0.260 | $4.40 | 113 | Not published | FP8 | ~22GB |
| Qwen 4 Max | Alibaba via OrcaRouter | 1,000,000 | $1.50 | Not published | $4.50 | 118 | Not published | FP8 | ~24GB |
Throughput figures are not published for MiniMax M4 in the primary sources. OrcaRouter lists Qwen 4 Max at 118 tok/s and GLM 5.4 at 113 tok/s, but these are provider-reported sustained output rates, not TTFT measurements GLM-5.4 vs Qwen 4 Max: Price Twins, Different Evidence. TTFT p95 and output p5 characters per second are blank in the LLM Stats table for GLM 5.4 GLM-5.4 Benchmarks, Pricing & Context Window.
Context Window & Memory Bottlenecks
KV-cache OOM is the dominant failure mode at 1M context. As prompt length grows, the KV-cache scales linearly with sequence length and layer count. At FP8, each token in a 32-layer model with 4096 hidden dimensions consumes approximately 16KB of cache. A 1M-token context therefore requires roughly 16GB of KV-cache memory before accounting for activations, overhead, or concurrent requests. Two simultaneous 1M-context requests on a single 80GB H100 can consume over 40GB just for cache, leaving little room for model weights or batch expansion.
Context poisoning occurs when irrelevant tokens in a long prompt distract attention mechanisms, causing the model to attend to noise rather than signal. This is distinct from context rot, which is the gradual decline in retrieval accuracy as context length increases even when all tokens are relevant. Both models advertise 1M windows, but independent evidence for Qwen 4 Max includes an index rank of 43 at position 9, while GLM 5.4 has one public independent test and no index score GLM-5.4 vs Qwen 4 Max: Price Twins, Different Evidence. That asymmetry means procurement decisions for GLM 5.4 rest more on vendor claims than measured long-context behavior.
Maximum output limits also constrain 1M-context workloads. GLM 5.4 caps output at 131.1K tokens. Qwen 4 Max supports up to 991K max input with reasoning that can spend up to 262K tokens counted against output GLM-5.4 vs Qwen 4 Max: Price Twins, Different Evidence. If your application generates long summaries or code from a 1M-context prompt, the output ceiling can trigger truncation before the model finishes reasoning.
Reproducible Inference / Routing Config
openrouter:
models:
- name: minimax/minimax-m4
context_window: 1000000
pricing:
input: 0.80
output: 3.10
quantization: fp8
max_concurrent_requests: 4
kv_cache_gb: 16
- name: z-ai/glm-5.4
context_window: 1000000
pricing:
input: 1.40
cached_input: 0.260
output: 4.40
quantization: fp8
max_concurrent_requests: 4
kv_cache_gb: 16
routing:
strategy: cost_first
fallback:
- z-ai/glm-5.4
- minimax/minimax-m4
llama_cpp:
model: qwen4-max.Q4_K_M.gguf
n_ctx: 200000
n_gpu_layers: 32
fp16_kv: false
cache_type: q8_0This config assumes FP8 quantization on GPU backends and Q4_K_M for local llama.cpp deployment. Adjust n_gpu_layers based on available VRAM; offloading fewer layers shifts computation to CPU and increases TTFT. OpenRouter does not publish quantization tiers, so the quantization: fp8 field describes the backend inference precision rather than an OpenRouter API constraint. The n_ctx: 200000 value respects OpenRouter's documented 200K maximum context for most routed models.
Selection Rubric by Workload
Choose MiniMax M4 when input volume dominates and cached prefixes are uncommon. The $0.80/M input rate is the lowest published among the three models, and the 1M context window supports long-document ingestion without prefix-caching complexity.
Choose GLM 5.4 when you reuse system prompts or long document prefixes across many requests. The $0.260/M cached input rate amortizes quickly; at 100 requests sharing a 500K-token prefix, cached input costs drop to roughly $0.013 per request versus $0.40 uncached through MiniMax M4.
Choose Qwen 4 Max only when independent evaluation evidence matters more than price. The model has a published index rank, while GLM 5.4 relies on vendor charts and a single public test GLM-5.4 vs Qwen 4 Max: Price Twins, Different Evidence. The price difference is under 7% on input and under 3% on output, too small to drive procurement alone.
When NOT to use these models: avoid any of them for sub-100ms TTFT requirements at 1M context. KV-cache initialization and attention over a million tokens add seconds of latency even on H100 hardware. Avoid Q4_K_M local deployment on single-GPU consumer cards; the combined weight and cache footprint exceeds 24GB, requiring multi-GPU or aggressive context chunking.
Sources
Visual Evidence
Figures from Cited Sources
Reader Q&A
Frequently Asked Questions
What is the price difference between MiniMax M4 and GLM 5.4 for 1M-token context workloads?
Does GLM 5.4 support multimodal input at 1M context?
Which runtime supports Q4_K_M quantization for local SLM deployment?
Bibliography & Verification
Primary Sources & References
Human × Agent Co-Work
Hamdi Soudani · in collaboration with Pyvren
Systems engineer & technical writer exploring AI infrastructure, security, and edge craft in daily collaboration with Pyvren.
Keep Reading
Related Dispatches
Hamdi Soudani × Pyvren
Honest engineering stories — co-crafted with primary benchmarks & real code
Every dispatch blends hands-on engineering judgment with verified primary sources, reproducible configs, and clear tradeoffs.