Skip to content

Conversation

@Chesars
Copy link
Contributor

@Chesars Chesars commented Dec 17, 2025

Relevant issues

Fixes #16920

Pre-Submission checklist

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - N/A (Dockerfile change, not testable with unit tests)
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

Adds libsndfile system library to the Alpine Docker image (docker/Dockerfile.alpine).

The ARM64 Alpine image was missing the libsndfile native library, causing the Python soundfile module to fail with:

cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file

This affects users running LiteLLM on ARM64 infrastructure (Apple Silicon Macs via Docker, AWS Graviton, etc.) who need audio processing features (STT/TTS).

When you pip install soundfile:

macOS / Windows / Linux x86_64 (glibc)
   │
   └─ PyPI has pre-built .whl with libsndfile bundled inside
         │
         └─ Downloads .whl → extracts → works ✅


Alpine ARM64 (musl)
   │
   └─ PyPI has NO .whl for musllinux_aarch64
         │
         └─ Downloads .tar.gz (source) → compiles → needs libsndfile from system
                                                          │
                                                          └─ Not installed ❌
  • Alpine Linux uses musl libc instead of glibc (standard)
  • Binaries compiled for glibc don't work on musl and vice versa
  • The soundfile maintainers don't publish wheels for musllinux (Alpine)
  • So pip falls back to source compilation, which requires libsndfile system library

Solution

Added apk add --no-cache libsndfile to the runtime stage of Dockerfile.alpine.

This is the standard solution - the soundfile documentation states: "On Linux, you need to install libsndfile using your distribution's package manager."

ARM64 Alpine image was missing libsndfile library causing soundfile
module to fail with "cannot load library" error.
@vercel
Copy link

vercel bot commented Dec 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
litellm Ready Ready Preview, Comment Dec 17, 2025 2:16am

@krrishdholakia krrishdholakia changed the base branch from main to litellm_staging_12_17_2025 December 17, 2025 04:37
@krrishdholakia krrishdholakia merged commit 089d1eb into BerriAI:litellm_staging_12_17_2025 Dec 17, 2025
5 of 7 checks passed
@krrishdholakia krrishdholakia mentioned this pull request Dec 17, 2025
6 tasks
@Chesars Chesars deleted the fix/alpine-libsndfile-arm64 branch December 17, 2025 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants