Update Dockerfile
Browse files- Dockerfile +24 -52
Dockerfile
CHANGED
|
@@ -1,63 +1,35 @@
|
|
| 1 |
FROM ghcr.io/ggml-org/llama.cpp:full
|
| 2 |
|
| 3 |
-
# Set up working directory and system dependencies
|
| 4 |
WORKDIR /app
|
| 5 |
-
RUN apt update && apt install -y wget python3 python3-pip python3-venv && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
-
|
| 8 |
-
RUN mkdir -p /models
|
| 9 |
|
| 10 |
-
# Create a virtual environment for Python tools
|
| 11 |
RUN python3 -m venv /opt/venv
|
| 12 |
ENV PATH="/opt/venv/bin:$PATH"
|
| 13 |
RUN pip install -U pip huggingface_hub
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
# Model 1: Gemma 4 Multimodal + Speculative Setup
|
| 17 |
-
RUN wget "https://huggingface.co/unsloth/gemma-4-E2B-it-qat-GGUF/resolve/main/gemma-4-E2B-it-qat-UD-Q4_K_XL.gguf" -O /models/gemma-4-E2B-it-qat-UD-Q4_K_XL.gguf && \
|
| 18 |
-
wget "https://huggingface.co/unsloth/gemma-4-E2B-it-qat-GGUF/resolve/main/mtp-gemma-4-E2B-it.gguf" -O /models/mtp-gemma-4-E2B-it.gguf && \
|
| 19 |
-
wget "https://huggingface.co/unsloth/gemma-4-E2B-it-qat-GGUF/resolve/main/mmproj-F16.gguf" -O /models/gemma-4-E2B-it-mmproj.gguf
|
| 20 |
-
|
| 21 |
-
# Model 2: Gemma 3 1B Model
|
| 22 |
-
RUN wget "https://huggingface.co/MaziyarPanahi/gemma-3-1b-it-GGUF/resolve/main/gemma-3-1b-it.Q3_K_M.gguf" -O /models/gemma-3-1b-it.Q3_K_M.gguf
|
| 23 |
-
|
| 24 |
-
# --- DOWNLOAD FROM SECOND DOCKERFILE (Via huggingface_hub) ---
|
| 25 |
-
# Model 3: Gemma 4 26B Multimodal
|
| 26 |
RUN python3 -c 'from huggingface_hub import hf_hub_download; \
|
| 27 |
repo="unsloth/gemma-4-26B-A4B-it-GGUF"; \
|
| 28 |
-
hf_hub_download(repo_id=repo, filename="gemma-4-26B-A4B-it-UD-Q4_K_XL.gguf", local_dir="/
|
| 29 |
-
hf_hub_download(repo_id=repo, filename="mmproj-BF16.gguf", local_dir="/
|
| 30 |
-
|
| 31 |
-
#
|
| 32 |
-
RUN
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
echo "mmproj = /models/mmproj-BF16.gguf" >> /models.ini && \
|
| 51 |
-
echo "cache-type-k = q8_0" >> /models.ini && \
|
| 52 |
-
echo "cache-type-v = iq4_nl" >> /models.ini && \
|
| 53 |
-
echo "ctx-size = 64000" >> /models.ini
|
| 54 |
-
|
| 55 |
-
# --- START SERVER IN ROUTER MODE ---
|
| 56 |
-
# Note: "--server" is implicit when executing the entrypoint of the llama.cpp image with routing presets
|
| 57 |
-
CMD [ \
|
| 58 |
-
"--models-preset", "/models.ini", \
|
| 59 |
-
"--port", "7860", \
|
| 60 |
-
"--host", "0.0.0.0", \
|
| 61 |
-
"-t", "2", \
|
| 62 |
-
"-tb", "2" \
|
| 63 |
-
]
|
|
|
|
| 1 |
FROM ghcr.io/ggml-org/llama.cpp:full
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
|
|
|
| 4 |
|
| 5 |
+
RUN apt update && apt install -y python3 python3-pip python3-venv wget && rm -rf /var/lib/apt/lists/*
|
|
|
|
| 6 |
|
|
|
|
| 7 |
RUN python3 -m venv /opt/venv
|
| 8 |
ENV PATH="/opt/venv/bin:$PATH"
|
| 9 |
RUN pip install -U pip huggingface_hub
|
| 10 |
|
| 11 |
+
# Download Gemma 4 26B (via huggingface_hub)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
RUN python3 -c 'from huggingface_hub import hf_hub_download; \
|
| 13 |
repo="unsloth/gemma-4-26B-A4B-it-GGUF"; \
|
| 14 |
+
hf_hub_download(repo_id=repo, filename="gemma-4-26B-A4B-it-UD-Q4_K_XL.gguf", local_dir="/app"); \
|
| 15 |
+
hf_hub_download(repo_id=repo, filename="mmproj-BF16.gguf", local_dir="/app")'
|
| 16 |
+
|
| 17 |
+
# Download Gemma 4 E2B + Speculative Setup (via wget into /app)
|
| 18 |
+
RUN wget "https://huggingface.co/unsloth/gemma-4-E2B-it-qat-GGUF/resolve/main/gemma-4-E2B-it-qat-UD-Q4_K_XL.gguf" -O /app/gemma-4-E2B-it-qat-UD-Q4_K_XL.gguf && \
|
| 19 |
+
wget "https://huggingface.co/unsloth/gemma-4-E2B-it-qat-GGUF/resolve/main/mtp-gemma-4-E2B-it.gguf" -O /app/mtp-gemma-4-E2B-it.gguf && \
|
| 20 |
+
wget "https://huggingface.co/unsloth/gemma-4-E2B-it-qat-GGUF/resolve/main/mmproj-F16.gguf" -O /app/gemma-4-E2B-it-mmproj.gguf
|
| 21 |
+
|
| 22 |
+
# Download Gemma 3 1B Model (via wget into /app)
|
| 23 |
+
RUN wget "https://huggingface.co/MaziyarPanahi/gemma-3-1b-it-GGUF/resolve/main/gemma-3-1b-it.Q3_K_M.gguf" -O /app/gemma-3-1b-it.Q3_K_M.gguf
|
| 24 |
+
|
| 25 |
+
# Launching with the explicit Gemma 4 26B configuration
|
| 26 |
+
CMD ["--server", \
|
| 27 |
+
"-m", "/app/gemma-4-26B-A4B-it-UD-Q4_K_XL.gguf", \
|
| 28 |
+
"--mmproj", "/app/mmproj-BF16.gguf", \
|
| 29 |
+
"--host", "0.0.0.0", \
|
| 30 |
+
"--port", "7860", \
|
| 31 |
+
"-t", "2", \
|
| 32 |
+
"--cache-type-k", "q8_0", \
|
| 33 |
+
"--cache-type-v", "iq4_nl", \
|
| 34 |
+
"-c", "64000", \
|
| 35 |
+
"-n", "38912"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|