* Litellm dev 03 05 2025 contributor prs (#9079)
* feat: add support for copilot provider
* test: add tests for github copilot
* chore: clean up github copilot authenticator
* test: add test for github copilot authenticator
* test: add test for github copilot for sonnet 3.7 thought model
* Fix#7629 - Add tzdata package to Dockerfile (#8915)
* Add tzdata package to Dockerfile
* Move tzdata to python requirement.txt
* feat: add support for copilot provider (#8577)
* feat: add support for copilot provider
* test: add tests for github copilot
* chore: clean up github copilot authenticator
* test: add test for github copilot authenticator
* test: add test for github copilot for sonnet 3.7 thought model
---------
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
* feat: add model information for copilot models
* fix: fix linting errors
* test: remove integration test for github_copilot + fix misisng mock
* fix: use print to make sure the logger message shown
* test: remove debug print
* fix lint (#11112)
* Add init files to make test directories Python packages and update import paths in test_token_counter.py (#11119)
* Update litellm/model_prices_and_context_window_backup.json
Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com>
---------
Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com>
Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com>
Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com>
Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
* refactor github copilot
* test_github_copilot_transformation.py
* test_github_copilot_authenticator.py
* add GitHub Copilot
* fix order
* doc fix
---------
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: Son H. Nguyen <nhs.000.dev@gmail.com>
Co-authored-by: subnet.dev <50828879+subnet-dev@users.noreply.github.com>
Co-authored-by: Son H. Nguyen <33925625+nhs000@users.noreply.github.com>
Co-authored-by: மனோஜ்குமார் பழனிச்சாமி <smartmanoj42857@gmail.com>
- Added 'size' to supported parameters for vertex_ai in get_optional_params_image_gen
- Implemented mapping from OpenAI size format (e.g., '1024x1024') to Vertex AI aspectRatio format (e.g., '1:1')
- Supports common aspect ratios: 1:1 (square), 16:9 (landscape), 9:16 (portrait)
- Added comprehensive test coverage for the size parameter mapping
Fixes LIT-279: Vertex AI Image Generation Aspect Ratio Support
The test_list_callbacks_mixed_callback_types test was failing when run in parallel with other tests due to the proxy server's internal _PROXY_VirtualKeyModelMaxBudgetLimiter callback persisting across test runs. This fix filters out proxy internal callbacks from the test assertions to ensure consistent test behavior regardless of test execution order or parallelization.
* feat(azure/prompt_shield.py): initial commit adding prompt shield guardrail + auto discovery mechanism for guardrails
reduces amount of code needed outside of guardrail integration for instrumentation
* feat(azure/prompt_shield.py): working azure prompt shield guardrail integration
Addresses https://github.com/BerriAI/litellm/issues/12254
* test: unit tests for prompt_shield
* fix(prompt_shield.py): add event hook validation for prompt shield guardrail
ensures prompt shield guardrail raises error if asked to run post_call (only runs on user prompt)
* feat(azure/): working text_moderation integration
* fix(text_moderation.py): suppress linting error
* test(test_azure_text_moderation.py): add unit test
* test(test_azure_text_moderation.py): add unit test for responses
* fix(text_moderation.py): return streaming error correctly
ensures error returned to user
* fix: fix linting error
* fix: fix linting check
* test: change mistral model
service tier exceeded
* fix(exception_mapping_utils.py): cover mistral in exception mapping
* Enhance Mistral API: Add support for parallel tool calls and refine name handling in tool messages. Plus, introduce a new test for parallel tool calls in the Mistral model.
* tests
* make mypy happy
* Refine name handling in Mistral chat transformation: clarify conditions for removing the 'name' field based on message role and content.
* refactor: streamline Mistral integration by removing deprecated references and adding a new handler
- Removed "mistral" from the list of compatible providers in constants.
- Updated the completion function in main.py to utilize the new Mistral handler.
- Deleted outdated Mistral chat and embedding files.
- Introduced a new handler for Mistral chat completions, implementing the llm_http_handler pattern.
- Added integration tests for the Mistral handler to ensure proper API base and key handling.
* lint
* fix: remove unneeded handler object
* add tests
* Addres PR comments
* fix(main.py): handle router custom azure model name for responses api bridge
* fix(responses/handler): ensure azure model name is stripped before sending to provider
Fixes model name error
* fix(google_genai/main.py): handle stream=true being set in kwargs
* docs: cleanup icons from sidebar
* fix(test-litellm.yml): add google-genai to test litellmyml
* fix(main.py): strip 'responses/' from bridge
* fix(main.py): fix linting errors
* fix(types/openai.py): allow item to be none
handle azure streaming response
* fix(base.py): allow extra fields + handle azure item = none value in response output item added event
* fix(main.py): correctly handle removing responses/
* test(test_main.py): add unit tests
When JSON_LOGS=True is set, error logs were not being formatted as JSON despite
the configuration. This was because the logging initialization code configured
individual loggers but failed to properly initialize all loggers with the JSON
formatter.
This fix ensures that when json_logs is enabled, the _initialize_loggers_with_handler()
function is called to:
- Configure all loggers (root, LiteLLM, Router, Proxy) with JSON formatter
- Disable logger propagation to prevent duplicate entries
- Set up exception handlers for JSON formatting
Fixes LIT-267
* Enhance Mistral API: Add support for parallel tool calls and refine name handling in tool messages. Plus, introduce a new test for parallel tool calls in the Mistral model.
* tests
* make mypy happy
* Refine name handling in Mistral chat transformation: clarify conditions for removing the 'name' field based on message role and content.
* handle mistral returning '' instead of None
* fix - tuple was never falsy so never triggered the exception
* test - add test suite for openmeter integration
* refactor - move tests for openmeter integration
* Move PANW Prisma AIRS test per feedback on PR #12116
- Move test to tests/test_litellm/proxy/guardrails/guardrail_hooks/
* Remove test file from old location