File size: 786 Bytes
2190dc6
 
 
 
 
 
0402f09
 
 
 
 
7cf8efb
 
 
 
 
 
7033a98
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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"

# Optional: Set a fallback default API Key
ENV LLAMA_API_KEY="your-secure-fallback-token-here"

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

# Run llama-server, explicitly fetching the exact GGUF file
# This bypasses the automatic -hf suffix parser which failed due to naming mismatches
CMD ["--hf-repo", "unsloth/LFM2-350M-GGUF", "--hf-file", "LFM2-350M-UD-Q8_K_XL.gguf", "--host", "0.0.0.0", "--port", "7860", "-c", "32768", "--threads", "2"]