Skip to content

Commit aa0e206

Browse files
committed
chore: remove api_key from config.toml
1 parent 09f483b commit aa0e206

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ simple_model = "gpt-4o-mini"
1414
complex_model = "gpt-4o-2024-08-06"
1515
embeddings_model = "text-embedding-ada-002"
1616
base_url = "https://api.openai.com/v1/" # for openai compatible apis
17-
api_key = "" # for openai compatible apis, overrides the environment variable OPENAI_API_KEY
1817

1918
[ollama]
2019
simple_model = "llama3.2"

src/rai/rai/utils/configurator.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,25 +157,20 @@ def on_openai_compatible_api_change():
157157
st.session_state.use_openai_compatible_api = use_openai_compatible_api
158158

159159
if use_openai_compatible_api:
160-
st.info("Used for OpenAI compatible endpoints, e.g. Ollama, vLLM...")
161-
openai_api_key = st.text_input(
162-
"OpenAI API key for compatible APIs",
163-
value=st.session_state["config"]["openai"]["api_key"],
164-
key="openai_api_key",
160+
st.info(
161+
"Used for OpenAI compatible endpoints, e.g. Ollama, vLLM... Make sure to specify `OPENAI_API_KEY` environment variable based on vendor's specification."
165162
)
166163
openai_api_base_url = st.text_input(
167164
"OpenAI API base URL",
168165
value=st.session_state["config"]["openai"]["base_url"],
169166
key="openai_api_base_url",
170167
)
171168
else:
172-
openai_api_key = st.session_state["config"]["openai"]["api_key"]
173169
openai_api_base_url = st.session_state["config"]["openai"]["base_url"]
174170
st.session_state.config["openai"] = {
175171
"simple_model": simple_model,
176172
"complex_model": complex_model,
177173
"embeddings_model": embeddings_model,
178-
"api_key": openai_api_key,
179174
"base_url": openai_api_base_url,
180175
}
181176

0 commit comments

Comments
 (0)