Skip to content

Commit

Permalink
add test_regex_pattern_matching_e2e_test
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan-jaff committed Nov 25, 2024
1 parent f76d0e4 commit a18aeaa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions proxy_server_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ model_list:
litellm_params:
model: "groq/*"
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
litellm_params:
model: mistral/mistral-embed
Expand Down
18 changes: 18 additions & 0 deletions tests/test_openai_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,24 @@ async def test_openai_wildcard_chat_completion():
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
async def test_proxy_all_models():
"""
Expand Down

0 comments on commit a18aeaa

Please sign in to comment.