mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
update env with hosted keys
This commit is contained in:
parent
c8130f9fe0
commit
601bc7ecbd
2 changed files with 8 additions and 2 deletions
|
@ -1022,7 +1022,13 @@ def get_model_list():
|
|||
print(f"last_fetched_at: {last_fetched_at}")
|
||||
response = requests.get(url="http://api.litellm.ai/get_model_list", headers={"content-type": "application/json"}, data=json.dumps({"user_email": user_email}))
|
||||
print_verbose(f"get_model_list response: {response.text}")
|
||||
model_list = response.json()["model_list"]
|
||||
data = response.json()
|
||||
# update model list
|
||||
model_list = data["model_list"]
|
||||
# set environment variables
|
||||
env_dict = data["model_keys"]
|
||||
for key, value in env_dict.items():
|
||||
os.environ[key] = value
|
||||
litellm.model_list = model_list # update the user's current litellm model list
|
||||
# return litellm model list by default
|
||||
return litellm.model_list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue