mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
update env with hosted keys
This commit is contained in:
parent
c4a4db2b34
commit
2382735f49
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}")
|
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}))
|
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}")
|
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
|
litellm.model_list = model_list # update the user's current litellm model list
|
||||||
# return litellm model list by default
|
# return litellm model list by default
|
||||||
return litellm.model_list
|
return litellm.model_list
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "litellm"
|
name = "litellm"
|
||||||
version = "0.1.450"
|
version = "0.1.451"
|
||||||
description = "Library to easily interface with LLM API providers"
|
description = "Library to easily interface with LLM API providers"
|
||||||
authors = ["BerriAI"]
|
authors = ["BerriAI"]
|
||||||
license = "MIT License"
|
license = "MIT License"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue