From e39ff46222186298cdda86f20dc3ee67e4c9fc08 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 26 Jul 2024 08:59:53 -0700 Subject: [PATCH] docs(config.md): update wildcard docs --- docs/my-website/docs/proxy/configs.md | 2 +- litellm/proxy/_new_secret_config.yaml | 4 ++-- litellm/router.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/my-website/docs/proxy/configs.md b/docs/my-website/docs/proxy/configs.md index cb0841c60c..424ef8615b 100644 --- a/docs/my-website/docs/proxy/configs.md +++ b/docs/my-website/docs/proxy/configs.md @@ -295,7 +295,7 @@ Dynamically call any model from any given provider without the need to predefine model_list: - model_name: "*" # all requests where model not in your config go to this deployment litellm_params: - model: "openai/*" # passes our validation check that a real provider is given + model: "*" # passes our validation check that a real provider is given ``` 2. Start LiteLLM proxy diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yaml index f4a89cc3ab..deec60b43d 100644 --- a/litellm/proxy/_new_secret_config.yaml +++ b/litellm/proxy/_new_secret_config.yaml @@ -1,4 +1,4 @@ model_list: - - model_name: "gpt-3.5-turbo" + - model_name: "*" litellm_params: - model: "openai/gpt-3.5-turbo" + model: "*" diff --git a/litellm/router.py b/litellm/router.py index d1198aa154..eff5f94db8 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -2937,8 +2937,8 @@ class Router: model_group = kwargs["litellm_params"]["metadata"].get( "model_group", None ) - - id = kwargs["litellm_params"].get("model_info", {}).get("id", None) + model_info = kwargs["litellm_params"].get("model_info", {}) or {} + id = model_info.get("id", None) if model_group is None or id is None: return elif isinstance(id, int):