Repository navigation
feat(vllm): add Qwen3-ASR speech recognition example #15671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Jont828
wants to merge
5
commits into
ai-dynamo:main
Choose a base branch
from
Jont828:qwen-asr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+253
−3
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
feef498
Add Qwen ASR example
Jont828 8c80518
docs(vllm): pass --hf-overrides for Qwen3-ASR streaming
Jont828 e48697c
ci(docs): ignore agg_asr.yaml main-branch link until merge
Jont828 0821e9f
docs(vllm): clarify Qwen3-ASR request model and NIXL transfer
Jont828 7be1663
Merge main into qwen-asr
Jont828 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Aggregated speech recognition (ASR) with Qwen3-ASR. | ||
| # | ||
| # - The frontend runs vLLM's chat processor because the original Qwen3-ASR | ||
| # checkpoints ship no tokenizer.json for the Rust preprocessor. | ||
| # - The frontend and worker run in separate pods, so processed audio features | ||
| # cannot be handed over through shared memory. DYNAMO_DISABLE_NIXL_MM=1 makes | ||
| # the frontend forward the audio URL and the worker load and process it. | ||
| # - The stock image accepts audio at the model's 16 kHz rate. Resampling other | ||
| # rates needs PyAV in both images; see the additional media decoders guide. | ||
| apiVersion: nvidia.com/v1beta1 | ||
| kind: DynamoGraphDeployment | ||
| metadata: | ||
| name: vllm-agg-asr | ||
| spec: | ||
| components: | ||
| - name: Frontend | ||
| podTemplate: | ||
| spec: | ||
| containers: | ||
| - args: | ||
| - --dyn-chat-processor | ||
| - vllm | ||
| command: | ||
| - python3 | ||
| - -m | ||
| - dynamo.frontend | ||
| env: | ||
| - name: DYNAMO_DISABLE_NIXL_MM | ||
| value: "1" | ||
| envFrom: | ||
| - secretRef: | ||
| name: hf-token-secret | ||
| image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:my-tag | ||
| name: main | ||
| replicas: 1 | ||
| type: frontend | ||
| - name: worker | ||
| podTemplate: | ||
| spec: | ||
| containers: | ||
| - args: | ||
| - --model | ||
| - Qwen/Qwen3-ASR-1.7B | ||
| - --enable-multimodal | ||
| command: | ||
| - python3 | ||
| - -m | ||
| - dynamo.vllm | ||
| envFrom: | ||
| - secretRef: | ||
| name: hf-token-secret | ||
| image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:my-tag | ||
| name: main | ||
| resources: | ||
| limits: | ||
| nvidia.com/gpu: "1" | ||
| requests: | ||
| # Increase this value for larger models. | ||
| ephemeral-storage: 10Gi | ||
| workingDir: /workspace/examples/backends/vllm | ||
| replicas: 1 | ||
| type: worker |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Aggregated speech recognition (ASR) serving with Qwen3-ASR | ||
| # | ||
| # Architecture: Single-worker PD (Prefill-Decode) | ||
| # - Frontend: vLLM chat processor (--dyn-chat-processor vllm). The original | ||
| # Qwen3-ASR checkpoints ship vocab.json and merges.txt but no tokenizer.json, | ||
| # which the default Rust preprocessor requires. | ||
| # - Worker: Standard vLLM worker with --enable-multimodal | ||
| # | ||
| # Clients send an audio_url content part to /v1/chat/completions. The model | ||
| # replies with "language <Language><asr_text><transcript>". | ||
| # | ||
| # The stock runtime image decodes WAV/FLAC audio but omits PyAV, which vLLM | ||
| # uses to resample audio to the model's 16 kHz rate. To accept other sample | ||
| # rates, first run: python -m dynamo.common.utils.install_media_decoders vllm | ||
| # | ||
| # For streaming transcription over /v1/realtime, see | ||
| # agg_realtime_transcription.sh. | ||
|
|
||
| set -e | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| source "$SCRIPT_DIR/../../../common/gpu_utils.sh" | ||
| source "$SCRIPT_DIR/../../../common/launch_utils.sh" | ||
|
|
||
| MODEL_NAME="${DYN_MODEL_NAME:-Qwen/Qwen3-ASR-1.7B}" | ||
| CHAT_PROCESSOR="${DYN_CHAT_PROCESSOR:-vllm}" | ||
|
|
||
| EXTRA_ARGS=() | ||
| while [[ $# -gt 0 ]]; do | ||
| case $1 in | ||
| --model) | ||
| MODEL_NAME=$2 | ||
| shift 2 | ||
| ;; | ||
| -h|--help) | ||
| echo "Usage: $0 [OPTIONS] [EXTRA_VLLM_ARGS]" | ||
| echo "Options:" | ||
| echo " --model <model_name> Qwen3-ASR checkpoint to serve (default: $MODEL_NAME)" | ||
| echo " -h, --help Show this help message" | ||
| echo "" | ||
| echo "Any additional arguments are passed through to the vLLM worker." | ||
| echo "Example: $0 --model Qwen/Qwen3-ASR-0.6B --max-model-len 8192" | ||
| exit 0 | ||
| ;; | ||
| *) | ||
| EXTRA_ARGS+=("$1") | ||
| shift | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| trap dynamo_exit_trap EXIT | ||
|
|
||
| HTTP_PORT="${DYN_HTTP_PORT:-8000}" | ||
| GPU_MEM_ARGS=$(build_vllm_gpu_mem_args) | ||
|
|
||
| print_launch_banner --no-curl "Launching Aggregated ASR Serving" "$MODEL_NAME" "$HTTP_PORT" \ | ||
| "Chat proc: $CHAT_PROCESSOR" \ | ||
| "Backend: dynamo.vllm --enable-multimodal" \ | ||
| "Media: audio_url (16 kHz unless PyAV is installed)" | ||
|
|
||
| print_curl_footer <<CURL | ||
| curl http://localhost:${HTTP_PORT}/v1/chat/completions \\ | ||
| -H 'Content-Type: application/json' \\ | ||
| -d '{ | ||
| "model": "${MODEL_NAME}", | ||
| "messages": [{"role": "user", "content": [ | ||
| {"type": "audio_url", "audio_url": {"url": "https://raw.githubusercontent.com/yuekaizhang/Triton-ASR-Client/main/datasets/mini_en/wav/1221-135766-0002.wav"}} | ||
| ]}], | ||
| "max_tokens": 256 | ||
| }' | ||
| CURL | ||
|
|
||
| # dynamo.frontend accepts either --http-port flag or DYN_HTTP_PORT env var (defaults to 8000) | ||
| python -m dynamo.frontend --dyn-chat-processor "$CHAT_PROCESSOR" & | ||
|
|
||
| # Extra args from command line come last to allow overrides | ||
| CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-0} \ | ||
| DYN_SYSTEM_PORT=${DYN_SYSTEM_PORT:-8081} \ | ||
| python -m dynamo.vllm --enable-multimodal --model "$MODEL_NAME" \ | ||
| $GPU_MEM_ARGS \ | ||
| "${EXTRA_ARGS[@]}" & | ||
|
|
||
| # Exit on first process failure; the EXIT trap tears down the rest | ||
| wait_any_exit |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.