Commit Graph

117 Commits

Author SHA1 Message Date
yuneng-jiang
a93c069dd5 [Fix] Add max_depth guard to BFL _read_image_bytes recursive function
Use the standard depth/max_depth pattern with DEFAULT_MAX_RECURSE_DEPTH
to guard the recursive list-unwrapping in _read_image_bytes, matching
the existing pattern used by _read_all_bytes in vertex_imagen.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 13:22:56 -07:00
Ihsan Soydemir
b1a6ba7711
feat(search): add Serper (serper.dev) as search provider (#23112)
* Add Serper (serper.dev) as a new search provider

* Add @greptileai fixes
2026-03-09 08:40:37 -07:00
Sameer Kankute
b5183e9f3b
Merge pull request #22752 from BerriAI/litellm_search_api_add
[Feat] Add Google Search API Integration
2026-03-04 18:29:10 +05:30
Sameer Kankute
0275e23601 Add routing for google search 2026-03-04 13:54:43 +05:30
Chesars
dc9f5a5cc4 fix(deps): update python-multipart to >=0.0.20 in CI and test configs 2026-03-03 15:10:39 -03:00
Chesars
dad7805b42 fix(deps): update python-multipart version to 0.0.22 in all files
Align requirements.txt, CI workflow, liccheck, and license cache
with the >=0.0.22 constraint already set in pyproject.toml.
2026-03-03 15:09:33 -03:00
yuneng-jiang
71c3503e57
Revert "[Feature] Add /public/supported_endpoints endpoint" 2026-02-26 17:21:43 -08:00
yuneng-jiang
efcc856234 Move provider_endpoints_support.json into litellm package
The file was at the repo root and excluded from pip distributions. Moving it to litellm/proxy/public_endpoints/ alongside the other provider JSON files ensures it is packaged correctly. Updates all references in the endpoint handler, coverage tests, and release notes instructions.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-02-26 15:15:16 -08:00
Sameer Kankute
2d231c2f1a Fix code qa 2026-02-26 12:08:40 +05:30
Ishaan Jaff
0a0768b3df
fix(ci): resolve mypy and check_code_and_doc_quality CI failures (#21812)
- fix(mypy): suppress [misc] type error in common_utils.py for cls.__init__ access
- fix(mypy): move type: ignore comment to correct line in test_eval.py (line 232 not 231)
- fix(mypy): suppress [misc] and pre-existing pyright errors in vertex_ai_non_gemini.py
- fix(check_licenses): strip inline comments before parsing requirements.txt lines so CVE comments don't break packaging.requirements.Requirement()
- fix(router_coverage): add _merge_tools_from_deployment and _invalidate_access_groups_cache to ignored list (private helpers tested indirectly)
2026-02-21 13:08:47 -08:00
Sameer Kankute
5f70165a98 Fix get_unique_names_from_llms_dir 2026-02-18 18:32:25 +05:30
Ishaan Jaffer
add3183308 IGNORE_FUNCTIONS 2026-02-14 12:59:15 -08:00
Ishaan Jaffer
ad72d162cd avector_store_create 2026-02-14 12:16:33 -08:00
yuneng-jiang
8d10311b4b content filter test fix 2026-02-12 17:54:16 -08:00
Alexsander Hamir
ebce0e5f8c
[Release - 02/10/2026] v1.81.10-nightly 2026-02-10 16:26:30 -08:00
Krish Dholakia
10d891a365
Guardrails - add logging to all unified_guardrails + link to custom code guardrail templates (#20900)
* feat(guardrail_hooks/): add guardrail logging to all unified guardrails

ensures unified guardrails use the 'log_guardrail_information' decorator for logging

* fix(custom_guardrail.py): don't log inputs on guardrail response - just emit state

* refactor: don't double log bedrock guardrail information

* feat: add in-product nudges for contributing + trying community custom code guardrails

allows users to contribute / share custom code guardrails
2026-02-10 15:13:54 -08:00
Krish Dholakia
7056d9984e
Custom Code Guardrails UI Playground (#20377)
* feat(guardrails/): allow custom code execution for guardrails

first step in allowing teams to submit custom code for guardrails

* feat: custom_code_guardrail.md

support passing custom code for guardrails

* feat: initial commit adding ui for custom code guardrails

allows users to write guardrails based on custom code

* feat: expose new test custom code guardrail endpoint

allows ui testing playground to sanity check if guardrail is working as expected

* fix: fix linting errors

* fix: fix max recursion check

* fix: fix linting error
2026-02-03 19:57:24 -08:00
Ishaan Jaff
9ed11c5cdf
[Feat] Allow calling A2A agents through LiteLLM /chat/completions API (#20358)
* init A2AConfig

* add transform files

* feat: A2A

* feat A2AConfig

* fix get_secret_str

* init: A2AConfig

* init A2AConfig common utils

* A2AConfig

* test_a2a_completion_async_non_streaming

* fix

* Update litellm/main.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* add multi part conversation support

* extract_text_from_a2a_message

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-03 12:52:33 -08:00
shin-bot-litellm
5bd5df3ca6
fix(test): add router.acancel_batch coverage (#20183)
- Add test_router_acancel_batch.py with mock test for router.acancel_batch()
- Add _acancel_batch to ignored list (internal helper tested via public API)

Fixes CI failure in check_code_and_doc_quality job
2026-01-31 12:39:19 -08:00
Alexsander Hamir
69bd4426e8
[Release Day] - Fixed CI/CD issues & changed processes (#19902) 2026-01-28 17:57:24 -08:00
Ishaan Jaffer
5135efb60e fix pypdf: >=6.6.2 2026-01-28 14:54:58 -08:00
Alexsander Hamir
4a6dcf3012
Add test for Router.get_valid_args, fix router code coverage encoding (#19797)
- Add test_get_valid_args in test_router_helper_utils.py to cover get_valid_args
- Use encoding='utf-8' in router_code_coverage.py for cross-platform file reads
2026-01-26 10:14:58 -08:00
Ishaan Jaff
c23e4b87dc
[Feat] New LiteLLM Policy engine - create policies to manage guardrails, conditions - permissions per Key, Team (#19612)
* init PolicyMatcher

* TestPolicyMatcherGetMatchingPolicies

* TestPolicyMatcherGetMatchingPolicies

* feat: init PolicyResolver

* init resolver types

* init policy from config

* inint PolicyValidator

* validate policy

* init Architecture Diagram

* test_add_guardrails_from_policy_engine

* init _init_policy_engine

* test updates

* test fixws

* new attachment config

* simplify types

* TestPolicyResolverInheritance

* fix policy resolver

* fix policies

* fix applied policy

* docs fix

* docs fix

* fix linting + QA checks

* fix linting + QA fixes

* test fixes
2026-01-22 19:49:53 -08:00
Sampson
09941dd1d1
add search provider for brave search api (#19433)
* add search provider for brave search api

Introduces a minimal implementation of the Brave Search API as a search provider. Additionally, this PR introduces a test file to ensure the provider works properly, and numerous other smaller changes (e.g., changes to docs to mention the new option).

* Update transformation.py
2026-01-20 19:23:29 -08:00
Sameer Kankute
896d1a7dad Fix Error: Found packages that need verification: 2026-01-19 18:18:24 +05:30
YutaSaito
7aba0f738a
Revert "Litellm staging 01 15 2026" 2026-01-17 06:31:34 +09:00
Sameer Kankute
84974d5745 Fix boto3 conflicting dependency 2026-01-16 16:55:12 +05:30
Sameer Kankute
f3ca05112e
Merge pull request #19206 from BerriAI/main
merge main
2026-01-16 15:22:16 +05:30
Yuta Saito
9e1235c0aa chore: add jaraco liccheck 2026-01-16 14:55:14 +09:00
burnerburnerburnerman
5676c6c135
Chore: bump boto3 version (#19090) 2026-01-16 02:39:30 +05:30
Alexsander Hamir
15c3bc219b
[Refactor] Add CI enforcement for O(1) operations in _get_model_cost_key to prevent performance regressions (#19052)
* Optimize _get_model_cost_key to avoid expensive scans

- Remove expensive O(n) scan fallback that was causing 42.87% CPU overhead
- Only scan when size mismatch detected (O(1) check)
- Add warning in docstring: Only O(1) lookup operations are acceptable
- Clean up comments to be more concise
- Keep stale entry rebuild for pop() case (only triggers when stale entry found)

This fixes the performance issue where the scan was being triggered on every
failed lookup, causing severe CPU overhead during router operations.

* Add code quality check to enforce O(1) operations in _get_model_cost_key

- Add check_get_model_cost_key_performance.py to statically analyze _get_model_cost_key
- Detects O(n) operations (loops, comprehensions, problematic function calls)
- Recursively checks called functions to find nested O(n) operations
- Allows conditional O(n) rebuilds in helper functions (_rebuild_model_cost_lowercase_map, _handle_stale_map_entry_rebuild, _handle_new_key_with_scan)

* Integrate _get_model_cost_key performance check into CI pipeline

- Add check_get_model_cost_key_performance.py to check_code_and_doc_quality job
- Ensures O(1) requirement is enforced in CI to prevent performance regressions

* Remove unused performance test and clean up utils.py

- Remove test_get_model_info_performance.py (no longer needed)
- Remove extra blank line in utils.py

* Document allowed helper functions and exception process in _get_model_cost_key

- Add documentation listing allowed helper functions with O(n) operations
- Explain why these are acceptable (conditionally called)
- Add instructions for adding new exceptions to check_get_model_cost_key_performance.py

* Fix docstring detection and type checker error in performance check

- Add proper docstring tracking to skip docstring content (fixes false positive for 'map' in docstring)
- Add None check for docstring_quote to fix type checker error
- Restore _handle_new_key_with_scan to allowed_helpers list

* Remove check_get_model_cost_key_performance from CI pipeline

- Temporarily remove the performance check from CI to avoid blocking builds

* Restore performance check and remove memory leak tests from CI

- Add back check_get_model_cost_key_performance.py to CI pipeline
- Remove memory_leak_tests job that was causing port conflicts

* Remove extra blank line in CI config
2026-01-13 17:08:03 -08:00
Ishaan Jaffer
e3fe02148d _mask_sequence 2026-01-10 13:20:43 -08:00
Krish Dholakia
80ead21c3a
Litellm improve endpoint discovery (#18762)
* docs: document all endpoints in .json and add consistency checks against docs + providers.json

* docs: add more tests + improve coverage
2026-01-07 17:35:01 +05:30
Ishaan Jaffer
a5332a6d51 fix code qa check 2026-01-07 14:54:00 +05:30
Ishaan Jaff
b5d74722ba
Revert "Litellm fixes a2a sdk (#18748)" (#18752)
This reverts commit 1661707492.
2026-01-07 14:04:10 +05:30
Ishaan Jaff
1661707492
Litellm fixes a2a sdk (#18748)
* add a2a SDK to req

* fix
2026-01-07 13:31:45 +05:30
Alexsander Hamir
e2f3eaefab
Add UnboundedDataStructurePattern to memory test detector (#18590) 2026-01-02 11:49:32 -08:00
Alexsander Hamir
b732710ed0
Add memory pattern detection test and fix bad memory patterns (#18589) 2026-01-02 10:52:25 -08:00
Alexsander Hamir
a7da4833da
[Fix] CI/CD - check_code_and_doc_quality (#18560) 2026-01-01 11:18:59 -08:00
Alexsander Hamir
852bf63698
[Fix] CI/CD - check_code_and_doc_quality (#18309) 2025-12-20 17:34:08 -08:00
Ishaan Jaffer
b0db9d6bb7 code qa check 2025-12-19 19:00:44 +05:30
Alexsander Hamir
28821427ce
[Fix] CI/CD #1 - mypy | check_code_and_doc_quality | guardrails_testing (#18195) 2025-12-18 06:31:01 -08:00
Alexsander Hamir
892d7e8d70
[Fix] CI/CD - Fix Bedrock tool calling test failures with non-serializable objects and internal parameters (#17930)
* fix(bedrock): filter non-serializable objects from request params

- Enhanced filter_exceptions_from_params() to filter callable objects (functions) and Logging objects
- Applied filtering in Bedrock's _prepare_request_params() before deepcopy
- Applied filtering to additional_request_params before JSON serialization
- Prevents TypeError during deepcopy (APIConnectionError objects) and JSON serialization (functions, Logging objects)
- Fixes test_bedrock_tool_calling test failures

Root cause: MCP-related functions (handle_chat_completion_with_mcp, completion_callable) and litellm_logging_obj were incorrectly added to optional_params via add_provider_specific_params_to_optional_params(), which then ended up in additional_request_params. These objects should be in litellm_params, not optional_params.

* fix(bedrock): filter internal MCP parameters from API requests

Filter out LiteLLM internal/MCP-related parameters (skip_mcp_handler,
mcp_handler_context, _skip_mcp_handler) from additional_request_params
before sending to Bedrock API to prevent 'extraneous key' errors.

- Added filter_internal_params() helper function in core_helpers.py
- Applied filtering in Bedrock's _prepare_request_params() method
- Fixes test_bedrock_completion.py::test_bedrock_tool_calling

* fix: mypy type error

* fix: add filter_exceptions_from_params to recursive function ignore list

- Add filter_exceptions_from_params to IGNORE_FUNCTIONS in recursive_detector.py
- Function is safe: has max_depth parameter (default 20) to prevent infinite recursion
2025-12-13 12:38:07 -08:00
Sameer Kankute
b39c21d90c fix: Add _delete_nested_value_custom to recursive function ignore list
The _delete_nested_value_custom function is recursive but has bounded depth
(limited by the number of path segments), preventing infinite recursion.
This is necessary for nested field removal in additional_drop_params.
2025-12-09 17:56:13 +05:30
Ishaan Jaff
38ddd50628
[Bug fix] Vector Store List Endpoint Returns 404 (#17229)
* fix vector store management

* fix: add vector_store_management_router

* TestVectorStoreManagementEndpointsExist

* fix pass_through
2025-11-27 12:51:51 -08:00
Ishaan Jaff
5c192a23c3
[Feat] Add new RAG API on LiteLLM AI Gateway (#17109)
* init RAG api types

* add RAG endpoints

* init main.py for RAG ingest API

* init RecursiveCharacterTextSplitter

* add BaseRAGIngestion

* fix OpenAIRAGIngestion

* fix img handler

* init OpenAIRAGIngestion

* init BedrockRAGIngestion

* init BedrockRAGIngestion

* init rag tests

* init BedrockVectorStoreOptions

* implement BedrockRAGIngestion

* add BaseRAGAPI

* add endpoint for RAG ingest

* add ingest RAG endpoints

* add test doc

* add parse_rag_ingest_request

* update endpoints

* docs add docs for new RAG API

* fix qa check

* fix linting

* docs ficx

* docs

* add max depth checks

* docs anthropic
2025-11-25 17:54:29 -08:00
Ishaan Jaffer
badbadba0d fix img URL for tests 2025-11-22 09:41:15 -08:00
yuneng-jiang
4b25398afe
[Infra] CI/CD Fixes (#16937)
* Attempt CI/CD Fix

* Adding test for coverage

* Adding max depth to copilot and vertex

* Fixing mypy lint and docker database

* Fixing UI build issues

* Update playwright test
2025-11-21 13:58:19 -08:00
Ishaan Jaffer
8e73e11fc8 SEARCH_PROVIDERS 2025-11-06 17:07:53 -08:00
Ishaan Jaffer
d32890ba55 fix _redact_base64 2025-10-28 17:38:16 -07:00