Skip to content

Commit 17cdc7b

Browse files
committed
Added option to disable local LLMs for web deployment
1 parent c3337fc commit 17cdc7b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tabs/sidebar.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,18 @@ def sidebar():
5858
google_api_key = ""
5959
mistral_api_key = ""
6060

61-
# Add model selection input field to the sidebar
62-
model_provider = st.selectbox(
63-
"Select your preferred model provider:",
64-
[
61+
model_options =[
6562
"OpenAI API",
6663
"Google AI API",
6764
"Mistral API",
68-
"Local LM Studio",
69-
],
65+
]
66+
if "disable_local_lm_studio" not in st.secrets:
67+
model_options.append("Local LM Studio")
68+
69+
# Add model selection input field to the sidebar
70+
model_provider = st.selectbox(
71+
"Select your preferred model provider:",
72+
model_options,
7073
key="model_provider",
7174
help="Select the model provider you would like to use. This will determine the models available for selection.",
7275
)
@@ -92,14 +95,11 @@ def sidebar():
9295

9396
# LLM configuration section, for each available LLM provider you can choose the model and insert the API key
9497
st.header("""Configure here the API keys and models you would like to use for the privacy threat modelling:""")
98+
99+
95100
llm_to_configure = st.selectbox(
96101
"Select LLM to configure:",
97-
[
98-
"OpenAI API",
99-
"Google AI API",
100-
"Mistral API",
101-
"Local LM Studio",
102-
],
102+
model_options,
103103
help="Select the model provider you would like to insert the keys for. This will determine the models available for selection.",
104104
)
105105

0 commit comments

Comments
 (0)