You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by gs...@apache.org on 2026/09/19 11:45:34 UTC

(tooling-llmao) 02/02: docs: RunPod hosting contract (image not built; ports still open)

This is an automated email from the ASF dual-hosted git repository.

gstein pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-llmao.git

commit e90d29e4cd423a4e406aa032f243900d1808a586
Author: Greg Stein <gs...@gmail.com>
AuthorDate: Sat Sep 19 06:40:30 2026 -0500

    docs: RunPod hosting contract (image not built; ports still open)
    
    Vast boxes use a stock vLLM template and curl install_set.py. RunPod
    templates instead pull a Docker image, so the next artifact is ours:
    one image that can run several vLLM listens from the same
    GET /vllm/config JSON. Infra has not chosen a registry; the name is a
    placeholder.
    
    This commit is knowledge only — hosting/runpod/README.md plus pointers
    from hosting/README.md, the fleet design, ARCHITECTURE, and the repo
    layout. No Dockerfile yet.
    
    What the runbook records so we do not relitigate it at image time:
    
    - Same control plane as Vast: fleet key, https://llm.apache.org, listen
      ports only on the box, Supervisord for N vllm serve processes.
    - Different pin: Vast must eventually curl a commit SHA (main is a
      moving target); RunPod pins an image digest and COPY's the installer
      so boot does not depend on GitHub.
    - Fit check stays pre-pull (nvidia-smi / later rocm-smi + statvfs).
      vLLM's allocator is after the weights land and does not replace that.
    - Public ports: we want REST v2 portMappings (GraphQL is deprecated) or
      the stable HTTP proxy URL once LiteLLM/long-gen survive it. The fourth
      fleet.hosts slot is a stopgap until self-deploy can discover or force
      the mapping; it may go away.
    
    Co-authored-by: Grok <gr...@x.ai>
---
 README.md                 |  1 +
 docs/ARCHITECTURE.md      |  3 +-
 docs/vllm-fleet-design.md | 12 ++++++++
 hosting/README.md         | 28 ++++++++++++-----
 hosting/runpod/README.md  | 77 +++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 112 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md
index fef9368..9081a7f 100644
--- a/README.md
+++ b/README.md
@@ -302,5 +302,6 @@ model_list.yaml.example  → model_list.yaml (catalog for llmao; no secrets)
 certs/                   mkcert PEMs + README
 llmao/                   seam, auth, models, litellm_client, fleet
 hosting/vast/            provision.sh + install_set.py
+hosting/runpod/          RunPod template notes (image not built yet)
 tests/                   offline seam, fleet, hosting installer
 ```
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 839b1b8..c012899 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -56,7 +56,8 @@ keys are team-scoped exceptions (who may create them is an **open RAI
 policy** question — see design + `docs/STATUS.md`). Secrets shown once;
 metadata in LiteLLM.
 
-**GPU fleet (vLLM on Vast, later RunPod):** `docs/vllm-fleet-design.md`.
+**GPU fleet (vLLM on Vast; RunPod next):** `docs/vllm-fleet-design.md`.
+`hosting/runpod/README.md` is the template/image contract (not built yet).
 `APP.fleet` (`llmao/fleet.py`) is built at startup. `GET /vllm/config` (Bearer
 `fleet.key`) maps client IP (`X-Forwarded-For` or peer) to `fleet.hosts`.
 JSON `{host, servers[]}` — `servers[].port` is the **container listen** port
diff --git a/docs/vllm-fleet-design.md b/docs/vllm-fleet-design.md
index 2e16771..47a1b1d 100644
--- a/docs/vllm-fleet-design.md
+++ b/docs/vllm-fleet-design.md
@@ -212,6 +212,18 @@ Notes:
 The template is identical for every box. Placement is keyed by public IP in
 `fleet_path` → `hosts`.
 
+### RunPod (planned)
+
+- Image: our `llmao-vllm-box` (registry TBD / Infra). Not a stock RunPod
+  Jupyter template. COPY the installer; do not curl GitHub at boot.
+- Same env: `FLEET_KEY`, `ASFQUART_URL=https://llm.apache.org`,
+  `DATA_DIRECTORY`.
+- Supervisord, same units as Vast (several `vllm serve` per pod).
+- Ports: expose every listen port. Public mapping via REST v2
+  `portMappings` or the HTTP proxy `https://<podId>-<listen>.proxy.runpod.net`
+  once proven. The optional fourth `fleet.hosts` field is a stopgap.
+- See `hosting/runpod/README.md`.
+
 ---
 
 ## 8. Security Considerations
diff --git a/hosting/README.md b/hosting/README.md
index 8ac2659..108ef1f 100644
--- a/hosting/README.md
+++ b/hosting/README.md
@@ -1,6 +1,6 @@
 # GPU-box hosting
 
-Artifacts that run **on** a GPU instance (Vast.ai now, RunPod later). They
+Artifacts that run **on** a GPU instance (Vast.ai now; RunPod next). They
 are not part of the asfquart process.
 
 **Design (why):** [`docs/vllm-fleet-design.md`](../docs/vllm-fleet-design.md).
@@ -9,28 +9,40 @@ are not part of the asfquart process.
 as JSON from `config.yaml` `fleet.hosts` (keyed by client IP) plus the catalog.
 Bearer fleet key (template).
 
-Provider-specific: how that JSON becomes running vLLM. Vast writes
-Supervisor units at box-start. There is no long-lived Python launcher.
+Provider-specific: how that JSON becomes running vLLM. Both providers
+write Supervisor units; there is no long-lived Python launcher.
 
 ## Layout
 
 | Path | Role |
 |------|------|
-| `vast/provision.sh` | Vast on-create |
+| `vast/provision.sh` | Vast on-create (curl installer from GitHub) |
 | `vast/install_set.py` | GET JSON, write `/etc/supervisor/conf.d/vllm-*.conf`, `supervisorctl update` |
 | `vast/README.md` | Vast.ai runbook |
+| `runpod/README.md` | RunPod runbook (image not built yet) |
 
 ## Box environment
 
 Required:
 
 - `FLEET_KEY` — shared secret on the **template**; `Authorization: Bearer`
-- `ASFQUART_URL` — origin only, e.g. `https://llm.apache.org`
-- `DATA_DIRECTORY` — Vast template workspace (typically `/workspace`). HF cache
+- `ASFQUART_URL` — origin only, `https://llm.apache.org`
+- `DATA_DIRECTORY` — volume workspace (typically `/workspace`). HF cache
   and logs are `$DATA_DIRECTORY/hf-cache` and `.../logs`, not in the config JSON.
 
-## Boot (Vast)
+## Boot
 
 ```text
-provision.sh → install_set.py → GET JSON → supervisor units → vllm serve …
+Vast:   provision.sh → curl install_set.py → GET JSON → supervisor units → vllm serve
+RunPod: image entrypoint → COPY'd installer → GET JSON → supervisor units → vllm serve
 ```
+
+Vast still curls `refs/heads/main`. Pin that URL to a **commit SHA** before
+treating instance-create as production-safe. RunPod pins by **image digest**.
+
+## Fit check
+
+Catalog `vram_gb` / `disk_gb` vs the card and `statvfs`, **before** the
+weights pull. vLLM's own allocator runs later (engine init) and does not
+replace this. NVIDIA: `nvidia-smi`. AMD: `rocm-smi` when we have a ROCm
+image. Silent if the probe is missing.
diff --git a/hosting/runpod/README.md b/hosting/runpod/README.md
new file mode 100644
index 0000000..11749fa
--- /dev/null
+++ b/hosting/runpod/README.md
@@ -0,0 +1,77 @@
+# RunPod runbook (knowledge; image not built yet)
+
+RunPod templates pull a **Docker image**. Vast uses a stock vLLM template
+and curls `install_set.py` at create. Same control plane, different
+artifact.
+
+Nothing in this directory is a running image yet. Registry location is a
+placeholder until Infra says where to push. The notes below are what the
+image and `fleet.hosts` row must satisfy.
+
+## Same as Vast
+
+- `GET /vllm/config` by **client IP**, Bearer `FLEET_KEY`.
+- JSON listen ports only. The box never sees the public mapping.
+- Template env: `FLEET_KEY`, `ASFQUART_URL=https://llm.apache.org`,
+  `DATA_DIRECTORY` (typically `/workspace`). TLS verify is on; there is
+  no skip flag.
+- **Supervisord** runs one `vllm serve` per catalog row (several listens
+  in one pod). That is the usual shape for a GPU *pod*, not a one-process
+  web container, and it matches Vast.
+- Weights and logs live on the volume (`$DATA_DIRECTORY/hf-cache`,
+  `.../logs`), not in the image.
+- Pre-pull fit check: catalog `vram_gb` / `disk_gb` against the card and
+  `statvfs`. That is **not** vLLM: vLLM only sizes KV after the weights
+  are on disk (`torch` / HIP `mem_get_info`). NVIDIA probe today is
+  `nvidia-smi`; missing probe is not a failure. AMD (`rocm-smi`) when we
+  have a ROCm image.
+
+## Different from Vast
+
+| | Vast | RunPod |
+|--|------|--------|
+| Image | stock `vastai/vllm` (or similar) | **our** image (`IMAGE_REGISTRY_PLACEHOLDER/llmao-vllm-box`) |
+| Installer | curl `install_set.py` from GitHub **main** | **COPY** in the image (boot must not depend on GitHub) |
+| Pin | later: curl a **commit SHA** | image **digest** |
+| Public port | Vast API HostPort (`vast_client`) | see Ports below |
+
+Pin the Vast curl before create-instance is treated as production-safe: a
+broken `main` would brick every new box. The image digest is the same
+kind of pin for RunPod.
+
+## Ports (open; 4th host-row slot is a stopgap)
+
+`fleet.hosts` already accepts `[model, listen, name|null, public]`. That
+was added so a RunPod box could get an `api_base` at all: RunPod does not
+expose a Vast-style HostPort to us today, and it **reassigns** the TCP
+public port on every pod recreate.
+
+We do **not** want operators editing that fourth number forever. Once
+self-deploy is formalized (create from template, then read the mapping),
+prefer one of:
+
+1. **HTTP proxy (stable URL).** Template exposes `N/http`. Public origin
+   is `https://<podId>-<listen>.proxy.runpod.net`. The listen port is in
+   the hostname, so recreate does not need a new fourth slot. Only use
+   this as `api_base` after we prove LiteLLM and long generations survive
+   that proxy (timeouts, TLS, HTTP/1.1).
+2. **Direct TCP + API.** Template exposes `N/tcp`. Public port changes.
+   RunPod **REST v2** `GET /pods/{id}` → `portMappings` can fill
+   `public_port` the way `vast_client` fills HostPort. GraphQL exists but
+   is deprecated (~early 2027); new code should be REST.
+
+Until one of those is wired, keep the fourth slot. It may go away.
+
+The template must still **expose every listen port** the set uses (max 10
+HTTP ports on RunPod). Control plane JSON stays listen-only.
+
+## Image sketch (next, not this note)
+
+`FROM vllm/vllm-openai:…` (pin a digest later), install supervisord,
+COPY the shared installer, `CMD`/`ENTRYPOINT` that fetches config, writes
+units, `exec supervisord -n`. No baked weights.
+
+## Smoke (once a pod exists)
+
+1. `supervisorctl status`
+2. `curl -sS -H "Authorization: Bearer <api_key>" http://127.0.0.1:<listen>/v1/models`


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org