mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
fixed litellm params
This commit is contained in:
parent
362081c2b9
commit
20c3a0ffe4
1 changed files with 51 additions and 3 deletions
|
|
@ -565,6 +565,10 @@ async def acompletion(
|
|||
model=model,
|
||||
custom_llm_provider=custom_llm_provider,
|
||||
api_base=completion_kwargs.get("base_url", None),
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model,
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
)
|
||||
|
||||
fallbacks = fallbacks or litellm.model_fallbacks
|
||||
|
|
@ -1291,6 +1295,10 @@ def completion( # type: ignore # noqa: PLR0915
|
|||
custom_llm_provider=custom_llm_provider,
|
||||
api_base=api_base,
|
||||
api_key=api_key,
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model,
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
)
|
||||
|
||||
if not _should_allow_input_examples(
|
||||
|
|
@ -4368,6 +4376,10 @@ async def aembedding(*args, **kwargs) -> EmbeddingResponse:
|
|||
model=model,
|
||||
custom_llm_provider=custom_llm_provider,
|
||||
api_base=kwargs.get("api_base", None),
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model,
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
)
|
||||
|
||||
# Await normally
|
||||
|
|
@ -4553,6 +4565,10 @@ def embedding( # noqa: PLR0915
|
|||
custom_llm_provider=custom_llm_provider,
|
||||
api_base=api_base,
|
||||
api_key=api_key,
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model,
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
)
|
||||
|
||||
if dynamic_api_key is not None:
|
||||
|
|
@ -5688,6 +5704,10 @@ def text_completion( # noqa: PLR0915
|
|||
model=model, # type: ignore
|
||||
custom_llm_provider=custom_llm_provider,
|
||||
api_base=api_base,
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model, # type: ignore
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
)
|
||||
|
||||
if custom_llm_provider == "huggingface":
|
||||
|
|
@ -5978,6 +5998,10 @@ async def amoderation(
|
|||
custom_llm_provider=custom_llm_provider,
|
||||
api_base=optional_params.api_base,
|
||||
api_key=optional_params.api_key,
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model or "",
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
)
|
||||
except litellm.BadRequestError:
|
||||
# `model` is optional field for moderation - get_llm_provider will throw BadRequestError if model is not set / not recognized
|
||||
|
|
@ -6043,7 +6067,12 @@ async def atranscription(*args, **kwargs) -> TranscriptionResponse:
|
|||
func_with_context = partial(ctx.run, func)
|
||||
|
||||
_, custom_llm_provider, _, _ = get_llm_provider(
|
||||
model=model, api_base=kwargs.get("api_base", None)
|
||||
model=model,
|
||||
api_base=kwargs.get("api_base", None),
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model,
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
)
|
||||
|
||||
# Await normally
|
||||
|
|
@ -6147,6 +6176,10 @@ def transcription(
|
|||
custom_llm_provider=custom_llm_provider,
|
||||
api_base=api_base,
|
||||
api_key=api_key,
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model,
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
) # type: ignore
|
||||
|
||||
if dynamic_api_key is not None:
|
||||
|
|
@ -6322,7 +6355,12 @@ async def aspeech(*args, **kwargs) -> HttpxBinaryResponseContent:
|
|||
func_with_context = partial(ctx.run, func)
|
||||
|
||||
_, custom_llm_provider, _, _ = get_llm_provider(
|
||||
model=model, api_base=kwargs.get("api_base", None)
|
||||
model=model,
|
||||
api_base=kwargs.get("api_base", None),
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model,
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
)
|
||||
|
||||
# Await normally
|
||||
|
|
@ -6373,7 +6411,13 @@ def speech( # noqa: PLR0915
|
|||
model_info = kwargs.get("model_info", None)
|
||||
shared_session = kwargs.get("shared_session", None)
|
||||
model, custom_llm_provider, dynamic_api_key, api_base = get_llm_provider(
|
||||
model=model, custom_llm_provider=custom_llm_provider, api_base=api_base
|
||||
model=model,
|
||||
custom_llm_provider=custom_llm_provider,
|
||||
api_base=api_base,
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model,
|
||||
use_litellm_proxy=kwargs.get("use_litellm_proxy", False),
|
||||
),
|
||||
) # type: ignore
|
||||
kwargs.pop("tags", [])
|
||||
|
||||
|
|
@ -6883,6 +6927,10 @@ async def ahealth_check(
|
|||
custom_llm_provider=custom_llm_provider_from_params,
|
||||
api_base=api_base_from_params,
|
||||
api_key=api_key_from_params,
|
||||
litellm_params=litellm.types.router.LiteLLM_Params(
|
||||
model=model,
|
||||
use_litellm_proxy=model_params.get("use_litellm_proxy", False),
|
||||
),
|
||||
)
|
||||
if model in litellm.model_cost and mode is None:
|
||||
mode = litellm.model_cost[model].get("mode")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue