Archived
- #47: llama-server's request fields, routes and sampler order, and /props (with baKon's model entry: max_model_len, root and capabilities on /v1/models, and /v1/models/:id) - new APIs: Anthropic's Messages API (/v1/messages), OpenAI's Responses API (/v1/responses), llama-server's /completion and /infill, logprobs (OpenAI's logprobs and top_logprobs, up to 20; llama-server's n_probs), OpenAI's legacy `functions`, and X-Api-Key beside the bearer key - #4: --model takes a Hugging Face repo id (owner/name), fetched before startup into ~/.cache/radiance/hf or --download-dir and checked for changes at every start (redxherring) - #46: --tp 3 --tp-wire wht6 serves -- a three-rank two-shot all-reduce with uneven shards and the tiered-int8 wire over it (baKon); scripts/cardclock.py names what holds each card's clock under load (baKon) - CPU-only serving works again; --kernels names the kernel libraries to load; a model the loaded libraries cannot fully serve refuses at startup instead of failing its first request; --vram-kv-mib and --vram-weights-mib are gone (the split is automatic) - --embedding-placement ram is the default, and `auto` is gone - #40: Swift 1.5 recipes; rad-convert reads which shard holds a tensor from the index - #53: the pinned host pool gets huge pages where shmem THP is off; #57: a crash on video with an odd frame width is fixed
34 lines
1.5 KiB
C++
34 lines
1.5 KiB
C++
/* hf_model.h -- a --model that names a Hugging Face repo instead of a local path.
|
|
*
|
|
* `radiance --model StillDeadcode/minicpm5-2b-fp8` fetches the repo with scripts/hfget.sh into
|
|
* the download directory and serves what it fetched: the one container at the repo's top level,
|
|
* or the directory as a checkpoint when it holds none. Every start re-checks the hub, so a
|
|
* changed file is fetched again before bring-up; a start that cannot reach the hub serves the
|
|
* copy a complete earlier fetch left. */
|
|
#pragma once
|
|
|
|
#include "rad_core.h"
|
|
|
|
#include <string>
|
|
|
|
namespace rad {
|
|
|
|
/* Is `s` a repo id ("owner/name") rather than a path? A path that exists always wins. A repo id is
|
|
* exactly two non-empty parts of [A-Za-z0-9._-], neither starting with '.' or '-', and a name that
|
|
* does not end like a model file (.rad, .safetensors, .gguf, .json): a missing local file should
|
|
* be reported as missing, not looked up on the hub. */
|
|
bool hf_repo_id(const std::string& s);
|
|
|
|
/* $XDG_CACHE_HOME/radiance/hf, else $HOME/.cache/radiance/hf; empty if neither is set. */
|
|
std::string hf_default_download_dir();
|
|
|
|
/* What to serve from a fetched repo directory: its one top-level .rad, or the directory itself (a
|
|
* checkpoint) when it holds none. Several containers are ambiguous: empty, and *why names them. */
|
|
std::string hf_served_path(const std::string& dir, std::string* why);
|
|
|
|
/* If c.model is a repo id, fetch it and point c.model at what to serve. False after an error has
|
|
* been logged. */
|
|
bool resolve_hf_model(Config& c);
|
|
|
|
} /* namespace rad */
|