serve: the model entry names the file behind the served name as root

A served name is chosen for clients and says nothing about which container is behind it.
Report what --model named as `root`, the field vLLM fills with the path it loaded; left out
when the server has none.
This commit is contained in:
baKon authored and StillDeadcode committed 2026-10-08 15:57:51 +02:00
1 parent 3a3345951f
commit d5b584a4c1
8 files changed
+22 -3

No files matched your search

+1
View File
@@ -2264,6 +2264,7 @@ int Engine::run_server() {
* more choices a request; the floor keeps a small batch from refusing what it would queue. */
o.max_n = cfg_.max_n > 0 ? (int)cfg_.max_n : (int)std::max<int64_t>(o.max_n, cfg_.max_seqs);
o.max_ctx = cfg_.max_ctx ? cfg_.max_ctx : meta_.n_ctx_train;
o.model_path = cfg_.model;
o.default_reasoning_effort = cfg_.reasoning_effort;
o.reasoning_effort_map = cfg_.reasoning_effort_map;
o.default_thinking_budget = cfg_.thinking_token_budget;
+1
View File
@@ -2212,6 +2212,7 @@ static json model_card(const ModelCard& c) {
m["created"] = c.created;
m["owned_by"] = "radiance";
if (c.max_model_len > 0) m["max_model_len"] = c.max_model_len;
if (!c.root.empty()) m["root"] = c.root;
return m;
}
+2
View File
@@ -329,6 +329,8 @@ struct ModelCard {
* its own length. 0 leaves the field out rather than reporting a length the server does not
* know. */
int64_t max_model_len = 0;
/* What the server loaded (ServerOptions::model_path), vLLM's `root`. Empty leaves it out. */
std::string root;
};
/* The list, for GET /v1/models. */
std::string models_body(const ModelCard& m);
+1
View File
@@ -1157,6 +1157,7 @@ HttpResponse Server::handle_models(const HttpRequest& req) {
c.id = opt_.model_id;
c.created = started_at_;
c.max_model_len = opt_.max_ctx;
c.root = opt_.model_path;
metrics_.observe_http(200);
return HttpResponse::json_body(200, id.empty() ? models_body(c) : model_body(c));
}
+4
View File
@@ -57,6 +57,10 @@ struct ServerOptions {
* /v1/completions answer 501 naming /v1/embeddings, rather than queueing a request the engine
* would finish after one step with no text. */
bool embedding_model = false;
/* What --model named, reported as the model entry's `root` the way vLLM reports the path it
* loaded: a served name chosen for clients says nothing about which file is behind it. Empty
* leaves the field out. */
std::string model_path;
std::string host = "0.0.0.0";
int port = 8000;
int n_threads = 0;