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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Merge branch 'main' into litellm_allow_using_azure_ad_token_auth
Ishaan Jaff228252b92d1e
diff --cc litellm/main.pyindex 45e164a8991,28054537cf4..16a4f89ed29--- a/litellm/main.py+++ b/litellm/main.py@@@ -943,7 -943,7 +943,9 @@@ def completionoutput_cost_per_token=output_cost_per_token,cooldown_time=cooldown_time,text_completion=kwargs.get("text_completion"),+ azure_ad_token_provider=kwargs.get("azure_ad_token_provider"),+ user_continue_message=kwargs.get("user_continue_message"),++)logging.update_environment_variables(model=model,@@@ -3230,10 -3247,7 +3249,11 @@@ def embedding"model_config","cooldown_time","tags",+ "azure_ad_token_provider",+ "tenant_id",+ "client_id",+ "client_secret",+ "extra_headers",]default_params = openai_params + litellm_paramsnon_default_params = {diff --cc litellm/proxy/proxy_config.yamlindex c8599d56ef8,5f4072434fd..320216a79b9--- a/litellm/proxy/proxy_config.yaml+++ b/litellm/proxy/proxy_config.yaml@@@ -1,21 -1,14 +1,17 @@@model_list:- - model_name: gpt-4+ - model_name: fake-openai-endpointlitellm_params:- model: openai/fake- api_key: fake-key- api_base: https://exampleopenaiendpoint-production.up.railway.app/+ model: azure/chatgpt-v-2+ api_base: https://openai-gpt-4-test-v-1.openai.azure.com/+ api_version: "2023-05-15"+ tenant_id: os.environ/AZURE_TENANT_ID+ client_id: os.environ/AZURE_CLIENT_ID+ client_secret: os.environ/AZURE_CLIENT_SECRETguardrails:- - guardrail_name: "lakera-pre-guard"+ - guardrail_name: "bedrock-pre-guard"litellm_params:- guardrail: lakera # supported values: "aporia", "bedrock", "lakera"- mode: "during_call"- api_key: os.environ/LAKERA_API_KEY- api_base: os.environ/LAKERA_API_BASE- category_thresholds:- prompt_injection: 0.1- jailbreak: 0.1-+ guardrail: bedrock # supported values: "aporia", "bedrock", "lakera"+ mode: "post_call"+ guardrailIdentifier: ff6ujrregl1q+ guardrailVersion: "DRAFT"diff --cc litellm/types/utils.pyindex 21eae868a00,6b278efa1b4..14d5cd1b8d5--- a/litellm/types/utils.py+++ b/litellm/types/utils.py@@@ -1116,10 -1116,7 +1116,11 @@@ all_litellm_params ="cooldown_time","cache_key","max_retries",+ "azure_ad_token_provider",+ "tenant_id",+ "client_id",+ "client_secret",+ "user_continue_message",]diff --cc litellm/utils.pyindex ea6b9952425,7596de81d21..d5aefa80ecf--- a/litellm/utils.py+++ b/litellm/utils.py@@@ -2323,7 -2323,7 +2323,8 @@@ def get_litellm_paramsoutput_cost_per_second=None,cooldown_time=None,text_completion=None,+ azure_ad_token_provider=None,+ user_continue_message=None,):litellm_params = {"acompletion": acompletion,@@@ -2348,7 -2348,7 +2349,8 @@@"output_cost_per_second": output_cost_per_second,"cooldown_time": cooldown_time,"text_completion": text_completion,+ "azure_ad_token_provider": azure_ad_token_provider,+ "user_continue_message": user_continue_message,}return litellm_params