forked from phoenix/litellm-mirror
add test_regex_pattern_matching_e2e_test
This commit is contained in:
parent
f76d0e41ef
commit
a18aeaa2fb
2 changed files with 23 additions and 0 deletions
|
@ -96,6 +96,11 @@ model_list:
|
||||||
litellm_params:
|
litellm_params:
|
||||||
model: "groq/*"
|
model: "groq/*"
|
||||||
api_key: os.environ/GROQ_API_KEY
|
api_key: os.environ/GROQ_API_KEY
|
||||||
|
- model_name: "custom-llm-engine/*"
|
||||||
|
litellm_params:
|
||||||
|
model: "openai/my-fake-model"
|
||||||
|
api_base: https://exampleopenaiendpoint-production.up.railway.app/
|
||||||
|
api_key: fake-key
|
||||||
- model_name: mistral-embed
|
- model_name: mistral-embed
|
||||||
litellm_params:
|
litellm_params:
|
||||||
model: mistral/mistral-embed
|
model: mistral/mistral-embed
|
||||||
|
|
|
@ -473,6 +473,24 @@ async def test_openai_wildcard_chat_completion():
|
||||||
await chat_completion(session=session, key=key, model="gpt-3.5-turbo-0125")
|
await chat_completion(session=session, key=key, model="gpt-3.5-turbo-0125")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_regex_pattern_matching_e2e_test():
|
||||||
|
"""
|
||||||
|
- Create key for model = "custom-llm-engine/*" -> this has access to all models matching pattern = "custom-llm-engine/*"
|
||||||
|
- proxy_server_config.yaml has model = "custom-llm-engine/*"
|
||||||
|
- Make chat completion call
|
||||||
|
|
||||||
|
"""
|
||||||
|
async with aiohttp.ClientSession() as session:
|
||||||
|
key_gen = await generate_key(session=session, models=["custom-llm-engine/*"])
|
||||||
|
key = key_gen["key"]
|
||||||
|
|
||||||
|
# call chat/completions with a model that the key was not created for + the model is not on the config.yaml
|
||||||
|
await chat_completion(
|
||||||
|
session=session, key=key, model="custom-llm-engine/very-new-model"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_proxy_all_models():
|
async def test_proxy_all_models():
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue