chipling commited on
Commit
fc2c5e5
·
verified ·
1 Parent(s): 25fd3ae

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -25
Dockerfile CHANGED
@@ -1,31 +1,21 @@
1
- # Use a standard Python image
2
- FROM python:3.10-slim
 
3
 
4
- WORKDIR /app
 
 
 
 
5
 
6
- # Install basic system tools required for the server
7
- RUN apt-get update && apt-get install -y \
8
- libopenblas-dev \
9
- gcc \
10
- && rm -rf /var/lib/apt/lists/*
11
-
12
- # Install the PRE-COMPILED wheel for CPU (Skips the 'stuck' build process)
13
- RUN pip install --no-cache-dir \
14
- "llama-cpp-python[server] @ https://github.com/abetlen/llama-cpp-python/releases/download/v0.3.7/llama_cpp_python-0.3.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
15
-
16
- # Install huggingface_hub to fetch the model
17
- RUN pip install huggingface_hub
18
-
19
- # Pre-download the model so it's ready on boot
20
- RUN python3 -c "from huggingface_hub import hf_hub_download; hf_hub_download(repo_id='HauhauCS/Qwen3.5-4B-Uncensored-HauhauCS-Aggressive', filename='Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf', local_dir='.')"
21
-
22
- # Expose the HF Space port
23
  EXPOSE 7860
24
 
25
- # Launch the server optimized for 2 CPUs
26
- CMD ["python3", "-m", "llama_cpp.server", \
27
- "--model", "Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf", \
 
28
  "--host", "0.0.0.0", \
29
  "--port", "7860", \
30
- "--n_threads", "2", \
31
- "--n_ctx", "2048"]
 
1
+ # Use the official Hugging Face GGUF server image
2
+ # This comes pre-compiled and optimized for CPU
3
+ FROM ghcr.io/huggingface/llama-cpp-gguf-server:latest
4
 
5
+ # Set environment variables for the server
6
+ ENV MODEL_ID="HauhauCS/Qwen3.5-4B-Uncensored-HauhauCS-Aggressive"
7
+ ENV MODEL_FILE="Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf"
8
+ ENV PORT=7860
9
+ ENV HOST=0.0.0.0
10
 
11
+ # The server automatically handles the download and OpenAI endpoint mapping
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  EXPOSE 7860
13
 
14
+ # Run the server with CPU-optimized threads
15
+ CMD ["llama-server", \
16
+ "--hf-repo", "HauhauCS/Qwen3.5-4B-Uncensored-HauhauCS-Aggressive", \
17
+ "--hf-file", "Qwen3.5-4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf", \
18
  "--host", "0.0.0.0", \
19
  "--port", "7860", \
20
+ "--threads", "2", \
21
+ "--ctx-size", "2048"]