Views
No views yet
llama-cpp-python wheels optimized for HuggingFace Spaces free tier (16GB RAM, 2 vCPU, CPU-only).| Wheel File | Python | Platform | llama.cpp | Features |
|---|---|---|---|---|
llama_cpp_python-0.3.22-cp310-cp310-linux_x86_64.whl | 3.10 | Linux x86_64 | Latest (Jan 2026) | LFM2 MoE, IQ4_XS, OpenBLAS |
python:3.10-slim as the base image:1# Use Python 3.10 explicitly (required for these wheels)
2FROM python:3.10-slim
3
4WORKDIR /app
5
6# Install system dependencies
7RUN apt-get update && apt-get install -y \
8 gcc g++ make cmake git libopenblas-dev \
9 && rm -rf /var/lib/apt/lists/*
10
11# Install llama-cpp-python from prebuilt wheel
12RUN pip install --no-cache-dir \
13 https://huggingface.co/Luigi/llama-cpp-python-wheels-hf-spaces-free-cpu/resolve/main/llama_cpp_python-0.3.22-cp310-cp310-linux_x86_64.whl
14
15# Install other dependencies
16COPY requirements.txt .
17RUN pip install --no-cache-dir -r requirements.txt
18
19# Copy application code
20COPY . .
21
22# Set environment variables
23ENV PYTHONUNBUFFERED=1
24ENV GRADIO_SERVER_NAME=0.0.0.0
25
26# Expose Gradio port
27EXPOSE 7860
28
29# Run the app
30CMD ["python", "app.py"]FROM python:3.10-slim)runtime.txt (Dockerfile takes precedence)1FROM python:3.10-slim
2
3# Install system dependencies for OpenBLAS
4RUN apt-get update && apt-get install -y \
5 gcc g++ make cmake git libopenblas-dev \
6 && rm -rf /var/lib/apt/lists/*
7
8# Install llama-cpp-python from prebuilt wheel (fast)
9RUN pip install --no-cache-dir \
10 https://huggingface.co/Luigi/llama-cpp-python-wheels-hf-spaces-free-cpu/resolve/main/llama_cpp_python-0.3.22-cp310-cp310-linux_x86_64.whl1# Try prebuilt wheel first, fall back to source build if unavailable
2RUN if pip install --no-cache-dir https://huggingface.co/Luigi/llama-cpp-python-wheels-hf-spaces-free-cpu/resolve/main/llama_cpp_python-0.3.22-cp310-cp310-linux_x86_64.whl; then \
3 echo "✅ Using prebuilt wheel"; \
4 else \
5 echo "⚠️ Building from source"; \
6 pip install --no-cache-dir git+https://github.com/JamePeng/llama-cpp-python.git@5a0391e8; \
7 fi| Repository | Latest Version | llama.cpp | LFM2 MoE Support |
|---|---|---|---|
| JamePeng fork | v0.3.22 (Jan 2026) | Latest | ✅ Yes |
| Official (abetlen) | v0.3.16 (Aug 2025) | Outdated | ❌ No |
1CMAKE_ARGS="-DGGML_OPENBLAS=ON -DGGML_NATIVE=OFF"
2FORCE_CMAKE=1
3pip wheel --no-deps git+https://github.com/JamePeng/llama-cpp-python.git@5a0391e8build_wheel.sh in the main project repository.