From e0f2a8fb533984e18d1fe7df1377c82a4f050e77 Mon Sep 17 00:00:00 2001 From: Jared Delony Date: Mon, 25 May 2026 15:55:54 -0500 Subject: [PATCH] Added TODO list, moved git repo to local clone cuz github is supa reliable --- TODO.md | 2 ++ create_new_IK_image.sh | 2 +- create_new_image.sh | 2 +- sulphur-prompt-enhance.sh | 59 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 TODO.md create mode 100644 sulphur-prompt-enhance.sh diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..bb04f8f --- /dev/null +++ b/TODO.md @@ -0,0 +1,2 @@ +Check to see if the docker containers exist, remove them, then rebuild them. +If the container is older than two weeks, rebuild. \ No newline at end of file diff --git a/create_new_IK_image.sh b/create_new_IK_image.sh index a242100..d29174f 100755 --- a/create_new_IK_image.sh +++ b/create_new_IK_image.sh @@ -5,7 +5,7 @@ docker run --name ik-llama-dw-$(date +%Y-%m-%d) --gpus=all $BASE_IMAGE /bin/bash 'apt-get update apt-get --yes upgrade apt-get --yes install build-essential git libcurl4-openssl-dev curl libgomp1 cmake -git clone https://github.com/ikawrakow/ik_llama.cpp +git clone https://gitea.delony.net/jdelony/ik_llama.cpp cd ik_llama.cpp cmake -B build -DGGML_NATIVE=ON -DGGML_CUDA=ON cmake --build build --config Release -j$(nproc)' diff --git a/create_new_image.sh b/create_new_image.sh index 2d88c74..30ffe01 100755 --- a/create_new_image.sh +++ b/create_new_image.sh @@ -5,7 +5,7 @@ docker run --name llama-dw-$(date +%Y-%m-%d) --gpus=all $BASE_IMAGE /bin/bash -c 'apt-get update apt-get --yes upgrade apt-get --yes install build-essential git libcurl4-openssl-dev curl libgomp1 cmake -git clone https://github.com/ggml-org/llama.cpp +git clone https://gitea.delony.net/jdelony/llama.cpp cd llama.cpp cmake -B build -DGGML_NATIVE=ON -DGGML_CUDA=ON cmake --build build --config Release -j$(nproc)' diff --git a/sulphur-prompt-enhance.sh b/sulphur-prompt-enhance.sh new file mode 100644 index 0000000..7df350c --- /dev/null +++ b/sulphur-prompt-enhance.sh @@ -0,0 +1,59 @@ +#!/bin/bash +#grab container image name +MODEL_NAME="sulphur-prompt" +CONT_NAME="LLM-$MODEL_NAME" + +MODEL_FOLDER="/home/jared/.cache" +MODEL="huggingface/hub/models--SulphurAI--Sulphur-2-base/snapshots/b0ba1217a7c1eedca26afff4f5d53f77b951e4db/prompt_enhancer/sulphur_prompt_enhancer_model-q8_0.gguf" +MODEL_MM="huggingface/hub/models--SulphurAI--Sulphur-2-base/snapshots/b0ba1217a7c1eedca26afff4f5d53f77b951e4db/prompt_enhancer/mmproj-BF16.gguf" + +PORT=8555 + +set -e + +# 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 + +# Check and remove container +if docker inspect "$CONT_NAME" > /dev/null 2>&1; then + echo "✓ Container '$CONT_NAME' found" + + # Check if container is running + if docker inspect -f '{{.State.Running}}' "$CONT_NAME" | grep -q "true"; then + echo "⚠ Container is running, forcing removal..." + fi + + # Remove container + if docker rm -f "$CONT_NAME"; then + echo "✓ Container removed successfully. Creating new container." + exit 0 + else + echo "✗ Failed to remove container" + exit 1 + fi +else + echo "ℹ Container '$CONT_NAME' does not exist. Creating new container." +fi + +#create container +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 \ + --reasoning off -c 16384 -np 2 + +echo "Done!" +docker container start -a $CONT_NAME