]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : add `/v1/health` endpoint (#16461)
authorGeorgi Gerganov <redacted>
Tue, 7 Oct 2025 12:57:14 +0000 (15:57 +0300)
committerGitHub <redacted>
Tue, 7 Oct 2025 12:57:14 +0000 (15:57 +0300)
* server : add /v1/health endpoint

* cont : update readme

tools/server/README.md
tools/server/server.cpp

index 6825c8bf300c6887504b251cffc03587a0a35966..e23b122ab148ccec3905e1547b25a71d05199010 100644 (file)
@@ -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**
 
index a21147613db0021898ecac4ff2ceb04396b15f62..307653764cc759733c678fe6efe0c7ba34838f99 100644 (file)
@@ -4184,6 +4184,7 @@ int main(int argc, char ** argv) {
     auto middleware_validate_api_key = [&params, &res_error](const httplib::Request & req, httplib::Response & res) {
         static const std::unordered_set<std::string> 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);