zapashwin commited on
Commit
65f7773
·
verified ·
1 Parent(s): 429cc84

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -23
Dockerfile CHANGED
@@ -1,31 +1,20 @@
1
- FROM ghcr.io/ggml-org/llama.cpp:server
2
 
3
  USER root
4
 
5
- # Install curl, download the 1B model, and clean up in one layer
6
- RUN apt-get update && apt-get install -y --no-install-recommends curl && \
7
- mkdir -p /models && \
8
- curl -L https://huggingface.co/unsloth/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q4_K_M.gguf -o /models/model.gguf && \
9
- chown -R 1000:1000 /models && \
10
- apt-get purge -y curl && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
11
 
12
- USER 1000
 
13
 
14
- ENV LLAMA_ARG_MODEL=/models/model.gguf
15
- ENV LLAMA_ARG_HOST=0.0.0.0
16
- ENV LLAMA_ARG_PORT=7860
17
 
18
- # --- Precise Free HF Space Hardware Tuning ---
19
- ENV LLAMA_ARG_THREADS=2
20
- ENV LLAMA_ARG_CTX_SIZE=2048
21
- ENV LLAMA_ARG_BATCH_SIZE=32
22
- ENV LLAMA_ARG_UBATCH_SIZE=32
23
- ENV LLAMA_ARG_FLASH_ATTN=true
24
-
25
- # CRITICAL: Disable mlock (not supported on HF shared nodes)
26
- ENV LLAMA_ARG_MLOCK=false
27
-
28
- HEALTHCHECK --interval=30s --timeout=15s --start-period=10s --retries=3 \
29
  CMD curl -f http://localhost:7860/health || exit 1
30
 
31
- ENTRYPOINT ["/app/llama-server"]
 
 
1
+ FROM vllm/vllm-openai:latest
2
 
3
  USER root
4
 
5
+ # Install huggingface_hub to download weights directly
6
+ RUN pip install --no-cache-dir huggingface_hub
 
 
 
 
7
 
8
+ # Download Llama-3.2-1B-Instruct model weights
9
+ RUN python3 -c "from huggingface_hub import snapshot_download; snapshot_download('meta-llama/Llama-3.2-1B-Instruct', local_dir='/models/Llama-3.2-1B-Instruct')"
10
 
11
+ # Configure vLLM environment variables
12
+ ENV PORT=7860
13
+ ENV HOST=0.0.0.0
14
 
15
+ # Configure healthcheck
16
+ HEALTHCHECK --interval=30s --timeout=15s --start-period=30s --retries=3 \
 
 
 
 
 
 
 
 
 
17
  CMD curl -f http://localhost:7860/health || exit 1
18
 
19
+ ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]
20
+ CMD ["--model", "/models/Llama-3.2-1B-Instruct", "--host", "0.0.0.0", "--port", "7860", "--max-model-len", "2048", "--gpu-memory-utilization", "0.9"]