spec: qwen3-moe-streaming-sse-v1 — follow-up contract to M32d KV cache#1835
Open
noahgift wants to merge 2 commits into
Open
spec: qwen3-moe-streaming-sse-v1 — follow-up contract to M32d KV cache#1835noahgift wants to merge 2 commits into
noahgift wants to merge 2 commits into
Conversation
Registers a new provable contract for per-token SSE streaming on the qwen3_moe chat-completions path. This is the natural follow-up to #1832 (M32d KV cache) — pre-M32d, streaming was meaningless because full-prefill-per-token mode took ~30 minutes per 256-token completion. Post-M32d at 9.62 tok/s sustained, per-token SSE emits become valuable for chat UX. ## Falsification gates - V1_001: chat-completions with stream=true emits per-token SSE events (not buffered into pregenerated SSE) - V1_002: stream=false still returns a single JSON response (regression) - V1_003: streaming throughput ≥ 2 tok/s median inter-event time ## Implementation phases (engineer playbook) - Phase 1 (~2hr): callback variant of run_qwen3_moe_generate - Phase 2 (~4hr): wire into try_qwen3_moe_backend in cuda_chat_backend.rs - Phase 3 (~2hr): cargo integration test Total ~6-8 hours, operator-actionable once #1832 merges. NOT in scope: - MoE inference correctness (covered by qwen3-moe-serve-dispatch-v1) - KV cache mechanics (M32d / #1832) - Streaming for dense models (already exists via OwnedQuantizedModelCachedSync) - Tool-call streaming (separate contract) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Registers a new provable contract `qwen3-moe-streaming-sse-v1` for per-token SSE streaming on the qwen3_moe chat-completions path. Natural follow-up to #1832 (M32d KV cache).
Why now
Pre-M32d, streaming SSE was meaningless on qwen3_moe — full-prefill-per-token mode at ~0.5 tok/s meant the client would see no output for ~30 minutes before all 256 tokens arrived at once. Post-M32d at 9.62 tok/s sustained, per-token emits become valuable for chat UX.
Contract gates
Implementation phases (engineer playbook)
Total ~6-8 hours; operator-actionable once #1832 merges.
NOT in scope
Test plan
🤖 Generated with Claude Code