-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_qwen_server.sh
More file actions
executable file
·31 lines (26 loc) · 1.01 KB
/
Copy pathrun_qwen_server.sh
File metadata and controls
executable file
·31 lines (26 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# run_qwen_server.sh — avvia llama-server con Qwen3-4B, esponendo:
# - Web UI pronta su http://localhost:8080
# - API OpenAI-compatible su http://localhost:8080/v1/chat/completions
#
# Uso:
# ./run_qwen_server.sh → porta 8080 di default
# ./run_qwen_server.sh --port 9090
set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MODEL="$DIR/Qwen3-4B-Q4_K_M.gguf"
BIN="$DIR/llama.cpp/build/bin/llama-server"
if [ ! -f "$MODEL" ]; then
echo "Errore: modello non trovato in $MODEL"
exit 1
fi
if [ ! -x "$BIN" ]; then
echo "Errore: binario llama-server non trovato/compilato in $BIN"
exit 1
fi
# -ngl 0 : CPU only (evita contese GPU/Metal su questo Mac Intel/8GB RAM)
# -c 2048 : contesto ridotto per limitare l'uso di RAM
# -t 4 : usa tutti e 4 i core disponibili
# --host 127.0.0.1 --port 8080 : accessibile solo in locale
echo "Avvio server su http://127.0.0.1:8080 (Ctrl+C per fermare)"
"$BIN" -m "$MODEL" -ngl 0 -c 2048 -t 4 --host 127.0.0.1 --port 8080 "$@"