| |
| FROM python:3.11-slim |
|
|
| |
| ENV PYTHONDONTWRITEBYTECODE 1 |
| ENV PYTHONUNBUFFERED 1 |
| ENV PORT 7860 |
|
|
| |
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| libpq-dev \ |
| cmake \ |
| pkg-config \ |
| libgomp1 \ |
| libopenblas-dev \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| ENV OMP_NUM_THREADS 1 |
| ENV MKL_NUM_THREADS 1 |
| ENV OPENBLAS_NUM_THREADS 1 |
| ENV KMP_DUPLICATE_LIB_OK TRUE |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir --upgrade pip setuptools wheel |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| |
| |
| |
| ENV CMAKE_ARGS="-DGGML_CPU=ON" |
| ENV CMAKE_BUILD_PARALLEL_LEVEL="1" |
| RUN pip install --no-cache-dir --upgrade llama-cpp-python |
|
|
| |
| |
| RUN mkdir -p models && \ |
| python -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='bartowski/google_gemma-4-E4B-it-GGUF', filename='google_gemma-4-E4B-it-Q4_K_M.gguf', local_dir='models')" |
|
|
| |
| COPY . . |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |
|
|