Andrew McCracken commited on
Commit
8e854ef
·
1 Parent(s): a922ca8

Fix: Install cmake and build-essential for llama-cpp-python build

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -10
Dockerfile CHANGED
@@ -2,23 +2,21 @@ FROM python:3.12-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies
6
  RUN apt-get update && apt-get install -y \
7
- gcc \
8
- g++ \
9
- make \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  # Copy requirements and install
13
  COPY requirements.txt .
14
 
15
- # Set environment variables to use pre-built wheels for llama-cpp-python
16
- ENV CMAKE_ARGS="-DLLAMA_BLAS=OFF -DLLAMA_BLAS_VENDOR=OFF -DLLAMA_CUBLAS=OFF"
17
- ENV FORCE_CMAKE=0
18
 
19
- # Install llama-cpp-python from PyPI (not building from source)
20
- RUN pip install --no-cache-dir --only-binary=:all: llama-cpp-python==0.3.14 || \
21
- pip install --no-cache-dir llama-cpp-python==0.3.14
22
 
23
  # Install remaining requirements
24
  RUN pip install --no-cache-dir -r requirements.txt
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies for building llama-cpp-python
6
  RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ cmake \
9
+ git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  # Copy requirements and install
13
  COPY requirements.txt .
14
 
15
+ # Set environment variables for CPU-only build (no BLAS, no CUDA)
16
+ ENV CMAKE_ARGS="-DLLAMA_BLAS=OFF -DLLAMA_CUBLAS=OFF -DLLAMA_METAL=OFF"
 
17
 
18
+ # Install llama-cpp-python (will build from source with CPU-only)
19
+ RUN pip install --no-cache-dir llama-cpp-python==0.3.14 --verbose
 
20
 
21
  # Install remaining requirements
22
  RUN pip install --no-cache-dir -r requirements.txt