mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
refactor: add black formatting
This commit is contained in:
parent
b87d630b0a
commit
4905929de3
156 changed files with 19723 additions and 10869 deletions
|
@ -11,36 +11,44 @@ import pytest
|
|||
import litellm
|
||||
from litellm import completion
|
||||
|
||||
messages=[{"role": "user", "content": "Hey, how's it going?"}]
|
||||
messages = [{"role": "user", "content": "Hey, how's it going?"}]
|
||||
|
||||
## All your mistral deployments ##
|
||||
model_list = [{
|
||||
"model_name": "mistral-7b-instruct",
|
||||
"litellm_params": { # params for litellm completion/embedding call
|
||||
"model": "replicate/mistralai/mistral-7b-instruct-v0.1:83b6a56e7c828e667f21fd596c338fd4f0039b46bcfa18d973e8e70e455fda70",
|
||||
"api_key": os.getenv("REPLICATE_API_KEY"),
|
||||
}
|
||||
}, {
|
||||
"model_name": "mistral-7b-instruct",
|
||||
"litellm_params": { # params for litellm completion/embedding call
|
||||
"model": "together_ai/mistralai/Mistral-7B-Instruct-v0.1",
|
||||
"api_key": os.getenv("TOGETHERAI_API_KEY"),
|
||||
}
|
||||
}, {
|
||||
"model_name": "mistral-7b-instruct",
|
||||
"litellm_params": {
|
||||
"model": "deepinfra/mistralai/Mistral-7B-Instruct-v0.1",
|
||||
"api_key": os.getenv("DEEPINFRA_API_KEY")
|
||||
}
|
||||
}]
|
||||
model_list = [
|
||||
{
|
||||
"model_name": "mistral-7b-instruct",
|
||||
"litellm_params": { # params for litellm completion/embedding call
|
||||
"model": "replicate/mistralai/mistral-7b-instruct-v0.1:83b6a56e7c828e667f21fd596c338fd4f0039b46bcfa18d973e8e70e455fda70",
|
||||
"api_key": os.getenv("REPLICATE_API_KEY"),
|
||||
},
|
||||
},
|
||||
{
|
||||
"model_name": "mistral-7b-instruct",
|
||||
"litellm_params": { # params for litellm completion/embedding call
|
||||
"model": "together_ai/mistralai/Mistral-7B-Instruct-v0.1",
|
||||
"api_key": os.getenv("TOGETHERAI_API_KEY"),
|
||||
},
|
||||
},
|
||||
{
|
||||
"model_name": "mistral-7b-instruct",
|
||||
"litellm_params": {
|
||||
"model": "deepinfra/mistralai/Mistral-7B-Instruct-v0.1",
|
||||
"api_key": os.getenv("DEEPINFRA_API_KEY"),
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
def test_multiple_deployments():
|
||||
try:
|
||||
## LiteLLM completion call ## returns first response
|
||||
response = completion(model="mistral-7b-instruct", messages=messages, model_list=model_list)
|
||||
try:
|
||||
## LiteLLM completion call ## returns first response
|
||||
response = completion(
|
||||
model="mistral-7b-instruct", messages=messages, model_list=model_list
|
||||
)
|
||||
print(f"response: {response}")
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
pytest.fail(f"An exception occurred: {e}")
|
||||
|
||||
test_multiple_deployments()
|
||||
|
||||
test_multiple_deployments()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue