mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
* fix(proxy): strip LiteLLM policy tracking from OpenAI batch metadata Batch create was failing with `Invalid type for 'metadata.applied_policies': expected a string, but got an array instead` whenever a policy attachment matched the request. The policy engine helpers wrote `applied_policies`, `applied_guardrails`, and `policy_sources` into `data["metadata"]` unconditionally, and `/v1/batches` forwarded that dict straight to OpenAI, which only accepts string values. - Route proxy-internal tracking into `litellm_metadata` for batch/file routes via a shared `_get_or_create_proxy_metadata_bucket` helper. - Sanitize `data["metadata"]` in `create_batch` to drop known internal keys and non-string values before building the OpenAI request. - Cover both behaviors with unit + endpoint tests. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(proxy): merge metadata buckets for batch policy response headers Ensure get_logging_caching_headers reads both metadata and litellm_metadata so policy/guardrail headers are emitted on batch routes with user metadata, and log dropped non-string OpenAI metadata at debug level. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|---|---|---|
| .. | ||
| html_forms | ||
| admin_ui_utils.py | ||
| banner.py | ||
| cache_coordinator.py | ||
| cache_pydantic_utils.py | ||
| callback_utils.py | ||
| custom_openapi_spec.py | ||
| debug_utils.py | ||
| encrypt_decrypt_utils.py | ||
| expired_ui_session_key_cleanup_manager.py | ||
| get_routes.py | ||
| http_parsing_utils.py | ||
| key_rotation_manager.py | ||
| load_config_utils.py | ||
| openai_endpoint_utils.py | ||
| openapi_schema_compat.py | ||
| path_utils.py | ||
| performance_utils.md | ||
| performance_utils.py | ||
| proxy_state.py | ||
| rbac_utils.py | ||
| realtime_utils.py | ||
| reset_budget_job.py | ||
| resource_ownership.py | ||
| static_asset_utils.py | ||
| swagger_utils.py | ||
| timezone_utils.py | ||
| user_api_key_cache.py | ||