Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
403d318ffc | ||
|
|
381ed9ffff | ||
|
|
c42b80ebbd |
+2
-2
@@ -14,10 +14,10 @@
|
||||
{
|
||||
"key": "LLAMA_SERVER_CMD_ARGS",
|
||||
"input": {
|
||||
"name": "Model Name",
|
||||
"name": "Command line arguments for llama-server",
|
||||
"type": "string",
|
||||
"description": "Launch command line arguments (argv) for the llama-server binary. Do not define the port.",
|
||||
"default": "-hf unsloth/gemma-3-270m-it-GGUF:Q6_K --ctx-size 4096",
|
||||
"default": "-hf unsloth/gemma-3-270m-it-GGUF:Q6_K --ctx-size 4096 -ngl 99",
|
||||
"advanced": false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -21,7 +21,6 @@ Typical usage:
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from openai import OpenAI
|
||||
|
||||
+9
-2
@@ -14,6 +14,12 @@ cleanup() {
|
||||
exit 0
|
||||
}
|
||||
|
||||
# check if $LLAMA_SERVER_CMD_ARGS is set
|
||||
if [ -z "$LLAMA_SERVER_CMD_ARGS" ]; then
|
||||
echo "start.sh: Warning: LLAMA_SERVER_CMD_ARGS is not set. Defaulting to -hf unsloth/gemma-3-270m-it-GGUF:Q6_K --ctx-size 4096"
|
||||
LLAMA_SERVER_CMD_ARGS="-hf unsloth/gemma-3-270m-it-GGUF:Q6_K --ctx-size 4096 -ngl 99"
|
||||
fi
|
||||
|
||||
# check if the substring /workspace is in LLAMA_SERVER_CMD_ARGS
|
||||
if [[ "$LLAMA_SERVER_CMD_ARGS" != *"/workspace"* ]]; then
|
||||
echo "start.sh: Tip: For reduced downloads and faster startup times, consider using a model stored in a network volume mounted to /workspace."
|
||||
@@ -37,7 +43,7 @@ echo "start.sh: Stopping existing llama-server instances (if any)..."
|
||||
}
|
||||
|
||||
# we have a string with all the command line arguments in the env var LLAMA_SERVER_CMD_ARGS;
|
||||
# it contains a.e. "-hf modelname --ctx-size 4096".
|
||||
# it contains a.e. "-hf modelname --ctx-size 4096 -ngl 99".
|
||||
|
||||
echo "start.sh: Running llama-server $LLAMA_SERVER_CMD_ARGS --port 3098"
|
||||
|
||||
@@ -62,7 +68,8 @@ echo "start.sh: Waiting for llama-server to start..."
|
||||
|
||||
# wait for the server to start
|
||||
while ! check_server_is_running; do
|
||||
sleep 5
|
||||
# we don't want to lose too much time, so we check very frequently
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
echo "start.sh: llama-server is up and running, delegating to the handler script."
|
||||
|
||||
Reference in New Issue
Block a user