ik_llama_docker/gemma-4-26B-A4B-mxfp4.sh

36 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#grab container image name
MODEL_NAME="Gemma-4-26B-A4B"
CONT_NAME="llama-$MODEL_NAME"
MODEL_FOLDER="/home/jared/.cache/huggingface/hub/models--unsloth--gemma-4-26B-A4B-it-GGUF"
MODEL="snapshots/3365c68df1a83799b846d05324ebfadbb8cc70b3/gemma-4-26B-A4B-it-MXFP4_MOE.gguf"
MODEL_MM="snapshots/3365c68df1a83799b846d05324ebfadbb8cc70b3/mmproj-F16.gguf"
PORT=10987
# Check if llama_env.sh exists, if not run create_new_image.sh
if [ ! -f "./env/llama_env.sh" ]; then
echo "llama_env.sh not found, running create_new_image.sh..."
./create_new_image.sh
fi
source ./env/llama_env.sh
echo $IMAGE
docker container create --name $CONT_NAME --network llms -p $PORT:$PORT -v $MODEL_FOLDER:/model --user $(id -u):$(id -g) --gpus=all --restart on-failure:3 \
--health-cmd "curl -f http://$CONT_NAME:$PORT/v1/models || exit 1" \
--health-interval 5s \
--health-timeout 5s \
--health-start-period 20s \
$IMAGE \
/llama.cpp/build/bin/llama-server \
--model /model/$MODEL \
-mm /model/$MODEL_MM \
--alias $MODEL_NAME \
-ctk q8_0 -ctv q8_0 \
--host $CONT_NAME \
--port $PORT --no-mmap -dio
echo "Done!"
echo $CONT_NAME