ramedde commited on
Commit
e741ea6
·
verified ·
1 Parent(s): 655bd58

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +7 -8
entrypoint.sh CHANGED
@@ -11,15 +11,14 @@ REASONING_MODE="${REASONING_MODE:-off}"
11
  CACHE_TYPE_K="${CACHE_TYPE_K:-q8_0}"
12
  CACHE_TYPE_V="${CACHE_TYPE_V:-q8_0}"
13
  FLASH_ATTN="${FLASH_ATTN:-on}"
14
- USE_SPEC_DECODE="${USE_SPEC_DECODE:-1}"
15
 
16
- # MTP speculative decoding: near-free accuracy-wise (target verifies every
17
- # drafted token), can speed up generation. If it turns out to be a net loss
18
- # on 2 vCPUs (draft overhead > savings), set USE_SPEC_DECODE=0 in Space secrets.
19
- SPEC_FLAGS=""
20
- if [ "$USE_SPEC_DECODE" = "1" ]; then
21
- SPEC_FLAGS="--spec-type draft-mtp --spec-draft-n-max 4"
22
- fi
23
 
24
  exec /app/llama-server \
25
  -hf "$MODEL_SPEC" \
 
11
  CACHE_TYPE_K="${CACHE_TYPE_K:-q8_0}"
12
  CACHE_TYPE_V="${CACHE_TYPE_V:-q8_0}"
13
  FLASH_ATTN="${FLASH_ATTN:-on}"
14
+ SPEC_TYPE="${SPEC_TYPE:-ngram-cache}"
15
 
16
+ # NOTE: the b8840 CPU build does not support draft-mtp (needs a newer
17
+ # llama.cpp build than this image ships). ngram-cache is a self-speculation
18
+ # mode that needs no external draft model: it speculates from n-grams already
19
+ # seen in context/output, verified by the target model, so it's zero-cost on
20
+ # accuracy. Set SPEC_TYPE=none in Space secrets to disable entirely.
21
+ SPEC_FLAGS="--spec-type $SPEC_TYPE"
 
22
 
23
  exec /app/llama-server \
24
  -hf "$MODEL_SPEC" \