Repository navigation
[Showcase & Fix] Qwen3.8-Flash-Next on Dual RTX 5090 Blackwell + Tool Call Recovery Patch #324
Description
Hey FreeToken team! 👋
First of all, huge congratulations on FreeToken. The dynamic MoE offloading and hybrid memory architecture is phenomenal for serving 100B+ frontier models on consumer workstations.
We wanted to share our 24/7 production setup, real-world benchmarks, architecture insights, and a key bugfix for Qwen3 / Qwen3.8 tool calling under agent harnesses.
🖥️ 1. Hardware Topology & Coexistence
- Host: Proxmox VE 9.2 (IOMMU PCIe passthrough)
- VM: Ubuntu 26.04 LTS (28 vCPUs, 136 GB DDR5 RAM, 39 GB NVMe Swap)
- GPUs: Dual NVIDIA GeForce RTX 5090 Blackwell (2 × 32 GB VRAM, SM120, Driver 595.84, CUDA 13.2)
- Target Model:
RadixArk/Qwen3.8-Flash-Next-NVFP4(176.9B MoE + 51B PLE, 63.3 GB Host Expert Tables)
Multi-Engine Isolation:
- GPU 0 (32 GB): Dedicated to FreeToken serving
Qwen3.8-Flash-Next-NVFP4(29.2 GB VRAM allocated + 63.3 GB Host RAM). - GPU 1 (32 GB): Dedicated to SGLang serving
Qwen3.8-27B-NVFP4(Dense coding model with FP8 FlashInfer KV Cache). - Both run concurrently 24/7 with zero PCIe bus contention or host RAM exhaustion (~39 GB OS/ARC margin left).
⚡ 2. Production Service Parameters (256K Context)
ft serve \
--model /home/chris/models/Qwen3.8-Flash-Next-NVFP4 \
--gpu 0 \
--host 0.0.0.0 \
--port 1919 \
--served-model-name RadixArk/Qwen3.8-Flash-Next-NVFP4 \
--memory-ratio 0.90 \
--expert-load parallel \
--moe-cache-auto \
--kv-reserve-tokens 262144 \
--max-seq-len-override 262144 \
--max-output-tokens 65536 \
--max-prefill-length 8192 \
--reasoning-parser qwen3 \
--tool-call-parser qwen3_coder- KV Cache Allocation: FreeToken allocates 262,208 tokens (6.19 GiB VRAM) with
moe_cache_size=3284andnum_pages=4097. - CUDA Graphs: Successfully captures CUDA graphs for batch sizes
[1, 2, 4]with 2.82 GiB free GPU headroom. - Triton Kernels: Triton Native RoPE and sampling execute smoothly on Blackwell SM120 without FlashInfer JIT compiler stalls.
🛠️ 3. Bug Fix: Unclosed <think> Swallowing Tool Calls
When using Qwen3.8 with autonomous coding agents (DeepSeek Harness / DSH Desktop, OpenCode), the model occasionally skips emitting </think> before generating <tool_call><function=...> XML tags.
The Issue:
In freetoken/server/reasoning_parser.py, ThinkReasoningParser had no tool_start_token defined. Because of this, the streaming parser treated the entire <tool_call>...</tool_call> block as part of reasoning_content (thinking). The downstream client never received the structured OpenAI tool_calls payload and halted execution.
The Fix:
Adding tool_start_token="<tool_call>" to ThinkReasoningParser:
class ThinkReasoningParser(BaseReasoningParser):
def __init__(
self,
force_reasoning: bool = False,
stream_reasoning: bool = True,
tool_start_token: Optional[str] = "<tool_call>",
) -> None:
super().__init__(
think_start_token=THINK_START_TOKEN,
think_end_token=THINK_END_TOKEN,
force_reasoning=force_reasoning,
stream_reasoning=stream_reasoning,
tool_start_token=tool_start_token,
)With this patch, reasoning is closed immediately when <tool_call> appears, and the call is emitted properly as ToolCallItem with finish_reason: "tool_calls".
👁️ 4. Multimodal Vision & Agent Performance
- Vision: 27-layer ViT visual tower loads and processes high-res screenshots via OpenAI
/v1/chat/completionsimage_urlpayloads flawlessly. - TTFT: ~3.0s – 3.5s with large system prompt tool catalogs.
- Decode Speed: ~38–54 tok/s with offloaded MoE parallel expert retrieval on DDR5 host memory.
- Stability: 100% stable in long multi-turn sessions exceeding 100K+ context.
Happy to open a PR for the reasoning parser fix if you'd like to merge it into upstream!
Activity
obitodaitu commentedon Sep 1, 2026
merge quickly
AI-Anarkan commentedon Sep 1, 2026
🚀 Full Stack Breakthrough: 524K Context, Radix GDN Caching & The Dual RTX 5090 Hybrid MoE Architecture
Hey @FlashML-org team! 👋
We wanted to drop a major technical update on our 24/7 production AI workstation.
Over the past few days, we cross-pollinated optimizations from the speculative drafting ecosystem (specifically adapting concepts from
syv-ai/qwen38-27b-rtx3090to Blackwell SM120) and combined them with FreeToken's cutting-edge MoE runtime.The results blew our expectations away: we achieved 524,288 tokens (524K full context) on FreeToken 176.9B, sub-millisecond multi-turn prefill via Radix GDN Caching, and built an ultra-high-throughput dual-GPU pipeline reaching 215–350+ tok/s decode on our companion coding engine.
Here is the complete architectural deep-dive, hardware benchmarks, and production config.
🏗️ 1. Workstation Hardware & Dual-GPU Topology
We run on Proxmox VE 9.2 (IOMMU PCIe 4.0/5.0 Passthrough) inside an Ubuntu 26.04 LTS guest with strict kernel isolation:
Both engines co-exist in total memory isolation without PCIe lane starvation or host RAM exhaustion (~32 GB safety margin under full concurrent load).
⚡ 2. FreeToken 176.9B MoE: Breakthrough Optimizations
Production Service Configuration (
:1919)The 4 Levers That Multiplied Our Performance:
Radix Prefix Caching GDN-Aware (
--cache-type radix+--enable-cache-report)Autonomous coding agents prepend 1.5k–4k tokens of system prompt, skill instructions, and tool catalogs on every turn.
MoE Prefill Hit D2D (
--moe-prefill-hit-d2d)Uses
cudaMemcpyBatchAsyncon CUDA 13.2+ for GPU resident experts. When prompt tokens hit cached experts, the transfer bypasses the host PCIe bus entirely, keeping PCIe bandwidth free for miss streaming.Tool-Call Decode Checkpointing (
--enable-special-token-ckpt)Preserves the recurrent decode state right at the
<tool_call>boundary. When an agent executes bash/python/MCP tools and returns the output, the context resumes cleanly without invalidating preceding tokens.DMA & Host RAM Calibration (
ft bench bw --dtype nvfp4 --gpu 0)53.0 GB/s28.9 / 28.7 GB/s47.2 GB/s🏎️ 3. The Companion Engine: Qwen3.8-27B DFlash2 ($k=7$ ) on GPU 1
Inspired by the non-autoregressive speculative decoding architecture in
syv-ai/qwen38-27b-rtx3090, we built a dedicated 256K instance on RTX 5090 #2 (GPU 1):Qwen3.8-27B-W4A16-AutoRound-fast(Marlin INT4 GEMMs)DFlash2-W4A16(int8_per_token_headscales (262,144 tokens full context).VISION=1,MAX_IMAGES=8) with CPU offload (VLLM_VISION_CPU_OFFLOAD_GB=1).Live Real-World Benchmarks:
216.7 tok/sstable decode (4.73s total generation time).LOOKUP=1): Blazes up to350+ tok/son refactoring and repetitive codebase tasks.📊 4. Full Production Cluster Summary
524,288(524K)216.7 – 350+ tok/s262,144(256K)120 – 160+ tok/s131,072(128K)🎯 Final Thoughts
What the FreeToken team achieved with ZeroTable host SHM mapping and parallel offloaded MoE execution is unprecedented. Combining it with Radix Prefix Caching, D2D batch copy, and Tool-Call Checkpointing turns a single consumer RTX 5090 into an industrial-grade frontier model server with a massive 524K context window.
Kudos to the maintainers! We hope these parameters and benchmark insights help the community push their hardware to the absolute maximum. 🔥