Skip to content

Commit c19fb26

Browse files
authored
Merged back lost commits in common and arg
1 parent 09bc6d5 commit c19fb26

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

common/arg.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1859,9 +1859,23 @@ gpt_params_context gpt_params_parser_init(gpt_params & params, llama_example ex,
18591859
params.endpoint_metrics = true;
18601860
}
18611861
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_ENDPOINT_METRICS"));
1862+
add_opt(llama_arg(
1863+
{"--slots"},
1864+
format("enable slots monitoring endpoint (default: %s)", params.endpoint_slots ? "enabled" : "disabled"),
1865+
[](gpt_params & params) {
1866+
params.endpoint_slots = true;
1867+
}
1868+
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_ENDPOINT_SLOTS"));
1869+
add_opt(llama_arg(
1870+
{"--props"},
1871+
format("enable changing global properties via POST /props (default: %s)", params.endpoint_props ? "enabled" : "disabled"),
1872+
[](gpt_params & params) {
1873+
params.endpoint_props = true;
1874+
}
1875+
).set_examples({LLAMA_EXAMPLE_SERVER}).set_env("LLAMA_ARG_ENDPOINT_PROPS"));
18621876
add_opt(llama_arg(
18631877
{"--no-slots"},
1864-
format("disables slots monitoring endpoint (default: %s)", params.endpoint_slots ? "enabled" : "disabled"),
1878+
"disables slots monitoring endpoint",
18651879
[](gpt_params & params) {
18661880
params.endpoint_slots = false;
18671881
}

common/common.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ struct gpt_params {
294294
std::string ssl_file_key = ""; // NOLINT
295295
std::string ssl_file_cert = ""; // NOLINT
296296

297-
bool endpoint_slots = true;
297+
// "advanced" endpoints are disabled by default for better security
298+
bool webui = true;
299+
bool endpoint_slots = false;
300+
bool endpoint_props = false; // only control POST requests, not GET
298301
bool endpoint_metrics = false;
299302

300303
bool log_json = false;

0 commit comments

Comments
 (0)