NanoBotAIAgent commited on
Commit
c9e75fc
·
verified ·
1 Parent(s): f348ff6

Update MODEL_PATH to Q8_K_P, add threading + reasoning flags

Browse files
Files changed (1) hide show
  1. entrypoint.sh +22 -7
entrypoint.sh CHANGED
@@ -1,23 +1,39 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- # Use pre-downloaded local model
5
- MODEL_PATH="/data/model/Gemma-4-E4B-Uncensored-HauhauCS-Aggressive-Q4_K_M.gguf"
6
 
7
- # Start llama-server on internal port 8080
 
 
 
 
 
 
 
 
 
 
 
 
8
  /app/llama-server \
9
  --model "$MODEL_PATH" \
10
  --port 8080 \
11
  --host 127.0.0.1 \
12
  --ctx-size 131072 \
 
13
  --parallel 1 \
14
- --jinja &
 
 
 
 
 
15
 
16
  LLAMA_PID=$!
17
 
18
- # Wait for llama-server to be ready
19
  echo "Waiting for llama-server to start..."
20
- for i in {1..300}; do
21
  if curl -s http://127.0.0.1:8080/health > /dev/null 2>&1; then
22
  echo "llama-server is ready!"
23
  break
@@ -25,5 +41,4 @@ for i in {1..300}; do
25
  sleep 1
26
  done
27
 
28
- # Start the proxy on port 8000 (HF Spaces expects this)
29
  exec uvicorn proxy:app --host 0.0.0.0 --port 8000 --proxy-headers
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ MODEL_PATH="/data/model/Gemma-4-E4B-Uncensored-HauhauCS-Aggressive-Q8_K_P.gguf"
 
5
 
6
+ # Detect CPU cores for max threading
7
+ NPROC=$(nproc)
8
+ echo "Using $NPROC threads"
9
+
10
+ # Context window = 131072 tokens.
11
+ # --n-predict 25000 sets the default/maximum generated tokens per request.
12
+ #
13
+ # Reasoning ("thinking") is ENABLED BY DEFAULT:
14
+ # --jinja use the model's embedded chat template
15
+ # --reasoning-format deepseek extract <think>...</think> into a SEPARATE
16
+ # `reasoning_content` field in the OpenAI
17
+ # response/stream (instead of inline tags)
18
+ # --reasoning-budget -1 unrestricted thinking length
19
  /app/llama-server \
20
  --model "$MODEL_PATH" \
21
  --port 8080 \
22
  --host 127.0.0.1 \
23
  --ctx-size 131072 \
24
+ --n-predict 25000 \
25
  --parallel 1 \
26
+ --threads "$NPROC" \
27
+ --threads-batch "$NPROC" \
28
+ --batch-size 512 \
29
+ --jinja \
30
+ --reasoning-format deepseek \
31
+ --reasoning-budget -1 &
32
 
33
  LLAMA_PID=$!
34
 
 
35
  echo "Waiting for llama-server to start..."
36
+ for i in {1..600}; do
37
  if curl -s http://127.0.0.1:8080/health > /dev/null 2>&1; then
38
  echo "llama-server is ready!"
39
  break
 
41
  sleep 1
42
  done
43
 
 
44
  exec uvicorn proxy:app --host 0.0.0.0 --port 8000 --proxy-headers