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

未关闭
#2,118 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
cmake, docker, python
领域
backend, cloud, devops

调研方向

该 issue 涉及在 Hugging Face Spaces 上进行部署。检查 repository 中的 Dockerfile 模式,尤其是 ghcr.io/abetlen/llama-cpp-python 上的官方 image。查看 build 脚本和 CI 配置,以了解如何为不同平台构建 wheel。检查是否已有用于 CPU-only 环境的 Dockerfile。目标是生成一个可正常工作的 Dockerfile,避免使用 musl wheel,并在时间限制内完成构建。

由索引模型根据 Issue 内容生成。

描述

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]```
主要语言
Python
星标
10.7k
派生
1.5k
平均合并
1 小时 40 分钟
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

abetlen/llama-cpp-python 的其他 Issue

查看 abetlen/llama-cpp-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。