Files
2026-07-17 12:57:18 +03:00

34 lines
1.4 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# Пример запуска llama-server (сборка llama.cpp) с GGUF Qwen2.5-1.5B-Instruct.
# Путь к бинарнику: задайте LLAMA_SERVER или положите llama-server в PATH.
#
# Переменные:
# WESP_ASSISTANT_DIR — корень (по умолчанию /app/assistant)
# WESP_LLM_GGUF_FILE — имя файла в models/ (по умолчанию qwen2.5-1.5b-instruct-q5_k_m.gguf)
# WESP_LLM_PORT — порт HTTP (по умолчанию 8080)
# WESP_LLM_HOST — bind (по умолчанию 127.0.0.1)
#
# WESP должен смотреть на тот же порт: export WESP_LLM_BASE_URL=http://127.0.0.1:8080
# Имя модели в API должно совпадать с -m (часто имя файла .gguf):
# export WESP_LLM_MODEL=qwen2.5-1.5b-instruct-q5_k_m.gguf
set -e
ROOT="${WESP_ASSISTANT_DIR:-/app/assistant}"
FILE="${WESP_LLM_GGUF_FILE:-qwen2.5-1.5b-instruct-q5_k_m.gguf}"
HOST="${WESP_LLM_HOST:-127.0.0.1}"
PORT="${WESP_LLM_PORT:-8080}"
GGUF="$ROOT/models/$FILE"
BIN="${LLAMA_SERVER:-llama-server}"
if [ ! -f "$GGUF" ]; then
echo "Нет файла модели: $GGUF" >&2
echo "Запустите install/assistant/download_model.sh или скопируйте .gguf в $ROOT/models/" >&2
exit 1
fi
exec "$BIN" \
-m "$GGUF" \
--host "$HOST" \
--port "$PORT" \
-c 8192