zapashwin commited on
Commit
3de6cd8
·
verified ·
1 Parent(s): 1569672

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -11
Dockerfile CHANGED
@@ -1,32 +1,27 @@
1
  FROM vllm/vllm-openai-cpu:latest-x86_64
2
 
3
- # HF Spaces enforces execution as user 1000.
4
- # We route the cache to /tmp to prevent strict permission denial errors.
5
  ENV HF_HOME=/tmp/huggingface
6
 
7
  ENV PORT=7860
8
  ENV HOST=0.0.0.0
9
 
10
- # --- vLLM MAX CONCURRENCY TUNING FOR CPU ---
11
 
12
- # 1. PagedAttention KV Cache (Stops RAM exhaustion under high concurrent load)
13
- # Reserves exactly 2GB of CPU RAM specifically for dynamic token routing.
14
  ENV VLLM_CPU_KVCACHE_SPACE=2
15
 
16
- # 2. Thread Affinity
17
- # Locks OpenMP threads directly to physical CPU cores, eliminating context-switching latency.
18
  ENV VLLM_CPU_OMP_THREADS_BIND=1
19
 
20
  HEALTHCHECK --interval=30s --timeout=15s --start-period=60s --retries=3 \
21
  CMD curl -f http://localhost:7860/health || exit 1
22
 
23
- # 3. Execution Directives
24
- # max-num-seqs: Allows 32 users to generate text simultaneously without queueing.
25
- # max-model-len: Hard limit for predictable memory mapping on limited Space RAM.
26
  ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server", \
27
  "--host", "0.0.0.0", \
28
  "--port", "7860", \
29
- "--model", "meta-llama/Llama-3.2-1B-Instruct", \
30
  "--dtype", "bfloat16", \
31
  "--max-model-len", "4096", \
32
  "--max-num-seqs", "32"]
 
1
  FROM vllm/vllm-openai-cpu:latest-x86_64
2
 
3
+ # Route Hugging Face cache to /tmp to prevent permission errors on HF Spaces
 
4
  ENV HF_HOME=/tmp/huggingface
5
 
6
  ENV PORT=7860
7
  ENV HOST=0.0.0.0
8
 
9
+ # --- vLLM CPU & CONCURRENCY TUNING ---
10
 
11
+ # Allocate 2GB RAM explicitly for PagedAttention KV Cache
 
12
  ENV VLLM_CPU_KVCACHE_SPACE=2
13
 
14
+ # Bind OpenMP threads directly to physical CPU cores
 
15
  ENV VLLM_CPU_OMP_THREADS_BIND=1
16
 
17
  HEALTHCHECK --interval=30s --timeout=15s --start-period=60s --retries=3 \
18
  CMD curl -f http://localhost:7860/health || exit 1
19
 
20
+ # Switched to the public, un-gated Unsloth repository
 
 
21
  ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server", \
22
  "--host", "0.0.0.0", \
23
  "--port", "7860", \
24
+ "--model", "unsloth/Llama-3.2-1B-Instruct", \
25
  "--dtype", "bfloat16", \
26
  "--max-model-len", "4096", \
27
  "--max-num-seqs", "32"]