Archived
hfget+deploy: fetch a repo on verified claims, and run with a key argv cannot show
The --model repo-id path trusts the hub with the machine's filesystem and the container runs with the kernel's door off. Both stop here. hfget.sh trusted a listing's file names to be names: an absolute path or a .. segment wrote wherever the destination's owner could write, and a name shadowing .hfget-manifest taught the next run whatever it liked. A listing is now vetted whole before anything is fetched -- absolute paths, .. segments, control characters (a tab splices one entry into two fields), names of hfget's own manifest -- and a child refuses a path that would escape anyway. Silent skipping was the alternative, and it leaves a directory that reads as complete and is not. And the content key was the hub's claim, never checked: an LFS file was kept for its size and its claimed oid recorded without ever hashing the download, so a swapped file of equal length -- or a spliced resume at any length -- passed forever after. The download is hashed on arrival and kept only when it matches the claimed sha256; a mismatch deletes the file, and the manifest now certifies verified content. --model-revision REV fetches at a branch, tag, sha or refs/pr/N instead of the moving main: without it a restart can serve weights nobody reviewed, and the guide now says to name one. --api-key-env NAME reads the key from the environment, where only the process and root can reach it, not the command line where every process on the host reads it in ps; an unset or empty variable refuses startup exactly like an empty --api-key. The compose files carry the key through environment: now -- the fail-closed :? guard moves with it -- across all 52 model files. And the containers' seccomp=unconfined has a way out: Docker's default profile, plus exactly the calls that forced the escape -- io_uring for the n-gram table, mbind/set_mempolicy/get_mempolicy for ROCm's NUMA binding -- is shipped as seccomp-radiance.json and selected through RADIANCE_SECCOMP; the default stays unconfined until each operator audits their own card stack. Verified: under the profile io_uring_setup and set_mempolicy behave as under unconfined and a non-listed syscall earns EPERM. hf_model_test: the escape-listing refusal, the oid verify (bad rejected and deleted, good certified), the pinned revision fetched -- against a fake curl for a hub. config_test: --api-key-env fails closed unset, reads the key set. ASan+UBSan: config/diag/hf_model/server/transport/ wire/lifecycle, 8/8.
This commit is contained in:
1 parent
ad3f03dbc6
commit
1577854d00
62 files changed
+1551
-61
No files matched your search
@@ -49,6 +49,8 @@ static const Flag g_flags[] = {
|
||||
"Hugging Face repo id (owner/name), fetched before startup" },
|
||||
{ "--download-dir", "DIR", "where a repo id is fetched to; default\n"
|
||||
"$XDG_CACHE_HOME/radiance/hf, else ~/.cache/radiance/hf" },
|
||||
{ "--model-revision", "REV", "the hub revision -- a branch, tag, full commit sha or refs/pr/N --\n"
|
||||
"a repo id is fetched at; default the repo's moving main branch" },
|
||||
{ "--radiance-home", "DIRS", "where kernels/, architectures/ and quantizers/ live; several\n"
|
||||
"homes separated by ':' are searched in order, the first winning" },
|
||||
{ "--kernels", "LIST", "the kernel libraries to use, separated by ',' or ':', first wins; unnamed ones are not loaded. Default: every library found" },
|
||||
@@ -213,6 +215,8 @@ static const Flag g_flags[] = {
|
||||
{ "--port", "N", "listen port" },
|
||||
{ "--api-key", "KEY", "require `Authorization: Bearer KEY` or `X-Api-Key: KEY` on every request but /health,\n"
|
||||
" /v1/health, /ping and the dashboard page" },
|
||||
{ "--api-key-env", "NAME", "read the API key from the named environment variable; keeps it off the\n"
|
||||
" command line, where every process on the machine can read it" },
|
||||
{ "--allow-host", "NAME", "a Host name the keyless loopback-only routes (/diagnostics,\n"
|
||||
" /admin/control-vector, the LoRA and session admin) accept besides\n"
|
||||
" localhost; repeatable" },
|
||||
@@ -523,6 +527,7 @@ int config_parse(int argc, char** argv, Config* c) {
|
||||
else if (S("-vv")) log_set_level(Log::Trace);
|
||||
else if (S("--model")) { if (!(v = need(i))) return RAD_E_INVAL; c->model = v; }
|
||||
else if (S("--download-dir")) { if (!(v = need(i))) return RAD_E_INVAL; c->download_dir = v; }
|
||||
else if (S("--model-revision")) { if (!(v = need(i))) return RAD_E_INVAL; c->model_revision = v; }
|
||||
else if (S("--radiance-home")) { if (!(v = need(i))) return RAD_E_INVAL; c->radiance_home = v; }
|
||||
else if (S("--kernels")) { if (!(v = need(i))) return RAD_E_INVAL; c->kernel_hierarchy = rad_split_kernel_list(v); }
|
||||
else if (S("--tp")) { if (!num(1, INT32_MAX, &c->tp)) return RAD_E_INVAL; }
|
||||
@@ -823,6 +828,23 @@ int config_parse(int argc, char** argv, Config* c) {
|
||||
return RAD_E_INVAL; }
|
||||
c->api_key = v;
|
||||
}
|
||||
else if (S("--api-key-env")) {
|
||||
if (!(v = need(i))) return RAD_E_INVAL;
|
||||
if (!*v) { RAD_ERR("--api-key-env takes the name of an environment variable");
|
||||
return RAD_E_INVAL; }
|
||||
const char* k = std::getenv(v);
|
||||
/* The empty --api-key refusal's sibling: a unit or compose file whose variable was
|
||||
* never set must not start a server that looks guarded and answers everything
|
||||
* keyless. The name is recorded so the config report can say where the key came
|
||||
* from without showing it. */
|
||||
if (!k || !*k) {
|
||||
RAD_ERR("--api-key-env: %s is unset or empty; refusing to serve keyless under a "
|
||||
"guarded-looking command line", v);
|
||||
return RAD_E_INVAL;
|
||||
}
|
||||
c->api_key = k;
|
||||
c->api_key_env = v;
|
||||
}
|
||||
else if (S("--allow-host")) {
|
||||
if (!(v = need(i))) return RAD_E_INVAL;
|
||||
if (!*v) { RAD_ERR("--allow-host takes a non-empty name"); return RAD_E_INVAL; }
|
||||
@@ -1269,6 +1291,7 @@ struct ShowRow { const char* flag; Show show; };
|
||||
const ShowRow kShow[] = {
|
||||
{ "--model", [](const Config& c) { return c.model; } },
|
||||
{ "--download-dir", [](const Config& c) { return or_none(c.download_dir, "the XDG cache (~/.cache/radiance/hf)"); } },
|
||||
{ "--model-revision", [](const Config& c) { return or_none(c.model_revision, "the repo's main branch"); } },
|
||||
{ "--radiance-home", [](const Config& c) { return c.radiance_home; } },
|
||||
{ "--kernels", [](const Config& c) {
|
||||
std::string s;
|
||||
@@ -1352,6 +1375,7 @@ const ShowRow kShow[] = {
|
||||
{ "--port", [](const Config& c) { return num(c.port); } },
|
||||
/* Never print the secret, only whether it is set. */
|
||||
{ "--api-key", [](const Config& c) { return std::string(c.api_key.empty() ? "not set" : "set"); } },
|
||||
{ "--api-key-env", [](const Config& c) { return or_none(c.api_key_env, "not used"); } },
|
||||
{ "--allow-host", [](const Config& c) {
|
||||
std::string o;
|
||||
for (const std::string& h : c.allow_hosts) o += (o.empty() ? "" : ",") + h;
|
||||
|
||||
+7
-4
@@ -51,15 +51,18 @@ std::string hfget_path() {
|
||||
return fs::is_regular_file(p, ec) ? p.lexically_normal().string() : std::string();
|
||||
}
|
||||
|
||||
/* The script's exit status, or -1 when it could not be run. */
|
||||
int run_hfget(const std::string& script, const std::string& repo, const std::string& dest) {
|
||||
/* The script's exit status, or -1 when it could not be run. `rev` empty leaves the script's own
|
||||
* default: the repo's moving default branch. */
|
||||
int run_hfget(const std::string& script, const std::string& repo, const std::string& dest,
|
||||
const std::string& rev) {
|
||||
const pid_t pid = fork();
|
||||
if (pid < 0) {
|
||||
RAD_ERR("hfget: fork: %s", std::strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
if (pid == 0) {
|
||||
const char* argv[] = { "sh", script.c_str(), repo.c_str(), dest.c_str(), nullptr };
|
||||
const char* argv[] = { "sh", script.c_str(), repo.c_str(), dest.c_str(),
|
||||
rev.empty() ? nullptr : rev.c_str(), nullptr };
|
||||
execv("/bin/sh", const_cast<char* const*>(argv));
|
||||
std::fprintf(stderr, "hfget: /bin/sh: %s\n", std::strerror(errno));
|
||||
_exit(127);
|
||||
@@ -134,7 +137,7 @@ bool resolve_hf_model(Config& c) {
|
||||
}
|
||||
RAD_INFO("model: %s is not a path here; fetching it as a Hugging Face repo into %s",
|
||||
repo.c_str(), dest.c_str());
|
||||
const int rc = run_hfget(script, repo, dest);
|
||||
const int rc = run_hfget(script, repo, dest, c.model_revision);
|
||||
if (rc != 0) {
|
||||
if (rc == 3 && cached) {
|
||||
RAD_WARN("model: %s could not be checked for changes (hfget.sh, above); serving the "
|
||||
|
||||
@@ -787,6 +787,8 @@ struct Config {
|
||||
std::string model; /* path to the .rad, or a Hugging Face repo id (hf_model.h) */
|
||||
LoraConfig lora; /* --lora, --max-loras, --max-lora-rank, --lora-target-modules */
|
||||
std::string download_dir; /* where a repo id is fetched to; empty = the XDG cache */
|
||||
std::string model_revision; /* --model-revision: the hub revision a repo id fetches;
|
||||
empty = the repo's moving default branch */
|
||||
std::string radiance_home;
|
||||
std::vector<std::string> kernel_hierarchy; /* ordered; first wins */
|
||||
|
||||
@@ -1049,6 +1051,9 @@ struct Config {
|
||||
/* --api-key: the bearer key every request but the probes and the dashboard page must carry.
|
||||
* Empty serves without one. */
|
||||
std::string api_key;
|
||||
/* --api-key-env: the environment variable api_key was read from, recorded so the config
|
||||
* report can say where the key came from. Empty when the key came from the command line. */
|
||||
std::string api_key_env;
|
||||
/* --allow-host, repeatable: Host names the keyless loopback-only routes accept beside the
|
||||
* loopback names themselves, for operators who reach the box by another name. */
|
||||
std::vector<std::string> allow_hosts;
|
||||
|
||||
@@ -8,7 +8,8 @@ RADIANCE_IMAGE=stilldeadcode/radiance:latest
|
||||
RADIANCE_MODELS=/srv/models/rad
|
||||
|
||||
# Every request but /health, /ping and the dashboard page must carry `Authorization: Bearer <key>`
|
||||
# (or `X-Api-Key: <key>`).
|
||||
# (or `X-Api-Key: <key>`). It enters the container through the environment (--api-key-env), not
|
||||
# the command line, where every process on the host could read it in `ps`.
|
||||
RADIANCE_API_KEY=
|
||||
|
||||
# The port the server listens on.
|
||||
@@ -23,3 +24,9 @@ VIDEO_GID=
|
||||
|
||||
# The card a one-card model runs on (embeddinggemma2.yaml), by index.
|
||||
RADIANCE_GPU=0
|
||||
|
||||
# Run the container under a seccomp profile: Docker's default plus exactly the calls radiance
|
||||
# needs beyond it (io_uring for the n-gram table, the NUMA binding calls) is seccomp-radiance.json
|
||||
# beside this file. Give its absolute path on the host to confine; unset runs unconfined, which is
|
||||
# what these files have always done, because the stock Docker default blocks radiance's startup.
|
||||
#RADIANCE_SECCOMP=/srv/radiance/deploy/compose/seccomp-radiance.json
|
||||
@@ -15,5 +15,5 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/anima-aesthetic-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1
|
||||
@@ -11,5 +11,5 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/breeze-tts2-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1
|
||||
@@ -23,11 +23,19 @@ services:
|
||||
group_add:
|
||||
- "${RENDER_GID:?set RENDER_GID in .env}"
|
||||
- "${VIDEO_GID:?set VIDEO_GID in .env}"
|
||||
# The API key reaches the server through the container's environment, read by
|
||||
# --api-key-env, not its command line: argv is world-readable in `ps` and /proc, the
|
||||
# environment only by the process itself and root. The :? still fails closed on an unset
|
||||
# value, at compose-parse time, before any container starts.
|
||||
environment:
|
||||
RADIANCE_API_KEY: ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
# Docker's default seccomp profile refuses io_uring (used for the n-gram table's reads from the
|
||||
# model file) and the NUMA binding calls (mbind, set_mempolicy) the ROCm runtime makes for
|
||||
# host memory.
|
||||
# host memory. seccomp-radiance.json beside this file is Docker's default plus exactly those
|
||||
# calls; point RADIANCE_SECCOMP at it (absolute host path) to run confined, and audit your
|
||||
# own card stack before you do -- unset, the service runs unconfined, as it always has.
|
||||
security_opt:
|
||||
- seccomp=unconfined
|
||||
- seccomp=${RADIANCE_SECCOMP:-unconfined}
|
||||
ulimits:
|
||||
memlock: -1
|
||||
volumes:
|
||||
|
||||
@@ -12,5 +12,5 @@ services:
|
||||
container_name: radiance-drama3
|
||||
command: >
|
||||
--model /models/drama3-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2
|
||||
@@ -11,5 +11,5 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/embeddinggemma2-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 64 --max-num-batched-tokens 8192
|
||||
@@ -12,5 +12,5 @@ services:
|
||||
container_name: radiance-fasth3
|
||||
command: >
|
||||
--model /models/fasth3-8-step-v2-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --vision-tower-placement ram
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
container_name: radiance-flashnext-bf16
|
||||
command: >
|
||||
--model /models/qwen3.8-flash-next-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-model-len 32768 --placement expert_tiered --weights-disk-tier --host-pool-mib 12288
|
||||
--gpu-headroom-mib 768 --deterministic
|
||||
--max-num-seqs 32 --max-num-batched-tokens 32768 --num-speculative-tokens 0
|
||||
@@ -15,7 +15,7 @@ services:
|
||||
container_name: radiance-flashnext-tp1
|
||||
command: >
|
||||
--model /models/qwen3.8-next-flash-fp8-iq4r-moe.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 4 --max-model-len 200000
|
||||
--placement expert_tiered --host-pool-mib 43000 --gpu-headroom-mib 96
|
||||
--kv-cache-dtype fp8
|
||||
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
container_name: radiance-flashnext
|
||||
command: >
|
||||
--model /models/qwen3.8-next-flash-fp8-iq4r-moe.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --tp-wire wht6 --max-num-seqs 8 --max-model-len 200000
|
||||
--placement expert_tiered --host-pool-mib 12288 --gpu-headroom-mib 96
|
||||
--kv-cache-dtype fp8
|
||||
|
||||
@@ -14,5 +14,5 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/flux-3-klein-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1
|
||||
@@ -9,6 +9,6 @@ services:
|
||||
container_name: radiance-gemma4-31b-heretic-ara-w4a8
|
||||
command: >
|
||||
--model /models/gemma4-31b-heretic-ara-w4a8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype fp8 --vision-tower-placement ram
|
||||
--num-speculative-tokens 3 --max-num-batched-tokens 2048 --temp 1.0 --top-p 0.95 --top-k 64
|
||||
@@ -11,6 +11,6 @@ services:
|
||||
container_name: radiance-gemma4-31b-q8-df
|
||||
command: >
|
||||
--model /models/gemma4-31b-dense-q8-df.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens auto --max-num-batched-tokens 2048 --temp 1.0 --top-p 0.95 --top-k 64
|
||||
@@ -12,6 +12,6 @@ services:
|
||||
container_name: radiance-gemma4-31b-w4a8-df
|
||||
command: >
|
||||
--model /models/gemma4-31b-dense-w4a8-df.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens auto --max-num-batched-tokens 2048 --temp 1.0 --top-p 0.95 --top-k 64
|
||||
@@ -28,7 +28,7 @@ services:
|
||||
container_name: radiance-gemma4-31b-w4a8-df2-tp4
|
||||
command: >
|
||||
--model /models/gemma4-31b-dense-w4a8-df2-qkv.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 4 --max-num-seqs 16 --max-model-len 65536 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens auto --max-num-batched-tokens 8192
|
||||
--busy-prefill-chunk 512 --prefill-interleave 1
|
||||
|
||||
@@ -34,7 +34,7 @@ services:
|
||||
container_name: radiance-gemma4-31b-w4a8-df2b16-tp2
|
||||
command: >
|
||||
--model /models/gemma4-31b-dense-w4a8-df2b16-qkv.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 16 --max-model-len 65536 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens auto --max-num-batched-tokens 8192
|
||||
--busy-prefill-chunk 512 --prefill-interleave 1 --gpu-headroom-mib 160
|
||||
|
||||
@@ -31,7 +31,7 @@ services:
|
||||
container_name: radiance-gemma4-31b-w4a8-df2b16-tp4
|
||||
command: >
|
||||
--model /models/gemma4-31b-dense-w4a8-df2b16-qkv.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 4 --max-num-seqs 16 --max-model-len 65536 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens auto --max-num-batched-tokens 8192
|
||||
--busy-prefill-chunk 512 --prefill-interleave 1
|
||||
|
||||
@@ -11,6 +11,6 @@ services:
|
||||
container_name: radiance-gemma4-31b-w4a8
|
||||
command: >
|
||||
--model /models/gemma4-31b-w4a8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens 3 --max-num-batched-tokens 2048 --temp 1.0 --top-p 0.95 --top-k 64
|
||||
@@ -14,7 +14,7 @@ services:
|
||||
container_name: radiance-glm53-flash
|
||||
command: >
|
||||
--model /models/glm53-flash-mxfp4.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 8 --placement all_vram --gpu-headroom-mib 1024 --embedding-placement vram
|
||||
--max-num-seqs 8 --max-model-len 32768
|
||||
--max-num-batched-tokens 4096 --prefill-span 4
|
||||
|
||||
@@ -13,5 +13,5 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/krea-2-raw-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1
|
||||
@@ -13,5 +13,5 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/krea-2-turbo-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1
|
||||
@@ -15,5 +15,5 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/ltx-2.5-distilled-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --vision-tower-placement ram
|
||||
@@ -7,6 +7,6 @@ services:
|
||||
container_name: radiance-minicpm5-2b-bf16
|
||||
command: >
|
||||
--model /models/minicpm5-2b-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 32 --max-model-len 131072 --kv-cache-dtype fp8
|
||||
--gpu-headroom-mib 160 --max-num-batched-tokens 512
|
||||
@@ -7,6 +7,6 @@ services:
|
||||
container_name: radiance-minicpm5-2b
|
||||
command: >
|
||||
--model /models/minicpm5-2b-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 32 --max-model-len 131072 --kv-cache-dtype fp8
|
||||
--gpu-headroom-mib 160 --max-num-batched-tokens 512
|
||||
@@ -13,5 +13,5 @@ services:
|
||||
container_name: radiance-minimax-h3
|
||||
command: >
|
||||
--model /models/minimax-h3-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --vision-tower-placement ram
|
||||
@@ -8,5 +8,5 @@ services:
|
||||
container_name: radiance-minimax-music3
|
||||
command: >
|
||||
--model /models/minimax-music3-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
container_name: radiance-nemotron-3.5-bolt-e4b-a4-tp1
|
||||
command: >
|
||||
--model /models/nemotron-3.5-bolt-e4b-a4.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype bf16
|
||||
--num-speculative-tokens 7 --mm-max-patches 2520 --vision-tower-placement ram
|
||||
--temp 1.0 --top-p 0.95 --top-k 64 --chat-template-kwargs '{"enable_thinking":false}'
|
||||
@@ -11,7 +11,7 @@ services:
|
||||
container_name: radiance-nemotron-3.5-bolt-e4b-a4
|
||||
command: >
|
||||
--model /models/nemotron-3.5-bolt-e4b-a4.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype bf16
|
||||
--num-speculative-tokens 7 --mm-max-patches 2520 --vision-tower-placement ram
|
||||
--temp 1.0 --top-p 0.95 --top-k 64 --chat-template-kwargs '{"enable_thinking":false}'
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
container_name: radiance-nemotron-3.5-bolt-e4b-bf16-tp1
|
||||
command: >
|
||||
--model /models/nemotron-3.5-bolt-e4b-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype bf16
|
||||
--num-speculative-tokens 7 --mm-max-patches 2520 --vision-tower-placement ram
|
||||
--temp 1.0 --top-p 0.95 --top-k 64 --chat-template-kwargs '{"enable_thinking":false}'
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
container_name: radiance-nemotron-3.5-bolt-e4b-bf16
|
||||
command: >
|
||||
--model /models/nemotron-3.5-bolt-e4b-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype bf16
|
||||
--num-speculative-tokens 7 --mm-max-patches 2520 --vision-tower-placement ram
|
||||
--temp 1.0 --top-p 0.95 --top-k 64 --chat-template-kwargs '{"enable_thinking":false}'
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
container_name: radiance-nemotron-3.5-bolt-e4b-i8g-tp1
|
||||
command: >
|
||||
--model /models/nemotron-3.5-bolt-e4b-i8g.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype bf16
|
||||
--num-speculative-tokens 7 --mm-max-patches 2520 --vision-tower-placement ram
|
||||
--temp 1.0 --top-p 0.95 --top-k 64 --chat-template-kwargs '{"enable_thinking":false}'
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
container_name: radiance-nemotron-3.5-bolt-e4b-i8g
|
||||
command: >
|
||||
--model /models/nemotron-3.5-bolt-e4b-i8g.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 65536 --kv-cache-dtype bf16
|
||||
--num-speculative-tokens 7 --mm-max-patches 2520 --vision-tower-placement ram
|
||||
--temp 1.0 --top-p 0.95 --top-k 64 --chat-template-kwargs '{"enable_thinking":false}'
|
||||
@@ -11,7 +11,7 @@ services:
|
||||
container_name: radiance-ornith-1.5-122b-df2
|
||||
command: >
|
||||
--model /models/ornith-1.5-122b-fp8-dflash2.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 4 --max-num-seqs 8 --max-model-len 262144 --kv-cache-dtype fp8
|
||||
--placement expert_tiered --host-pool-mib 3072 --vision-tower-placement ram
|
||||
--max-num-batched-tokens 2048
|
||||
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
container_name: radiance-ornith-1.5-122b-w4a8-df2
|
||||
command: >
|
||||
--model /models/ornith-1.5-122b-w4a8-dflash2.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 4 --max-num-seqs 8 --max-model-len 262144 --kv-cache-dtype fp8
|
||||
--max-num-batched-tokens 2048
|
||||
--temp 1.0 --top-p 0.95 --top-k 20 --presence-penalty 1.5
|
||||
@@ -9,7 +9,7 @@ services:
|
||||
container_name: radiance-ornith-1.5-122b-w4a8
|
||||
command: >
|
||||
--model /models/ornith-1.5-122b-w4a8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 4 --max-num-seqs 8 --max-model-len 262144 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens 3 --max-num-batched-tokens 2048
|
||||
--temp 1.0 --top-p 0.95 --top-k 20 --presence-penalty 1.5
|
||||
@@ -11,7 +11,7 @@ services:
|
||||
container_name: radiance-ornith-1.5-122b
|
||||
command: >
|
||||
--model /models/ornith-1.5-122b-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 4 --max-num-seqs 8 --max-model-len 262144 --kv-cache-dtype fp8
|
||||
--placement expert_tiered --host-pool-mib 3072 --vision-tower-placement ram
|
||||
--num-speculative-tokens 3 --max-num-batched-tokens 2048
|
||||
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
container_name: radiance-ornith-1.5-35b-a3b-w4a8-tp1
|
||||
command: >
|
||||
--model /models/ornith-1.5-35b-a3b-w4a8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 8 --max-model-len 262144 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens 3 --max-num-batched-tokens 2048
|
||||
--temp 1.0 --top-p 0.95 --top-k 20 --presence-penalty 1.5
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
container_name: radiance-ornith-1.5-35b-a3b-w4a8
|
||||
command: >
|
||||
--model /models/ornith-1.5-35b-a3b-w4a8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 262144 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens 3 --max-num-batched-tokens 2048
|
||||
--temp 1.0 --top-p 0.95 --top-k 20 --presence-penalty 1.5
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
container_name: radiance-ornith-1.5-35b-a3b
|
||||
command: >
|
||||
--model /models/ornith-1.5-35b-a3b-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 262144 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens 3 --max-num-batched-tokens 2048
|
||||
--temp 1.0 --top-p 0.95 --top-k 20 --presence-penalty 1.5
|
||||
@@ -12,5 +12,5 @@ services:
|
||||
container_name: radiance-qwen-image-turbo
|
||||
command: >
|
||||
--model /models/qwen-image-2.1-turbo-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --tp-wire wht6
|
||||
@@ -15,5 +15,5 @@ services:
|
||||
container_name: radiance-qwen-image
|
||||
command: >
|
||||
--model /models/qwen-image-2.1-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --tp-wire wht6
|
||||
@@ -11,5 +11,5 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/Qwen3-ASR-1.7B-hf
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 16
|
||||
@@ -6,5 +6,5 @@ services:
|
||||
container_name: radiance-qwen3.6-35b-a3b
|
||||
command: >
|
||||
--model /models/qwen3.6-35b-a3b-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 32 --max-model-len 200000 --kv-cache-dtype fp8
|
||||
@@ -6,5 +6,5 @@ services:
|
||||
container_name: radiance-qwen3.8-27b-bf16
|
||||
command: >
|
||||
--model /models/qwen3.8-27b-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 200000 --kv-cache-dtype fp8
|
||||
@@ -7,5 +7,5 @@ services:
|
||||
container_name: radiance-qwen3.8-27b-fp8
|
||||
command: >
|
||||
--model /models/qwen3.8-27b-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 32 --max-model-len 200000 --kv-cache-dtype fp8
|
||||
@@ -8,5 +8,5 @@ services:
|
||||
container_name: radiance-qwen3.8-27b-mxfp4
|
||||
command: >
|
||||
--model /models/qwen3.8-27b-mxfp4.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 32 --max-model-len 200000 --kv-cache-dtype fp8
|
||||
@@ -8,6 +8,6 @@ services:
|
||||
container_name: radiance-qwen3.8-27b-paro
|
||||
command: >
|
||||
--model /models/qwen3.8-27b-paro-int4.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 8 --max-model-len 200000 --kv-cache-dtype fp8
|
||||
--max-num-batched-tokens 2048 --embedding-placement ram --host-pool-mib 3072
|
||||
@@ -12,7 +12,7 @@ services:
|
||||
container_name: radiance-sage-a1.5-df2
|
||||
command: >
|
||||
--model /models/sage-a1.5-fp8-df2.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 4 --max-model-len 32768 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens auto --max-num-batched-tokens 2048
|
||||
--temp 1.0 --top-p 0.95 --top-k 20 --presence-penalty 1.5
|
||||
@@ -14,7 +14,7 @@ services:
|
||||
container_name: radiance-sage-a1.5-mxfp4-df2
|
||||
command: >
|
||||
--model /models/sage-a1.5-mxfp4-df2.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 10 --max-model-len 262144 --kv-cache-dtype fp8
|
||||
--gpu-headroom-mib 96
|
||||
--num-speculative-tokens auto --max-num-batched-tokens 2048
|
||||
|
||||
@@ -13,7 +13,7 @@ services:
|
||||
container_name: radiance-sage-a1.5-tp1
|
||||
command: >
|
||||
--model /models/sage-a1.5-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 1 --max-model-len 262144 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens 3 --max-num-batched-tokens 2048
|
||||
--placement expert_tiered --host-pool-mib 8192
|
||||
|
||||
@@ -15,7 +15,7 @@ services:
|
||||
container_name: radiance-sage-a1.5
|
||||
command: >
|
||||
--model /models/sage-a1.5-fp8.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 4 --max-model-len 32768 --kv-cache-dtype fp8
|
||||
--num-speculative-tokens 3 --max-num-batched-tokens 2048
|
||||
--temp 1.0 --top-p 0.95 --top-k 20 --presence-penalty 1.5
|
||||
@@ -11,5 +11,5 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/illustrious-xl-v2.0-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1
|
||||
File diff suppressed because it is too large.
Load diff
@@ -15,6 +15,6 @@ services:
|
||||
- ./gemma3.jinja:/templates/gemma3.jinja:ro
|
||||
command: >
|
||||
--model /models/translategemma-27b-mxfp4-gptq.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 2 --max-num-seqs 8 --max-model-len 16384 --kv-cache-dtype fp8
|
||||
--override-chat-template /templates/gemma3.jinja
|
||||
@@ -19,7 +19,7 @@ services:
|
||||
ROCR_VISIBLE_DEVICES: "${RADIANCE_GPU:-0}"
|
||||
command: >
|
||||
--model /models/unlimited-ocr-bf16.rad
|
||||
--host :: --port ${PORT:-8000} --api-key ${RADIANCE_API_KEY:?set RADIANCE_API_KEY in .env}
|
||||
--host :: --port ${PORT:-8000} --api-key-env RADIANCE_API_KEY
|
||||
--tp 1 --max-num-seqs 8 --max-model-len 32768 --kv-cache-dtype fp8
|
||||
--gpu-headroom-mib 96
|
||||
--override-chat-template /chat-templates/unlimited-ocr-parser.jinja
|
||||
+9
-1
@@ -340,7 +340,13 @@ It needs only `curl` and `jq`. Re-running resumes: a file whose local size match
|
||||
short one is continued. When a repo carries `.safetensors`, other weight formats (`.bin`, ONNX, GGUF,
|
||||
...) are not fetched. `HF_TOKEN` authenticates a gated or private repo; `HFGET_JOBS` sets concurrency
|
||||
(default 4). A complete fetch records each file's content key (its LFS sha256, or a small file's size)
|
||||
in `.hfget-manifest`, so the next run also fetches a file that changed at the same size. The
|
||||
in `.hfget-manifest`, so the next run also fetches a file that changed at the same size. An LFS
|
||||
file's recorded key is verified, not just claimed: the download is hashed and compared against
|
||||
the sha256 the listing names before the file is kept. A listing that names a file outside the
|
||||
destination — an absolute path, a `..` segment — is refused whole rather than half-obeyed.
|
||||
Fetch what you will serve from a revision you chose: without `--model-revision` a repo id tracks
|
||||
the repo's `main` branch, so a restart can bring weights nobody reviewed; name a tag or a
|
||||
commit sha. The
|
||||
free-space check counts only what is still to fetch.
|
||||
|
||||
`--model` also takes a repo id:
|
||||
@@ -2029,6 +2035,7 @@ by 0.002-0.003 nats.
|
||||
|---|---|
|
||||
| `--model PATH` | required: the `.rad` container, a checkpoint served as it stands (§3.4), or a Hugging Face repo id fetched before startup (§3.1) |
|
||||
| `--download-dir DIR` | where a repo id is fetched to. Default `$XDG_CACHE_HOME/radiance/hf`, else `~/.cache/radiance/hf` |
|
||||
| `--model-revision REV` | the hub revision a repo id is fetched at — a branch, tag, full commit sha or `refs/pr/N`. Default the repo's moving `main` branch; a deployment that must not restart onto weights nobody reviewed should name a tag or a sha (§3.1) |
|
||||
| `--control-vector off\|on\|disabled` | `disabled` (and no flag at all) loads nothing, declares no projection op and refuses a request that asks; `off` loads the vector found for this model and starts requests off; `on` starts them on. Refused at startup when the model's plugin does not apply control vectors or no compatible file is found (§4.10) |
|
||||
| `--radiance-home DIRS` | where `kernels/`, `architectures/` and `quantizers/` live; homes separated by `:` are searched in order, the first winning (§1.5) |
|
||||
| `--kernels LIST` | the kernel libraries to use, separated by `,` or `:`, first wins; a library not named is not loaded. Default: every library found |
|
||||
@@ -2121,6 +2128,7 @@ by 0.002-0.003 nats.
|
||||
| `--host ADDR` | 0.0.0.0 | listen address |
|
||||
| `--port N` | 8000 | listen port |
|
||||
| `--api-key KEY` | none | require `Authorization: Bearer KEY` or `X-Api-Key: KEY` on every request but `/health`, `/v1/health`, `/ping` and the dashboard page (§6.6); the key must be non-empty |
|
||||
| `--api-key-env NAME` | — | read the API key from the environment variable `NAME` instead of the command line, where every process on the machine reads it in `ps`; an unset or empty `NAME` refuses startup like an empty `--api-key` |
|
||||
| `--allow-host NAME` | — | a `Host` name the keyless loopback-only routes accept besides the loopback names; repeatable (§6.6) |
|
||||
| `--served-model-name NAME` | container's name | the model id `/v1/models` lists, the metrics carry and a response names when its request named none. A request may name any model; the loaded one serves it |
|
||||
| `--mm-max-patches N` | auto | patches one vision-encoder pass carries, and so the largest image (a patch is 16x16 pixels, 14x14 on GLM-5.3). `auto` is 16384 when the container carries a vision tower; 0 serves text only and keeps the tower off the card. A pass is not one tower invocation: inside it the tower batches at most 8 tiles per weight read, and the pass size may reduce that (4 tiles at the 64-pixel grid with the default 16384 patches); a picture contributes a separate pass per grid. See the concurrency notes for Unlimited-OCR (§5.17) |
|
||||
|
||||
+38
-1
@@ -12,7 +12,15 @@
|
||||
# A changed file is fetched again even at the same size. A complete run records each file's content
|
||||
# key (the LFS sha256, or the size for a small file) in <dest>/.hfget-manifest, and a later run
|
||||
# compares the listing against it. The manifest is written only when every file arrived, so its
|
||||
# presence means the directory is a complete copy of some revision.
|
||||
# presence means the directory is a complete copy of some revision. An LFS file's key is verified:
|
||||
# the download is hashed and compared against the oid the listing claims before the file is kept,
|
||||
# so the hub cannot hand back one file for another and a resumed transfer cannot splice into a
|
||||
# plausible size.
|
||||
#
|
||||
# A file whose listed name would land outside the destination -- absolute, carrying a `..`
|
||||
# segment, holding control characters, or naming hfget's own manifest -- is not a repo listing:
|
||||
# the whole listing is refused. Skipping such an entry silently would leave a directory that
|
||||
# reads as complete and is not.
|
||||
#
|
||||
# Exit status: 0 complete; 3 nothing on disk was changed (the listing could not be read, or what is
|
||||
# still to fetch does not fit), so a complete earlier copy is intact; anything else, a transfer
|
||||
@@ -35,6 +43,13 @@ set -e
|
||||
# sh cannot export a function, so each file is a re-entry of this script under `xargs -P`.
|
||||
if [ -n "$HFGET_CHILD" ]; then
|
||||
size=${1%% *}; rest=${1#* }; oid=${rest%% *}; path=${rest#* }
|
||||
# The parent has vetted every name; this holds anyway, because $out is written straight
|
||||
# from it and an escape writes outside the directory the operator named.
|
||||
case "$path" in
|
||||
""|/*|*/|.|..|../*|*/../*)
|
||||
echo "hfget: refusing a file named '$path', which does not land inside the destination" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
key=${oid:-$size} # LFS: sha256, non-LFS: size
|
||||
out=$HFGET_DEST/$path
|
||||
man=$HFGET_DEST/.hfget-manifest
|
||||
@@ -63,6 +78,17 @@ if [ -n "$HFGET_CHILD" ]; then
|
||||
fi
|
||||
got=$(wc -c < "$out")
|
||||
[ "$got" = "$size" ] || { echo "hfget: $path is $got bytes, listing says $size" >&2; exit 1; }
|
||||
# An LFS name carries the sha256 the hub claims. Believe it only after computing it: the
|
||||
# size check alone would take a swapped file at the same length, and a spliced resume at a
|
||||
# resumed length. A mismatch deletes the file -- a fresh transfer is the only repair -- and
|
||||
# nothing reaches the manifest.
|
||||
if [ -n "$oid" ]; then
|
||||
got=$(sha256sum "$out" | awk '{print $1}')
|
||||
[ "$got" = "${oid#sha256:}" ] || {
|
||||
echo "hfget: $path hashes to $got, the listing claims ${oid#sha256:}" >&2
|
||||
rm -f "$out"
|
||||
exit 1; }
|
||||
fi
|
||||
printf '%s\t%s\n' "$key" "$path" >> "$HFGET_MAN_OUT"
|
||||
exit 0
|
||||
fi
|
||||
@@ -75,6 +101,7 @@ rev=${3:-main}
|
||||
jobs=${HFGET_JOBS:-4}
|
||||
command -v jq >/dev/null || { echo "hfget: jq is required" >&2; exit 2; }
|
||||
command -v curl >/dev/null || { echo "hfget: curl is required" >&2; exit 2; }
|
||||
command -v sha256sum >/dev/null || { echo "hfget: sha256sum is required to verify LFS files" >&2; exit 2; }
|
||||
|
||||
echo "hfget: listing $repo@$rev"
|
||||
# The listing is paginated (fifty entries per page, next page in a `Link: ...; rel="next"`
|
||||
@@ -108,6 +135,16 @@ while [ -n "$api" ]; do
|
||||
[ "$page" -gt 200 ] && { echo "hfget: listing did not terminate after 200 pages" >&2; exit 1; }
|
||||
done
|
||||
echo "hfget: $page page(s) of listing"
|
||||
# A file name that does not land inside the destination is not a listing oddity: an absolute
|
||||
# path, a `..` segment, a control character (a tab splices one entry into two fields of the
|
||||
# transfer list), or a name shadowing hfget's own manifest, which the next run would read back
|
||||
# as its record of verified content. Name the entry and stop; skipping silently would leave a
|
||||
# directory that reads as complete and is not.
|
||||
bad=$(printf '%s' "$listing" | jq -r '[.[] | select(.type == "file")
|
||||
| select((.path | test("(^/|(^|/)\\.\\.(/|$))"))
|
||||
or (.path | test("[[:cntrl:]]"))
|
||||
or (.path | test("(^|/)[.]hfget-manifest")))] | map(.path) | join(", ")')
|
||||
[ -n "$bad" ] && { echo "hfget: the listing names '$bad', which does not land inside the destination" >&2; exit 1; }
|
||||
have_st=$(printf '%s' "$listing" | jq '[.[] | select(.path | endswith(".safetensors"))] | length')
|
||||
sel='.[] | select(.type == "file")'
|
||||
[ "$have_st" -gt 0 ] && sel="$sel"' | select((.path | test("\\.(bin|msgpack|h5|onnx|onnx_data|gguf)$") or test("(^|/)(pytorch_model|consolidated)[^/]*\\.pth$")) | not)'
|
||||
|
||||
@@ -102,6 +102,21 @@ TEST(an_empty_api_key_is_refused) {
|
||||
CHECK(c.api_key == "k");
|
||||
}
|
||||
|
||||
/* --api-key-env reads the key where `ps` cannot: the empty-value refusal's sibling is the
|
||||
* never-set one -- a compose environment: or unit Environment= line with a typo'd name must
|
||||
* refuse at startup, not serve keyless under a guarded-looking command line. */
|
||||
TEST(an_api_key_env_that_is_unset_is_refused_and_one_that_is_set_is_the_key) {
|
||||
unsetenv("RAD_TEST_KEY_ENV");
|
||||
CHECK_EQ(parse_fresh({ "--api-key-env", "RAD_TEST_KEY_ENV" }), RAD_E_INVAL);
|
||||
CHECK_EQ(parse_fresh({ "--api-key-env", "" }), RAD_E_INVAL);
|
||||
setenv("RAD_TEST_KEY_ENV", "s3cret", 1);
|
||||
Config c;
|
||||
CHECK_EQ(parse({ "--api-key-env", "RAD_TEST_KEY_ENV" }, &c), 0);
|
||||
CHECK(c.api_key == "s3cret");
|
||||
CHECK(c.api_key_env == "RAD_TEST_KEY_ENV");
|
||||
unsetenv("RAD_TEST_KEY_ENV");
|
||||
}
|
||||
|
||||
/* --allow-host repeats: the loopback-only routes take the set of names, and an empty one is
|
||||
* a hole cut by a typo, so it is refused like the empty key. */
|
||||
TEST(allow_host_repeats_and_refuses_the_empty_name) {
|
||||
@@ -467,6 +482,7 @@ std::vector<std::pair<std::string, std::string>> usage_options() {
|
||||
const std::map<std::string, std::vector<std::string>>& legal_values() {
|
||||
static const std::map<std::string, std::vector<std::string>> v = {
|
||||
{ "--model", { "/m/y.rad" } }, { "--download-dir", { "/d" } },
|
||||
{ "--model-revision", { "v1.2" } },
|
||||
{ "--radiance-home", { "/h1:/h2" } }, { "--kernels", { "libref" } },
|
||||
{ "--tp", { "2" } }, { "--tp-wire", { "wht6" } }, { "--tp-wire-min-kb", { "64" } },
|
||||
{ "--tp-attn-split", { "rows" } }, { "--weight-prefetch", { "off" } },
|
||||
@@ -492,6 +508,7 @@ const std::map<std::string, std::vector<std::string>>& legal_values() {
|
||||
{ "--draft-window", { "fixed" } }, { "--draft-short-from", { "4" } },
|
||||
{ "--draft-coupling", { "on" } },
|
||||
{ "--host", { "127.0.0.1" } }, { "--port", { "8001" } }, { "--api-key", { "k" } },
|
||||
{ "--api-key-env", { "RAD_KEY_ENV_INVENTORY" } },
|
||||
{ "--allow-host", { "box" } },
|
||||
{ "--served-model-name", { "m" } }, { "--mm-max-patches", { "1024" } },
|
||||
{ "--control-vector", { "off" } },
|
||||
@@ -549,6 +566,9 @@ const std::map<std::string, std::vector<std::string>>& legal_values() {
|
||||
* setting. */
|
||||
TEST(every_listed_option_parses_and_is_reported_as_given) {
|
||||
LogGuard lg;
|
||||
/* --api-key-env resolves at parse time and fails closed on an unset name, so the inventory
|
||||
* needs the variable it names to exist. */
|
||||
setenv("RAD_KEY_ENV_INVENTORY", "inventory-key", 1);
|
||||
const auto opts = usage_options();
|
||||
CHECK(opts.size() > 90);
|
||||
const std::vector<std::string> names = diag::config_option_names();
|
||||
|
||||
@@ -254,6 +254,146 @@ TEST(a_pth_that_is_not_the_weights_again_is_fetched_beside_the_safetensors) {
|
||||
CHECK(!fs::exists(root.path + "/pytorch_model.bin"));
|
||||
}
|
||||
|
||||
/* A listing that names a file outside the destination -- absolute, or a `..` segment -- is not
|
||||
* a listing of a repo at all, so hfget.sh refuses the whole thing rather than half-obeying it:
|
||||
* silently skipping the entry would leave a directory that reads as complete and is not, and
|
||||
* the manifest would certify it. */
|
||||
const char* kEscapeListing =
|
||||
"#!/bin/sh\n"
|
||||
"for a in \"$@\"; do case \"$a\" in *api/models*)\n"
|
||||
" printf '[{\"type\":\"file\",\"path\":\"../escape.bin\",\"size\":1},"
|
||||
"{\"type\":\"file\",\"path\":\"kept.bin\",\"size\":1}]'; exit 0;; esac; done\n"
|
||||
"exit 22\n";
|
||||
|
||||
TEST(a_listing_naming_a_path_outside_the_destination_is_refused) {
|
||||
NEED_ARTIFACT(hfget_beside_this_binary());
|
||||
if (!on_path("jq")) SKIP("no jq on PATH, which hfget.sh needs");
|
||||
TempDir root;
|
||||
REQUIRE(!root.path.empty());
|
||||
FakeCurl curl(kEscapeListing);
|
||||
const std::string cmd = "sh '" + hfget_beside_this_binary() +
|
||||
"' radiance-test-owner/radiance-test-model '" + root.path +
|
||||
"' >/dev/null 2>'" + root.path + "/err'";
|
||||
CHECK(std::system(cmd.c_str()) != 0);
|
||||
CHECK(!fs::exists(root.path + "/escape.bin"));
|
||||
CHECK(!fs::exists(root.path + "/kept.bin")); /* the whole listing is refused */
|
||||
CHECK(!fs::exists(root.path + "/.hfget-manifest"));
|
||||
std::string err;
|
||||
if (FILE* e = std::fopen((root.path + "/err").c_str(), "r")) {
|
||||
char buf[256];
|
||||
size_t n;
|
||||
while ((n = std::fread(buf, 1, sizeof buf - 1, e)) > 0) { buf[n] = '\0'; err += buf; }
|
||||
std::fclose(e);
|
||||
}
|
||||
CHECK(has(err, "does not land inside the destination"));
|
||||
}
|
||||
|
||||
/* An LFS file's oid is the hub's claim about its bytes; the download is kept only once those
|
||||
* bytes hash to it -- the size check alone would take a swapped file of the same length, and a
|
||||
* spliced resume at any length the hub likes. A mismatch deletes the file and fails the run;
|
||||
* a match lands in the manifest, which is what makes "warm" mean verified-warm after. */
|
||||
const char* kBadOid =
|
||||
"#!/bin/sh\n"
|
||||
"out=''; url=''; prev=''\n"
|
||||
"for a in \"$@\"; do\n"
|
||||
" [ \"$prev\" = -o ] && out=\"$a\"\n"
|
||||
" case \"$a\" in https://*) url=\"$a\";; esac\n"
|
||||
" prev=\"$a\"\n"
|
||||
"done\n"
|
||||
"case \"$url\" in *api/models*)\n"
|
||||
" printf '[{\"type\":\"file\",\"path\":\"big.bin\",\"size\":10,"
|
||||
"\"lfs\":{\"oid\":\"0000000000000000000000000000000000000000000000000000000000000000\"}}]';"
|
||||
" exit 0;; esac\n"
|
||||
"[ -n \"$out\" ] && printf 0123456789 > \"$out\"\n"
|
||||
"exit 0\n";
|
||||
|
||||
const char* kGoodOid =
|
||||
"#!/bin/sh\n"
|
||||
"out=''; url=''; prev=''\n"
|
||||
"for a in \"$@\"; do\n"
|
||||
" [ \"$prev\" = -o ] && out=\"$a\"\n"
|
||||
" case \"$a\" in https://*) url=\"$a\";; esac\n"
|
||||
" prev=\"$a\"\n"
|
||||
"done\n"
|
||||
"case \"$url\" in *api/models*)\n"
|
||||
" oid=$(printf 0123456789 | sha256sum | cut -d' ' -f1)\n"
|
||||
" printf '[{\"type\":\"file\",\"path\":\"big.bin\",\"size\":10,\"lfs\":{\"oid\":\"%s\"}}]'"
|
||||
" \"$oid\"; exit 0;; esac\n"
|
||||
"[ -n \"$out\" ] && printf 0123456789 > \"$out\"\n"
|
||||
"exit 0\n";
|
||||
|
||||
TEST(an_lfs_file_that_does_not_hash_to_its_oid_is_not_kept) {
|
||||
NEED_ARTIFACT(hfget_beside_this_binary());
|
||||
if (!on_path("jq")) SKIP("no jq on PATH, which hfget.sh needs");
|
||||
if (!on_path("sha256sum")) SKIP("no sha256sum on PATH, which hfget.sh needs");
|
||||
TempDir root;
|
||||
REQUIRE(!root.path.empty());
|
||||
const std::string fetch = "sh '" + hfget_beside_this_binary() +
|
||||
"' radiance-test-owner/radiance-test-model '" + root.path +
|
||||
"' >/dev/null 2>'" + root.path + "/err'";
|
||||
{
|
||||
FakeCurl curl(kBadOid);
|
||||
CHECK(std::system(fetch.c_str()) != 0);
|
||||
CHECK(!fs::exists(root.path + "/big.bin")); /* deleted, not left to be resumed */
|
||||
CHECK(!fs::exists(root.path + "/.hfget-manifest"));
|
||||
std::string err;
|
||||
if (FILE* e = std::fopen((root.path + "/err").c_str(), "r")) {
|
||||
char buf[256];
|
||||
size_t n;
|
||||
while ((n = std::fread(buf, 1, sizeof buf - 1, e)) > 0) { buf[n] = '\0'; err += buf; }
|
||||
std::fclose(e);
|
||||
}
|
||||
CHECK(has(err, "hashes to"));
|
||||
}
|
||||
{
|
||||
FakeCurl curl(kGoodOid);
|
||||
CHECK_EQ(std::system(fetch.c_str()), 0);
|
||||
CHECK(fs::exists(root.path + "/big.bin"));
|
||||
CHECK_EQ(fs::file_size(root.path + "/big.bin"), 10u);
|
||||
CHECK(fs::exists(root.path + "/.hfget-manifest")); /* the verified copy is certified */
|
||||
}
|
||||
}
|
||||
|
||||
/* --model-revision names the revision the fetch reads: the pinned ref is the one listed, and
|
||||
* an unpinned fetch reads the repo's moving default branch -- which a deployment must be able
|
||||
* to refuse outright rather than restart onto. */
|
||||
const char* kPinnedOnly =
|
||||
"#!/bin/sh\n"
|
||||
"out=''; url=''; prev=''\n"
|
||||
"for a in \"$@\"; do\n"
|
||||
" [ \"$prev\" = -o ] && out=\"$a\"\n"
|
||||
" case \"$a\" in https://*) url=\"$a\";; esac\n"
|
||||
" prev=\"$a\"\n"
|
||||
"done\n"
|
||||
"case \"$url\" in *api/models*/tree/refs/pr/42*)\n"
|
||||
" printf '[{\"type\":\"file\",\"path\":\"m.rad\",\"size\":10}]'; exit 0;; esac\n"
|
||||
"case \"$url\" in *api/models*) exit 22;; esac\n"
|
||||
"[ -n \"$out\" ] && printf 0123456789 > \"$out\"\n"
|
||||
"exit 0\n";
|
||||
|
||||
TEST(the_pinned_revision_is_the_revision_fetched) {
|
||||
NEED_ARTIFACT(hfget_beside_this_binary());
|
||||
if (!on_path("jq")) SKIP("no jq on PATH, which hfget.sh needs");
|
||||
TempDir root;
|
||||
REQUIRE(!root.path.empty());
|
||||
FakeCurl curl(kPinnedOnly);
|
||||
const std::string repo = "radiance-test-owner/radiance-test-model";
|
||||
auto resolve = [&](const char* rev, std::string* model) {
|
||||
Config c;
|
||||
c.model = repo;
|
||||
c.download_dir = root.path;
|
||||
if (rev) c.model_revision = rev;
|
||||
bool ok = false;
|
||||
stderr_of([&] { ok = resolve_hf_model(c); });
|
||||
*model = c.model;
|
||||
return ok;
|
||||
};
|
||||
std::string model;
|
||||
CHECK(!resolve(nullptr, &model)); /* main: this hub has nothing there */
|
||||
CHECK(resolve("refs/pr/42", &model));
|
||||
CHECK_EQ(model, root.path + "/" + repo + "/m.rad");
|
||||
}
|
||||
|
||||
/* With no --download-dir and neither XDG_CACHE_HOME nor HOME there is nowhere to fetch to, which
|
||||
* is refused by name before anything runs. */
|
||||
TEST(a_repo_id_with_nowhere_to_fetch_to_is_refused) {
|
||||
|
||||
Reference in new issue
Block a user