Skip to content

Commit

Permalink
feat(BA-543): Add enable_model_folders option to webserver to contr…
Browse files Browse the repository at this point in the history
…ol Models visibility in WebUI
  • Loading branch information
agatha197 committed Feb 24, 2025
1 parent 951f7cc commit 4dbb5e8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
1 change: 1 addition & 0 deletions changes/3503.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `enable_model_folders` option to control the visibility of the Models section and MODEL type on the Data & Storage page in the Backend.AI Web UI.
2 changes: 2 additions & 0 deletions configs/webserver/sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ menu_blocklist = "pipeline"
#menu_inactivelist = "statistics"
# Enable/disable the LLM Playground tab in the service page
# enable_LLM_playground = false
# Enable/disable the Models tab and MODEL usage mode in the data & storage page
# enable_model_folders = true

[api]
domain = "default"
Expand Down
21 changes: 1 addition & 20 deletions src/ai/backend/web/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,6 @@
t.Key("edu_appname_prefix", default=""): t.String(allow_blank=True),
t.Key("enable_model_store", default=True): t.ToBool(),
t.Key("enable_extend_login_session", default=False): t.ToBool(),
t.Key("is_directory_size_visible", default=True): t.ToBool(),
t.Key("show_kernel_list", default=False): t.ToBool(),
}).allow_extra("*"),
t.Key("security", default=_default_security_config): t.Dict({
t.Key("request_policies", default=[]): t.List(t.String),
t.Key("response_policies", default=[]): t.List(t.String),
t.Key("csp", default=None): t.Null
| t.Dict({
t.Key("default-src", default=None): t.Null | t.List(t.String),
t.Key("connect-src", default=None): t.Null | t.List(t.String),
t.Key("img-src", default=None): t.Null | t.List(t.String),
t.Key("media-src", default=None): t.Null | t.List(t.String),
t.Key("font-src", default=None): t.Null | t.List(t.String),
t.Key("script-src", default=None): t.Null | t.List(t.String),
t.Key("style-src", default=None): t.Null | t.List(t.String),
t.Key("frame-src", default=None): t.Null | t.List(t.String),
t.Key("object-src", default=None): t.Null | t.List(t.String),
t.Key("frame-ancestors", default=None): t.Null | t.List(t.String),
t.Key("form-action", default=None): t.Null | t.List(t.String),
}),
}).allow_extra("*"),
t.Key("resources"): t.Dict({
t.Key("open_port_to_public", default=False): t.ToBool,
Expand Down Expand Up @@ -131,6 +111,7 @@
t.Key("menu_inactivelist", default=None): t.Null
| tx.StringList(empty_str_as_empty_list=True),
t.Key("enable_LLM_playground", default=False): t.ToBool,
t.Key("enable_model_folders", default=True): t.ToBool(),
}).allow_extra("*"),
t.Key("api"): t.Dict({
t.Key("domain"): t.String,
Expand Down
1 change: 1 addition & 0 deletions src/ai/backend/web/templates/config.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{% toml_field "defaultImportEnvironment" config["ui"]["default_import_environment"] %}
{% toml_field "siteDescription" config["ui"]["brand"] %}
{% toml_field "enableLLMPlayground" config["ui"]["enable_LLM_playground"] %}
{% toml_field "enableModelFolders" config["ui"]["enable_model_folders"] %}
connectionMode = "SESSION"
{% toml_field "signupSupport" config["service"]["enable_signup"] %}
{% toml_field "allowChangeSigninMode" config["service"]["allow_change_signin_mode"] %}
Expand Down
1 change: 1 addition & 0 deletions src/ai/backend/web/templates/config_ini.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% toml_field "defaultSessionEnvironment" config["ui"]["default_environment"] %}
{% toml_field "siteDescription" config["ui"]["brand"] %}
{% toml_field "enableLLMPlayground" config["ui"]["enable_LLM_playground"] %}
{% toml_field "enableModelFolders" config["ui"]["enable_model_folders"] %}
connectionMode = "SESSION"

[environments]
Expand Down

0 comments on commit 4dbb5e8

Please sign in to comment.