File size: 928 Bytes
2190dc6
 
 
 
 
 
0402f09
 
 
 
 
7cf8efb
 
 
43e6b0f
9151501
 
454f91b
9151501
 
43e6b0f
 
 
9151501
43e6b0f
 
 
9151501
 
454f91b
43e6b0f
9151501
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
32
# Use the official, precompiled llama-server image
FROM ghcr.io/ggml-org/llama.cpp:server

# Expose port 7860 (Hugging Face's default)
EXPOSE 7860

# Redirect all caches to /tmp (which is globally writable on HF Spaces)
# This prevents the permission errors when downloading GGUF files
ENV LLAMA_CACHE="/tmp"
ENV HF_HOME="/tmp"

# Corrected binary path
ENTRYPOINT ["/app/llama-server"]

# Run llama-server with CPU-tier optimizations, queuing requests to guarantee 40-50 TPS per user
CMD [ \
    "--hf-repo", "unsloth/LFM2.5-230M-GGUF", \
    "--hf-file", "LFM2.5-230M-UD-Q4_K_XL.gguf", \
    "--host", "0.0.0.0", \
    "--port", "7860", \
    "-c", "65536", \
    "--parallel", "2", \
    "--kv-unified", \
    "--threads", "2", \
    "--threads-batch", "2", \
    "--batch-size", "256", \
    "--ubatch-size", "64", \
    "--temp", "0.1", \
    "--top-k", "50", \
    "--repeat-penalty", "1.05", \
    "--flash-attn", "on" \
]