litellm icon indicating copy to clipboard operation
litellm copied to clipboard

[Bug]: Missing libsndfile.so in ARM64 Alpine Docker image

Open emc2314 opened this issue 1 month ago • 1 comments

What happened?

libsndfile.so is missing in ghcr.io/berriai/litellm:main-dev ARM64 image. So ASR related model does not work correctly:

500: litellm.APIConnectionError: AzureException APIConnectionError - cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/soundfile.py", line 161, in <module>
    import _soundfile_data  # ImportError if this doesn't exist
    ^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_soundfile_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/soundfile.py", line 170, in <module>
    raise OSError('sndfile library not found using ctypes.util.find_library')
OSError: sndfile library not found using ctypes.util.find_library

After executing docker exec -it litellm apk add libsndfile fixes the problem. Please add libsndfile when building arm64 alpine docker. (Note that AMD64 image works fine)

Relevant log output


Are you a ML Ops Team?

No

What LiteLLM version are you on ?

v1.80.0

Twitter / LinkedIn details

No response

emc2314 avatar Nov 21 '25 11:11 emc2314

I'm facing the same here when testing #11325 (Groq's whisper models) on Arm64 docker image (v1.79.3-stable) The same version, running on x64 docker image is, apparently, ok.

{
  "error": {
    "message": "litellm.APIConnectionError: APIConnectionError: GroqException - cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory
...
}

stronk7 avatar Nov 22 '25 09:11 stronk7

+1

ndrsfel avatar Dec 03 '25 07:12 ndrsfel

Hi, +1 Best regards,

jlsclaranet avatar Dec 11 '25 09:12 jlsclaranet

@Chesars can you please look into fixing this?

krrishdholakia avatar Dec 16 '25 03:12 krrishdholakia

@Chesars can you please look into fixing this?

Cool, PR https://github.com/BerriAI/litellm/pull/18092 fixes

Chesars avatar Dec 17 '25 02:12 Chesars