diff --git a/frontend/strata_context.cpp b/frontend/strata_context.cpp index 5b0c22b..f597853 100644 --- a/frontend/strata_context.cpp +++ b/frontend/strata_context.cpp @@ -975,7 +975,11 @@ void strata_context::init_routes(server_http_context & http) { res->error(format_error_response("the engine is not running", ERROR_TYPE_UNAVAILABLE)); return res; } - res->ok({{"status", "ok"}, {"busy", I->slot.active()}}); + // llama.cpp's shape ("status") plus the fields upstream PolyStrata clients (tools/strata_bench.py, + // its is_strata / wait_ready) look for: "service" and "loaded". The engine only serves once loaded. + res->ok({{"status", "ok"}, {"busy", I->slot.active()}, + {"service", "strata"}, {"loaded", true}, + {"model", I->model_name}, {"max_context", I->n_ctx}}); return res; }; diff --git a/frontend/tests/e2e.sh b/frontend/tests/e2e.sh index abbddb8..29d830b 100755 --- a/frontend/tests/e2e.sh +++ b/frontend/tests/e2e.sh @@ -33,6 +33,8 @@ done # /health and /v1/models h=$(curl -s "$URL/health"); check $([ "$(echo "$h" | j 'd["status"]')" = ok ] && echo 0 || echo 1) "/health: $h" +# upstream PolyStrata clients (tools/strata_bench.py) require these two to treat the server as a loaded strata server +check $([ "$(echo "$h" | j 'd["service"]')" = strata ] && [ "$(echo "$h" | j 'd["loaded"]')" = True ] && echo 0 || echo 1) "/health: service=strata loaded=true" m=$(curl -s "$URL/v1/models"); check $([ "$(echo "$m" | j 'd["data"][0]["id"]')" = fake ] && echo 0 || echo 1) "/v1/models id: $(echo "$m" | j '{k: d["data"][0].get(k) for k in ("id", "context_length")}')" # non-streaming chat