serve: /v1/models reports max_model_len, the context the server runs with

The model list carried only the id, so a client had no way to read the context the server
was started with and guessed it from the model's name. Carry the field vLLM's model card does:
the server's max_ctx (--max-model-len, else the container's trained length), on both
/v1/models and /v1/models/:id, and leave it out when the length is unknown.
This commit is contained in:
baKon authored and StillDeadcode committed 2026-10-08 15:57:51 +02:00
1 parent 7fd2cd7fa6
commit 86128c2e75
6 files changed
+33 -5

No files matched your search

+1 -1
View File
@@ -1154,7 +1154,7 @@ HttpResponse Server::handle_models(const HttpRequest& req) {
return error_response(e, req.peer);
}
metrics_.observe_http(200);
return HttpResponse::json_body(200, models_body(opt_.model_id, started_at_));
return HttpResponse::json_body(200, models_body(opt_.model_id, started_at_, opt_.max_ctx));
}
HttpResponse Server::handle_metrics(const HttpRequest&) {