mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-15 06:19:29 +00:00
1.2 KiB
Vendored
1.2 KiB
Vendored
In [ ]:
!pip install litellmIn [ ]:
import litellm
from litellm import embedding, completion
model_fallback_list = ["claude-instant-1", "gpt-3.5-turbo", "chatgpt-test"]
user_message = "Hello, how are you?"
messages = [{ "content": user_message,"role": "user"}]
for model in model_fallback_list:
try:
response = completion(model=model, messages=messages)
except Exception as e:
print(f"error occurred: {traceback.format_exc()}")