From: Georgi Gerganov Date: Tue, 7 Oct 2025 12:57:14 +0000 (+0300) Subject: server : add `/v1/health` endpoint (#16461) X-Git-Tag: upstream/0.0.6764~56 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=df1b612e29ba97a2e67db339b1e8c7465702b7e8;p=pkg%2Fggml%2Fsources%2Fllama.cpp server : add `/v1/health` endpoint (#16461) * server : add /v1/health endpoint * cont : update readme --- diff --git a/tools/server/README.md b/tools/server/README.md index 6825c8bf..e23b122a 100644 --- a/tools/server/README.md +++ b/tools/server/README.md @@ -393,7 +393,7 @@ node index.js ### GET `/health`: Returns health check result -This endpoint is public (no API key check). +This endpoint is public (no API key check). `/v1/health` also works. **Response format** diff --git a/tools/server/server.cpp b/tools/server/server.cpp index a2114761..30765376 100644 --- a/tools/server/server.cpp +++ b/tools/server/server.cpp @@ -4184,6 +4184,7 @@ int main(int argc, char ** argv) { auto middleware_validate_api_key = [¶ms, &res_error](const httplib::Request & req, httplib::Response & res) { static const std::unordered_set public_endpoints = { "/health", + "/v1/health", "/models", "/v1/models", "/api/tags" @@ -5232,6 +5233,7 @@ int main(int argc, char ** argv) { // register API routes svr->Get (params.api_prefix + "/health", handle_health); // public endpoint (no API key check) + svr->Get (params.api_prefix + "/v1/health", handle_health); // public endpoint (no API key check) svr->Get (params.api_prefix + "/metrics", handle_metrics); svr->Get (params.api_prefix + "/props", handle_props); svr->Post(params.api_prefix + "/props", handle_props_change);