Update Dockerfile
Browse files- Dockerfile +12 -23
Dockerfile
CHANGED
|
@@ -1,31 +1,20 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
-
# Install
|
| 6 |
-
RUN
|
| 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 |
-
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
ENV
|
| 16 |
-
ENV
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
| 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 ["
|
|
|
|
|
|
| 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"]
|