ModuleNotFoundError: No module named 'soundfile'

Hi, when using the official vllm/vllm-openai-rocm:latest docker image, I get the following error when trying to run the Qwen/Qwen3-ASR-0.6B model:

(APIServer pid=1) Traceback (most recent call last):
(APIServer pid=1) File “/usr/local/bin/vllm”, line 10, in
(APIServer pid=1) sys.exit(main())
(APIServer pid=1) ^^^^^^
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/cli/main.py”, line 73, in main
(APIServer pid=1) args.dispatch_function(args)
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/cli/serve.py”, line 112, in cmd
(APIServer pid=1) uvloop.run(run_server(args))
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/uvloop/_init_.py”, line 96, in run
(APIServer pid=1) return __asyncio.run(
(APIServer pid=1) ^^^^^^^^^^^^^^
(APIServer pid=1) File “/usr/lib/python3.12/asyncio/runners.py”, line 195, in run
(APIServer pid=1) return runner.run(main)
(APIServer pid=1) ^^^^^^^^^^^^^^^^
(APIServer pid=1) File “/usr/lib/python3.12/asyncio/runners.py”, line 118, in run
(APIServer pid=1) return self._loop.run_until_complete(task)
(APIServer pid=1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) File “uvloop/loop.pyx”, line 1518, in uvloop.loop.Loop.run_until_complete
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/uvloop/_init_.py”, line 48, in wrapper
(APIServer pid=1) return await main
(APIServer pid=1) ^^^^^^^^^^
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py”, line 471,
in run_server
(APIServer pid=1) await run_server_worker(listen_address, sock, args, **uvicorn_kwargs)
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py”, line 497,
in run_server_worker
(APIServer pid=1) app = build_app(args, supported_tasks)
(APIServer pid=1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py”, line 223,
in build_app
(APIServer pid=1) from vllm.entrypoints.openai.speech_to_text.api_router import (
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/speech_to_text/api_router.
py”, line 18, in
(APIServer pid=1) from vllm.entrypoints.openai.speech_to_text.serving import (
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/speech_to_text/serving.py”
, line 26, in
(APIServer pid=1) from vllm.entrypoints.openai.speech_to_text.speech_to_text import OpenAISpeechToText
(APIServer pid=1) File “/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/speech_to_text/speech_to_t
ext.py”, line 14, in
(APIServer pid=1) from soundfile import LibsndfileError
(APIServer pid=1) ModuleNotFoundError: No module named ‘soundfile’

Should I open a Github issue about this?

No, you do not need to open a GitHub issue. The error occurs because the official vllm/vllm-openai(-rocm) Docker images do not include optional audio dependencies like soundfile due to licensing reasons. To resolve this, you should create a custom Docker image based on the official one and install the required audio dependencies (e.g., soundfile, librosa) yourself.

Example Dockerfile:

FROM vllm/vllm-openai-rocm:latest
RUN pip install vllm[audio]

This is the recommended and supported approach according to the official documentation and multiple GitHub discussions. Would you like more detail on customizing your Docker image or troubleshooting audio dependencies?

Sources:

Hint: Mention @RunLLM in the post for followups.