-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Add docs for audio models #573
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
Draft
lkomali
wants to merge
6
commits into
main
Choose a base branch
from
lkomali/add-audio-endpoint-docs
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.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
938ccb4
feat: Add Audio endpoint docs
lkomali acc9f3d
fix: fix year in copyright
lkomali ec98485
fix: change model
lkomali e458e8c
fix: add docs testing tags
lkomali 3be7d5e
fix: fix docker command
lkomali 0fbc6b2
feat: add more examples
lkomali 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| <!-- | ||
| SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| # Profile Audio Language Models with AIPerf | ||
|
|
||
| AIPerf supports benchmarking Audio Language Models that process audio inputs with optional text prompts. | ||
|
|
||
| This guide covers profiling audio models using OpenAI-compatible chat completions endpoints with vLLM. | ||
|
|
||
| --- | ||
|
|
||
| ## Start a vLLM Server | ||
|
|
||
| Launch the vLLM server with Qwen2-Audio-7B-Instruct: | ||
|
|
||
| <!-- setup-vllm-audio-openai-endpoint-server --> | ||
| ```bash | ||
| docker pull vllm/vllm-openai:latest | ||
| docker run --gpus all -p 8000:8000 vllm/vllm-openai:latest \ | ||
| --model Qwen/Qwen2-Audio-7B-Instruct \ | ||
| --trust-remote-code | ||
| ``` | ||
| <!-- /setup-vllm-audio-openai-endpoint-server --> | ||
|
|
||
|
|
||
| Verify the server is ready: | ||
|
|
||
| <!-- health-check-vllm-audio-openai-endpoint-server --> | ||
| ```bash | ||
| curl -s http://localhost:8000/v1/chat/completions \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "model": "Qwen/Qwen2-Audio-7B-Instruct", | ||
| "messages": [{"role": "user", "content": "Hello"}], | ||
| "max_tokens": 10 | ||
| }' | jq | ||
| ``` | ||
| <!-- /health-check-vllm-audio-openai-endpoint-server --> | ||
|
|
||
| --- | ||
|
|
||
| ## Profile with Synthetic Audio | ||
|
|
||
| AIPerf can generate synthetic audio for benchmarking: | ||
|
|
||
| <!-- aiperf-run-vllm-audio-openai-endpoint-server --> | ||
| ```bash | ||
| aiperf profile \ | ||
| --model Qwen/Qwen2-Audio-7B-Instruct \ | ||
| --endpoint-type chat \ | ||
| --audio-length-mean 5.0 \ | ||
| --audio-format wav \ | ||
| --audio-sample-rates 16 \ | ||
| --streaming \ | ||
| --url localhost:8000 \ | ||
| --request-count 20 \ | ||
| --concurrency 4 | ||
| ``` | ||
| <!-- /aiperf-run-vllm-audio-openai-endpoint-server --> | ||
|
|
||
| To add text prompts alongside audio, include `--synthetic-input-tokens-mean 100` | ||
|
|
||
| ## Profile with Custom Input File | ||
|
|
||
| Create a JSONL file with audio data and optional text prompts. | ||
|
|
||
| <!-- aiperf-run-vllm-audio-openai-endpoint-server --> | ||
| ```bash | ||
| cat <<EOF > inputs.jsonl | ||
| {"texts": ["Transcribe this audio."], "audios": ["wav,UklGRiIFAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0Yf4EAAD..."]} | ||
| {"texts": ["What is being said in this recording?"], "audios": ["mp3,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4Ljc2LjEwMAAAAAAAAAAA..."]} | ||
| {"texts": ["Summarize the main points from this audio."], "audios": ["wav,UklGRooGAABXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YWY..."]} | ||
| EOF | ||
| ``` | ||
| <!-- /aiperf-run-vllm-audio-openai-endpoint-server --> | ||
|
|
||
| The audio data format is: `{format},{base64_encoded_audio_data}` where: | ||
| - `format`: Either `wav` or `mp3` | ||
| - `base64_encoded_audio_data`: Base64-encoded audio file content | ||
|
|
||
| Run AIPerf using the custom input file: | ||
|
|
||
| <!-- aiperf-run-vllm-audio-openai-endpoint-server --> | ||
| ```bash | ||
| aiperf profile \ | ||
| --model Qwen/Qwen2-Audio-7B-Instruct \ | ||
| --endpoint-type chat \ | ||
| --input-file inputs.jsonl \ | ||
| --custom-dataset-type single_turn \ | ||
| --streaming \ | ||
| --url localhost:8000 \ | ||
| --request-count 3 | ||
| ``` | ||
| <!-- /aiperf-run-vllm-audio-openai-endpoint-server --> | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
...are just placeholders because the data is long right? might want to mention thatThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we actually support loading audio from file and converting to base64 automatically, may want to include that, or just change to that. though idk how that would work with the CI