Skip to content

Commit 175147e

Browse files
authored
server: remove all internal mentions about "webui" (ggml-org#24817)
1 parent fabde3b commit 175147e

7 files changed

Lines changed: 15 additions & 26 deletions

File tree

tools/server/server-context.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,7 @@ struct server_context_impl {
825825

826826
server_metrics metrics;
827827

828-
json json_ui_settings = json::object(); // Primary: new name
829-
json json_webui_settings = json::object(); // Deprecated: use json_ui_settings instead (kept for compat)
828+
json json_ui_settings = json::object();
830829

831830
// Necessary similarity of prompt for slot selection
832831
float slot_prompt_similarity = 0.0f;
@@ -1308,7 +1307,6 @@ struct server_context_impl {
13081307
try {
13091308
json json_settings = json::parse(cfg);
13101309
json_ui_settings = json_settings;
1311-
json_webui_settings = json_settings; // deprecated: keep in sync
13121310
} catch (const std::exception & e) {
13131311
SRV_ERR("%s: failed to parse UI config: %s\n", __func__, e.what());
13141312
return false;
@@ -3687,7 +3685,6 @@ server_context_meta server_context::get_meta() const {
36873685
/* has_inp_audio */ impl->chat_params.allow_audio,
36883686
/* has_inp_video */ impl->chat_params.allow_video,
36893687
/* json_ui_settings */ impl->json_ui_settings,
3690-
/* json_webui_settings */ impl->json_webui_settings, // Deprecated
36913688
/* slot_n_ctx */ impl->get_slot_n_ctx(),
36923689
/* pooling_type */ llama_pooling_type(impl->ctx_tgt),
36933690

@@ -4300,12 +4297,8 @@ void server_routes::init_routes() {
43004297
{ "endpoint_slots", params.endpoint_slots },
43014298
{ "endpoint_props", params.endpoint_props },
43024299
{ "endpoint_metrics", params.endpoint_metrics },
4303-
// New keys
43044300
{ "ui", params.ui },
43054301
{ "ui_settings", meta->json_ui_settings },
4306-
// Deprecated: use ui/ui_settings instead (kept for backward compat)
4307-
{ "webui", params.ui },
4308-
{ "webui_settings", meta->json_ui_settings },
43094302
{ "chat_template", tmpl_default },
43104303
{ "chat_template_caps", meta->chat_template_caps },
43114304
{ "bos_token", meta->bos_token_str },

tools/server/server-context.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ struct server_context_meta {
2222
bool has_inp_image;
2323
bool has_inp_audio;
2424
bool has_inp_video;
25-
json json_ui_settings; // Primary: new name
26-
json json_webui_settings; // Deprecated: use json_ui_settings instead (kept for backward compat)
25+
json json_ui_settings;
2726
int slot_n_ctx;
2827
enum llama_pooling_type pooling_type;
2928

tools/server/server-models.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,6 @@ void server_models_routes::init_routes() {
14741474
}},
14751475
// New key
14761476
{"ui_settings", ui_settings},
1477-
{"webui_settings", webui_settings},
14781477
{"build_info", std::string(llama_build_info())},
14791478
{"cors_proxy_enabled", params.ui_mcp_proxy},
14801479
});

tools/server/server-models.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ struct server_models {
207207
struct server_models_routes {
208208
common_params params;
209209
json ui_settings = json::object(); // Primary: new name
210-
json webui_settings = json::object(); // Deprecated: use ui_settings (kept for compat)
211210
std::atomic<bool> stopping = false; // for graceful disconnecting SSE clients during shutdown
212211
server_models models;
213212
server_models_routes(const common_params & params, int argc, char ** argv)
@@ -217,7 +216,6 @@ struct server_models_routes {
217216
try {
218217
json json_settings = json::parse(cfg);
219218
ui_settings = json_settings;
220-
webui_settings = json_settings; // Deprecated: keep in sync
221219
} catch (const std::exception & e) {
222220
LOG_ERR("%s: failed to parse UI config: %s\n", __func__, e.what());
223221
throw;

tools/server/tests/unit/test_basic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,18 @@ def test_load_split_model():
7979
assert match_regex("(little|girl)+", res.body["content"])
8080

8181

82-
def test_no_webui():
82+
def test_no_ui():
8383
global server
84-
# default: webui enabled
84+
# default: UI enabled
8585
server.start()
8686
url = f"http://{server.server_host}:{server.server_port}"
8787
res = requests.get(url)
8888
assert res.status_code == 200
8989
assert "<!doctype html>" in res.text
9090
server.stop()
9191

92-
# with --no-webui
93-
server.no_webui = True
92+
# with --no-ui, the UI should be disabled
93+
server.no_ui = True
9494
server.start()
9595
res = requests.get(url)
9696
assert res.status_code == 404

tools/server/tests/unit/test_proxy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def create_server():
1212

1313
def test_mcp_no_proxy():
1414
global server
15-
server.webui_mcp_proxy = False
15+
server.ui_mcp_proxy = False
1616
server.start()
1717

1818
res = server.make_request("GET", "/cors-proxy")
@@ -21,7 +21,7 @@ def test_mcp_no_proxy():
2121

2222
def test_mcp_proxy():
2323
global server
24-
server.webui_mcp_proxy = True
24+
server.ui_mcp_proxy = True
2525
server.start()
2626

2727
url = f"http://{server.server_host}:{server.server_port}/cors-proxy?url=http://example.com"
@@ -32,7 +32,7 @@ def test_mcp_proxy():
3232

3333
def test_mcp_proxy_custom_port():
3434
global server
35-
server.webui_mcp_proxy = True
35+
server.ui_mcp_proxy = True
3636
server.start()
3737

3838
# try getting the server's models API via the proxy

tools/server/tests/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ServerProcess:
9494
enable_ctx_shift: int | None = False
9595
spec_draft_n_min: int | None = None
9696
spec_draft_n_max: int | None = None
97-
no_webui: bool | None = None
97+
no_ui: bool | None = None
9898
jinja: bool | None = None
9999
reasoning_format: Literal['deepseek', 'none', 'nothink'] | None = None
100100
reasoning: Literal['on', 'off', 'auto'] | None = None
@@ -107,7 +107,7 @@ class ServerProcess:
107107
cache_ram: int | None = None
108108
no_cache_idle_slots: bool = False
109109
log_path: str | None = None
110-
webui_mcp_proxy: bool = False
110+
ui_mcp_proxy: bool = False
111111
backend_sampling: bool = False
112112
gcp_compat: bool = False
113113

@@ -225,8 +225,8 @@ def start(self, timeout_seconds: int = DEFAULT_HTTP_TIMEOUT) -> None:
225225
server_args.extend(["--spec-draft-n-max", self.spec_draft_n_max])
226226
if self.spec_draft_n_min:
227227
server_args.extend(["--spec-draft-n-min", self.spec_draft_n_min])
228-
if self.no_webui:
229-
server_args.append("--no-webui")
228+
if self.no_ui:
229+
server_args.append("--no-ui")
230230
if self.no_models_autoload:
231231
server_args.append("--no-models-autoload")
232232
if self.jinja:
@@ -251,8 +251,8 @@ def start(self, timeout_seconds: int = DEFAULT_HTTP_TIMEOUT) -> None:
251251
server_args.extend(["--cache-ram", self.cache_ram])
252252
if self.no_cache_idle_slots:
253253
server_args.append("--no-cache-idle-slots")
254-
if self.webui_mcp_proxy:
255-
server_args.append("--webui-mcp-proxy")
254+
if self.ui_mcp_proxy:
255+
server_args.append("--ui-mcp-proxy")
256256
if self.backend_sampling:
257257
server_args.append("--backend_sampling")
258258
if self.gcp_compat:

0 commit comments

Comments
 (0)