Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Merge branch 'litellm_internal_staging' into feature/improve-gigachat-provider

KnyazSh6eb8eb901fb7
diff --cc litellm/litellm_core_utils/get_llm_provider_logic.py
index dd817f309da,182c5117a3e..b3a48769d6a
--- a/litellm/litellm_core_utils/get_llm_provider_logic.py
+++ b/litellm/litellm_core_utils/get_llm_provider_logic.py
@@@ -527,15 -527,13 +530,15 @@@ def get_llm_provider( # noqa: PLR091
custom_llm_provider = "amazon_nova"
elif model.startswith("sap/"):
custom_llm_provider = "sap"
+ elif model in litellm.gigachat_models or model.startswith("gigachat/"):
+ custom_llm_provider = "gigachat"
if not custom_llm_provider:
if litellm.suppress_debug_info is False:
- print() # noqa
- print( # noqa
- "\033[1;31mProvider List: https://docs.litellm.ai/docs/providers\033[0m" # noqa
- ) # noqa
- print() # noqa
+ print() # noqa: T201
+ print( # noqa: T201
+ "\033[1;31mProvider List: https://docs.litellm.ai/docs/providers\033[0m"
+ )
+ print() # noqa: T201
error_str = f"LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model={model}\n Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers"
# maps to openai.NotFoundError, this is raised when openai does not recognize the llm
raise litellm.exceptions.BadRequestError( # type: ignore
diff --cc litellm/litellm_core_utils/litellm_logging.py
index 1447b078387,3c525f743ed..8af3bfa9c0a
--- a/litellm/litellm_core_utils/litellm_logging.py
+++ b/litellm/litellm_core_utils/litellm_logging.py
@@@ -5866,14 -5893,7 +5898,14 @@@ def get_standard_logging_object_payload
def emit_standard_logging_payload(payload: StandardLoggingPayload):
if os.getenv("LITELLM_PRINT_STANDARD_LOGGING_PAYLOAD"):
- print(json.dumps(payload, indent=4)) # noqa: T201
+ try:
- print(json.dumps(payload, indent=4, default=str)) # noqa
++ print(json.dumps(payload, indent=4, default=str)) # noqa: T201
+ except Exception as e:
+ verbose_logger.exception(
+ "Error serializing standard logging payload for debug output: {}".format(
+ str(e)
+ )
+ )
def get_standard_logging_metadata(