[Deployment Issue] Installation deadlock on Hugging Face Spaces (CPU): Wheels fail (musl/glibc mismatch) & Source builds timeout

Ouverte
#2,118 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
cmake, docker, python
Domaine
backend, cloud, devops

Piste de recherche

L’issue concerne le déploiement sur Hugging Face Spaces. Examinez les modèles de Dockerfile du dépôt, en particulier l’image officielle à l’adresse ghcr.io/abetlen/llama-cpp-python. Consultez les scripts de build et les configurations CI pour comprendre comment les wheels sont construits pour différentes plateformes. Vérifiez s’il existe déjà des Dockerfiles pour les environnements CPU-only. L’objectif est de produire un Dockerfile fonctionnel qui évite les wheels musl et se construit dans les limites de temps.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

System Info

Platform: Hugging Face Spaces (Docker / CPU Basic Tier)

Base Image: python:3.10-slim (Debian Bookworm)

Goal: Deploy OpenAI-compatible server for a GGUF model.

Description I am unable to deploy llama-cpp-python on a CPU-only Docker environment (Hugging Face Spaces). I have attempted three distinct installation methods, all of which fail.

Describe the solution you'd like
Is there a recommended Docker pattern for Debian-based CPU-only deployments that avoids the musl wheel issue but does not require a full source compilation?

Describe alternatives you've considered

Attempt 1: Pre-built Wheels (Architecture Mismatch) I attempted to install using the CPU-specific extra index URL to avoid compilation time.

Dockerfile:

RUN apt-get update && apt-get install -y build-essential cmake gcc
RUN pip install llama-cpp-python \
    --prefer-binary \
    --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu

Error: The installer pulls a wheel that requires musl, causing a runtime crash on Debian.

OSError: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory

Attempt 2: Official Docker Image I attempted to use the official image to avoid installation steps entirely. Dockerfile:

FROM ghcr.io/abetlen/llama-cpp-python:latest...

Error: The server fails to start, unable to load the shared library (likely due to GPU/CUDA dependencies in :latest or pathing issues).

FileNotFoundError: Shared library with base name 'llama' not found

Attempt 3: Build from Source I attempted to build from source to ensure correct architecture. Dockerfile:

ENV CMAKE_ARGS="-DGGML_CUDA=off"
RUN pip install llama-cpp-python --no-cache-dir

Error: The build process hits the Hugging Face Spaces timeout limit (hard limit) during the wheel building phase.

Building wheel for llama-cpp-python (pyproject.toml): started
... [Process limits out / Times out]```
Langage dominant
Python
Étoiles
10.7k
Forks
1.5k
Merge moyen
1 h 40 min
PR mergées (30 j)
5

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de abetlen/llama-cpp-python

Toutes les issues de abetlen/llama-cpp-python

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.