Merge branch 'main' into litellm_track_imagen_spend_logs

This commit is contained in:
Ishaan Jaff 2024-09-02 21:21:15 -07:00 committed by GitHub
commit c1adb0b7f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 1384 additions and 226 deletions

View file

@ -75,3 +75,28 @@ def test_get_llm_provider_vertex_ai_image_models():
model="imagegeneration@006", custom_llm_provider=None
)
assert custom_llm_provider == "vertex_ai"
def test_get_llm_provider_ai21_chat():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
model="jamba-1.5-large",
)
assert custom_llm_provider == "ai21_chat"
assert model == "jamba-1.5-large"
assert api_base == "https://api.ai21.com/studio/v1"
def test_get_llm_provider_ai21_chat_test2():
"""
if user prefix with ai21/ but calls jamba-1.5-large then it should be ai21_chat provider
"""
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
model="ai21/jamba-1.5-large",
)
print("model=", model)
print("custom_llm_provider=", custom_llm_provider)
print("api_base=", api_base)
assert custom_llm_provider == "ai21_chat"
assert model == "jamba-1.5-large"
assert api_base == "https://api.ai21.com/studio/v1"