fix use tags as a litellm param

This commit is contained in:
Ishaan Jaff 2024-07-18 19:34:45 -07:00
parent b6e60d481e
commit 071091fd8c
2 changed files with 7 additions and 4 deletions

View file

@ -735,6 +735,7 @@ def completion(
] ]
litellm_params = [ litellm_params = [
"metadata", "metadata",
"tags",
"acompletion", "acompletion",
"atext_completion", "atext_completion",
"text_completion", "text_completion",
@ -3150,6 +3151,7 @@ def embedding(
"allowed_model_region", "allowed_model_region",
"model_config", "model_config",
"cooldown_time", "cooldown_time",
"tags",
] ]
default_params = openai_params + litellm_params default_params = openai_params + litellm_params
non_default_params = { non_default_params = {
@ -4379,6 +4381,8 @@ def transcription(
proxy_server_request = kwargs.get("proxy_server_request", None) proxy_server_request = kwargs.get("proxy_server_request", None)
model_info = kwargs.get("model_info", None) model_info = kwargs.get("model_info", None)
metadata = kwargs.get("metadata", {}) metadata = kwargs.get("metadata", {})
tags = kwargs.pop("tags", [])
drop_params = kwargs.get("drop_params", None) drop_params = kwargs.get("drop_params", None)
client: Optional[ client: Optional[
Union[ Union[
@ -4551,6 +4555,7 @@ def speech(
) -> HttpxBinaryResponseContent: ) -> HttpxBinaryResponseContent:
model, custom_llm_provider, dynamic_api_key, api_base = get_llm_provider(model=model, custom_llm_provider=custom_llm_provider, api_base=api_base) # type: ignore model, custom_llm_provider, dynamic_api_key, api_base = get_llm_provider(model=model, custom_llm_provider=custom_llm_provider, api_base=api_base) # type: ignore
tags = kwargs.pop("tags", [])
optional_params = {} optional_params = {}
if response_format is not None: if response_format is not None:

View file

@ -4,14 +4,12 @@ model_list:
model: openai/fake model: openai/fake
api_key: fake-key api_key: fake-key
api_base: https://exampleopenaiendpoint-production.up.railway.app/ api_base: https://exampleopenaiendpoint-production.up.railway.app/
model_info: tags: ["free"]
tier: free # 👈 Key Change - set `tier`
- model_name: gpt-4 - model_name: gpt-4
litellm_params: litellm_params:
model: openai/gpt-4o model: openai/gpt-4o
api_key: os.environ/OPENAI_API_KEY api_key: os.environ/OPENAI_API_KEY
model_info: tags: ["paid"]
tier: paid # 👈 Key Change - set `tier`
general_settings: general_settings:
master_key: sk-1234 master_key: sk-1234