Skip to content

Commit 0d161f0

Browse files
authored
server : enable /slots by default and make it secure (ggml-org#15630)
* server : enable /slots by default and make it secure ggml-ci * server : fix tests to pass `--no-slots` when necessary * server : extend /props with info about enabled endpoints
1 parent 4efd5a8 commit 0d161f0

File tree

5 files changed

+200
-47
lines changed

5 files changed

+200
-47
lines changed

common/arg.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2962,20 +2962,20 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
29622962
params.endpoint_metrics = true;
29632963
}
29642964
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_ENDPOINT_METRICS"));
2965-
add_opt(common_arg(
2966-
{"--slots"},
2967-
string_format("enable slots monitoring endpoint (default: %s)", params.endpoint_slots ? "enabled" : "disabled"),
2968-
[](common_params & params) {
2969-
params.endpoint_slots = true;
2970-
}
2971-
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_ENDPOINT_SLOTS"));
29722965
add_opt(common_arg(
29732966
{"--props"},
29742967
string_format("enable changing global properties via POST /props (default: %s)", params.endpoint_props ? "enabled" : "disabled"),
29752968
[](common_params & params) {
29762969
params.endpoint_props = true;
29772970
}
29782971
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_ENDPOINT_PROPS"));
2972+
add_opt(common_arg(
2973+
{"--slots"},
2974+
string_format("enable slots monitoring endpoint (default: %s)", params.endpoint_slots ? "enabled" : "disabled"),
2975+
[](common_params & params) {
2976+
params.endpoint_slots = true;
2977+
}
2978+
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_ENDPOINT_SLOTS"));
29792979
add_opt(common_arg(
29802980
{"--no-slots"},
29812981
"disables slots monitoring endpoint",

common/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ struct common_params {
444444

445445
// "advanced" endpoints are disabled by default for better security
446446
bool webui = true;
447-
bool endpoint_slots = false;
447+
bool endpoint_slots = true;
448448
bool endpoint_props = false; // only control POST requests, not GET
449449
bool endpoint_metrics = false;
450450

0 commit comments

Comments
 (0)