broadfield commited on
Commit
ac7f9c6
·
verified ·
1 Parent(s): 0358431

Update via HuggingBot

Browse files
Files changed (1) hide show
  1. runtime-baseline.md +45 -0
runtime-baseline.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OpenJev CPU runtime — baseline Space spec
2
+
3
+ The recommended zero-GPU Hugging Face Space configuration for
4
+ **broadfield/openjev-cpu-run** (the one-click Duplicate target).
5
+
6
+ | setting | value | why |
7
+ |---|---|---|
8
+ | SDK | **Docker** | we need llama.cpp binaries + a multi-process entrypoint (bash) |
9
+ | Hardware | **CPU basic (free)** | zero GPU, by design (note: Docker Spaces on cpu-basic require a PRO subscription) |
10
+ | Persistent storage | **30 GB** (≈ $0.50/mo) | `/data` holds the 16.2 GB GGUF + tokenizer |
11
+ | Auto-sleep | any (e.g. 15 min) | wake-up reloads model from `/data` → ~1–2 min, not 20+ |
12
+ | Visibility | public (default) | the API is meant to be called; flip private + `OPENJEV_TOKEN` to lock it |
13
+ | Secrets | none required | optional `OPENJEV_TOKEN` via Space settings → will appear as an env var |
14
+
15
+ ## Approximate resource/memory math (Q4_K_M)
16
+
17
+ | item | size |
18
+ |---|---|
19
+ | `OpenJev-Q4_K_M.gguf` on disk | 16.2 GB |
20
+ | RAM to hold the model weights | ~16.2 GB |
21
+ | KV cache (llama.cpp fork, 8-bit, 8192 ctx, 1 stream) | ~1–2 GB |
22
+ | openjev-server + transformers tokenizer | ~1–2 GB |
23
+ | **peak RSS** | **~18–20 GB** (fits the 16 vCPU / 32 GB free tier) |
24
+
25
+ If the free tier's memory turns out tight (it runs 32 GB RAM / 16 vCPU per
26
+ current info), drop to `LLAMA_CTX=4096` or use quant `OpenJev-Q5_K_M.gguf`.
27
+
28
+ ## Build-time budget
29
+
30
+ The image does, in order:
31
+ 1. `apt` build tools — ~1 min
32
+ 2. clone + checkout llama.cpp `b4630` — ~1 min
33
+ 3. **CMake CPU build of llama-server** — **~15–35 min** on the build machine
34
+ 4. `pip install openjev-server` (transformers etc.) — ~2–4 min
35
+ 5. final image copy — ~1 min
36
+
37
+ First **boot** then downloads the GGUF (~16.2 GB) into persistent `/data` —
38
+ that's the long pole (20–50 min depending on HF Hub egress). Persisted
39
+ afterward, so subsequent boots are 1–2 min.
40
+
41
+ ## Why entrypoint waits up to 15 min for llama-server
42
+
43
+ A cold boot loads 16.2 GB off disk into RAM and runs llama.cpp's warmup; on a
44
+ shared CPU that's minutes. The entrypoint polls `/v1/models` until ready, then
45
+ starts openjev-server, so HF's health check never sees a crash while loading.