forked from phoenix/litellm-mirror
refactor: move all testing to top-level of repo
Closes https://github.com/BerriAI/litellm/issues/486
This commit is contained in:
parent
5403c5828c
commit
3560f0ef2c
213 changed files with 74 additions and 217 deletions
56
tests/local_testing/test_router_with_fallbacks.py
Normal file
56
tests/local_testing/test_router_with_fallbacks.py
Normal file
|
@ -0,0 +1,56 @@
|
|||
# [LOCAL TEST] - runs against mock openai proxy
|
||||
# # What this tests?
|
||||
# ## This tests if fallbacks works for 429 errors
|
||||
|
||||
# import sys, os, time
|
||||
# import traceback, asyncio
|
||||
# import pytest
|
||||
|
||||
# sys.path.insert(
|
||||
# 0, os.path.abspath("../..")
|
||||
# ) # Adds the parent directory to the system path
|
||||
# import litellm
|
||||
# from litellm import Router
|
||||
|
||||
# model_list = [
|
||||
# { # list of model deployments
|
||||
# "model_name": "text-embedding-ada-002", # model alias
|
||||
# "litellm_params": { # params for litellm completion/embedding call
|
||||
# "model": "text-embedding-ada-002", # actual model name
|
||||
# "api_key": "sk-fakekey",
|
||||
# "api_base": "http://0.0.0.0:8080",
|
||||
# },
|
||||
# "tpm": 1000,
|
||||
# "rpm": 6,
|
||||
# },
|
||||
# {
|
||||
# "model_name": "text-embedding-ada-002-fallback",
|
||||
# "litellm_params": { # params for litellm completion/embedding call
|
||||
# "model": "openai/text-embedding-ada-002-anything-else", # actual model name
|
||||
# "api_key": "sk-fakekey2",
|
||||
# "api_base": "http://0.0.0.0:8080",
|
||||
# },
|
||||
# "tpm": 1000,
|
||||
# "rpm": 6,
|
||||
# },
|
||||
# ]
|
||||
|
||||
# router = Router(
|
||||
# model_list=model_list,
|
||||
# fallbacks=[
|
||||
# {"text-embedding-ada-002": ["text-embedding-ada-002-fallback"]},
|
||||
# {"text-embedding-ada-002-fallback": ["text-embedding-ada-002"]},
|
||||
# ],
|
||||
# set_verbose=True,
|
||||
# num_retries=0,
|
||||
# debug_level="INFO",
|
||||
# routing_strategy="usage-based-routing",
|
||||
# )
|
||||
|
||||
|
||||
# def test_embedding_with_fallbacks():
|
||||
# response = router.embedding(model="text-embedding-ada-002", input=["Hello world"])
|
||||
# print(f"response: {response}")
|
||||
|
||||
|
||||
# test_embedding_with_fallbacks()
|
Loading…
Add table
Add a link
Reference in a new issue