Skip to content

test(e2e): TokenSpeed Qwen3-ASR audio transcription hard gate - #1909

Closed
slin1237 wants to merge 1 commit into
mainfrom
test/e2e-tokenspeed-audio-transcription
Closed

test(e2e): TokenSpeed Qwen3-ASR audio transcription hard gate#1909
slin1237 wants to merge 1 commit into
mainfrom
test/e2e-tokenspeed-audio-transcription

Conversation

@slin1237

@slin1237 slin1237 commented Jul 13, 2026

Copy link
Copy Markdown
Member

Description

Problem

PR #1905 added Qwen3-ASR/Omni audio support served via TokenSpeed, but shipped no e2e coverage for the audio transcription path — the /v1/audio/transcriptions TokenSpeed adapter and the Qwen3-ASR multimodal pipeline had no integration test.

Solution

Add an e2e test that serves Qwen/Qwen3-ASR-1.7B via TokenSpeed and exercises /v1/audio/transcriptions end to end: JSON transcription (200 + non-empty text), response_format=text (plain body), streaming rejection (400), and unsupported-language rejection (400). Reuses the existing 16 kHz WAV fixture; ASR wording is logged (not asserted) to stay robust across model revisions.

Feasibility note: Qwen3-ASR's realtime arch (Qwen3ASRRealtimeGeneration) is vLLM-only; TokenSpeed loads the model's native qwen3_asr config and the servicer advertises AUDIO for qwen3_asr, so this path is servable today.

Changes

  • e2e_test/chat_completions/test_transcription_tokenspeed.py (new): TestTokenSpeedTranscription, gRPC setup_backend fixture, markers @engine("tokenspeed") @gpu(1) @model("Qwen/Qwen3-ASR-1.7B") @e2e @slow.

Test Plan

Runs in the existing e2e-1gpu-chat (tokenspeed) CI lane (test_dirs: e2e_test/chat_completions, E2E_ENGINE=tokenspeed, tier-1 GPU) — no CI-lane change needed; the model is pre-downloaded (tp=1). Locally verified: py_compile + ruff + mypy clean (the e2e itself requires the GPU lane to run).

Checklist
  • cargo +nightly fmt passes (no Rust changes)
  • ruff / mypy clean
  • (Optional) Documentation updated
  • (Optional) Please join us on Slack #sig-smg

Summary by CodeRabbit

  • Tests
    • Added end-to-end coverage for audio transcription requests.
    • Verified successful JSON and plain-text transcription responses.
    • Added validation for appropriate errors when streaming is requested or an unsupported language is provided.

Add an end-to-end test for POST /v1/audio/transcriptions against a
locally-hosted TokenSpeed gRPC worker serving Qwen/Qwen3-ASR-1.7B. This is
the only serving path for the transcription endpoint: the gRPC router's
transcription adapter is Qwen3-ASR only and audio multimodal inputs are
accepted only on TokenSpeed workers (SGLang/vLLM/TRT-LLM reject audio
batches).

The model is wired through the standard setup_backend gRPC fixture with
@pytest.mark.engine("tokenspeed") + @pytest.mark.gpu(1), so it runs in the
existing e2e-1gpu-chat (tokenspeed) lane (the only lane with TokenSpeed
installed) with no CI workflow changes. Requests use raw httpx multipart to
match the gateway's multipart/form-data contract and stay independent of the
OpenAI SDK's streaming/response-format overloads. Reuses the committed
mary_had_lamb_16k.wav fixture from the realtime ASR e2e.

Covers: whole-file json round-trip (200, non-empty text), response_format=text
(plain-text body), streaming rejection (400), and unsupported-language
rejection (400). The exact ASR wording is logged, not asserted, since it
varies by model revision/build.

Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
@github-actions github-actions Bot added the tests Test changes label Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e954acd7-377d-4eb4-9090-ded023c3a6a0

📥 Commits

Reviewing files that changed from the base of the PR and between 4219188 and 9c20396.

📒 Files selected for processing (1)
  • e2e_test/chat_completions/test_transcription_tokenspeed.py

📝 Walkthrough

Walkthrough

Adds a TokenSpeed/Qwen3-ASR-1.7B E2E test module for audio transcription, covering JSON and plain-text responses plus rejection of streaming and unsupported language requests.

Changes

TokenSpeed transcription E2E

Layer / File(s) Summary
Test setup and request helpers
e2e_test/chat_completions/test_transcription_tokenspeed.py
Defines model, audio fixture, timeout, multipart request helpers, gateway access, and TokenSpeed test configuration.
Transcription behavior assertions
e2e_test/chat_completions/test_transcription_tokenspeed.py
Validates successful JSON and plain-text responses, and asserts HTTP 400 for streaming and unsupported language requests.

Estimated code review effort: 3 (Moderate) | ~15 minutes

Suggested reviewers: catherinesue, key4ng, xinyuezhang369

Poem

A rabbit sends a WAV through the gate,
Qwen hears the sounds and answers straight.
JSON hops out, plain text follows near,
Bad streams and languages disappear.
E2E carrots celebrate—hurray!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: a TokenSpeed e2e test for Qwen3-ASR audio transcription.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/e2e-tokenspeed-audio-transcription

Comment @coderabbitai help to get the list of available commands.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the new e2e test for TokenSpeed Qwen3-ASR audio transcription. Clean, well-structured test that follows established patterns (fixture unpacking, markers, httpx multipart). No issues found.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new end-to-end test suite test_transcription_tokenspeed.py to exercise the POST /v1/audio/transcriptions endpoint against a locally-hosted TokenSpeed gRPC worker serving the Qwen3-ASR model. The tests cover successful round-trip transcription, plain-text response formatting, rejection of streaming requests, and rejection of unsupported languages. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c20396076

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

return httpx.post(
f"{base_url}/v1/audio/transcriptions",
files={"file": _audio_part()},
data={"model": MODEL, **data},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the registered model id in transcription requests

When ROUTER_LOCAL_MODEL_PATH resolves this model to a local directory, setup_backend launches and registers the worker under that resolved model_path, while this helper always sends the HuggingFace id. The gRPC worker selection path does an exact model-index lookup, so in those CI/local-cache environments the positive transcription requests can return model_not_found instead of exercising ASR; thread the model_path from setup_backend/the model fixture into the form data instead of hard-coding MODEL.

Useful? React with 👍 / 👎.

@lightseek-bot lightseek-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we use TokenSpeed latest main commit

@slin1237

Copy link
Copy Markdown
Member Author

Closing — this reinvents the e2e request layer (raw httpx + a bespoke gateway fixture) instead of using the standard api_client/model fixtures every chat_completions test uses. Rewriting against the existing infra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants