litellm/docs/my-website/docs
Ishaan Jaff b87d1f8dad
[Feat] - Ishaan main merge branch (#23596)
* fix(bedrock): respect s3_region_name for batch file uploads (#23569)

* fix(bedrock): respect s3_region_name for batch file uploads (GovCloud fix)

* fix: s3_region_name always wins over aws_region_name for S3 signing (Greptile feedback)

* fix: _filter_headers_for_aws_signature - Bedrock KB (#23571)

* fix: _filter_headers_for_aws_signature

* fix: filter None header values in all post-signing re-merge paths

Addresses Greptile feedback: None-valued headers were being filtered
during SigV4 signing but re-merged back into the final headers dict
afterward, which would cause downstream HTTP client failures.

Made-with: Cursor

* feat(router): tag_regex routing — route by User-Agent regex without per-developer tag config (#23594)

* feat(router): add tag_regex support for header-based routing

Adds a new `tag_regex` field to litellm_params that lets operators route
requests based on regex patterns matched against request headers — primarily
User-Agent — without requiring per-developer tag configuration.

Use case: route all Claude Code traffic (User-Agent: claude-code/x.y.z) to
a dedicated deployment by setting:

  tag_regex:
    - "^User-Agent: claude-code\\/"

in the deployment's litellm_params. Works alongside existing `tags` routing;
exact tag match takes precedence over regex match. Unmatched requests fall
through to deployments tagged `default`.

The matched deployment, pattern, and user_agent are recorded in
`metadata["tag_routing"]` so they flow through to SpendLogs automatically.

* fix(tag_regex): address backwards-compat, metadata overwrite, and warning noise

Three issues from code review:

1. Backwards-compat: `has_tag_filter` was widened to activate on any non-empty
   User-Agent, which would raise ValueError for existing deployments using plain
   tags without a `default` fallback. Fix: only activate header-based regex
   filtering when at least one candidate deployment has `tag_regex` configured.

2. Metadata overwrite: `metadata["tag_routing"]` was overwritten for every
   matching deployment in the loop, leaving inaccurate provenance when multiple
   deployments match. Fix: write only for the first match.

3. Warning noise: an invalid regex pattern logged one warning per header string
   rather than once per pattern. Fix: compile first (catching re.error once),
   then iterate over header strings.

Also adds two new tests covering these cases, and adds docs page for
tag_regex routing with a Claude Code walk-through.

* refactor(tag_regex): remove unnecessary _healthy_list copy

* docs: merge tag_regex section into tag_routing.md, remove standalone page

- Add ## Regex-based tag routing (tag_regex) section to existing
  tag_routing.md instead of a separate page
- Remove tag_regex_routing.md standalone doc (odd UX to have a separate
  page for a sub-feature)
- Remove proxy/tag_regex_routing from sidebars.js
- Add match_any=False debug warning in tag_based_routing.py when regex
  routing fires under strict mode (regex always uses OR semantics)

* fix(tag_regex): address greptile review - security docs, strict-mode enforcement, validation order

- Strengthen security note in tag_routing.md: explicitly state User-Agent
  is client-supplied and can be set to any value; frame tag_regex as a
  traffic classification hint, not an access-control mechanism
- Move tag_regex startup validation before _add_deployment() so an invalid
  pattern never leaves partial router state
- Enforce match_any=False strict-tag policy: when a deployment has both
  tags and tag_regex and the strict tag check fails, skip the regex fallback
  rather than silently bypassing the operator's intent
- Extract per-deployment match logic into _match_deployment() helper to
  keep get_deployments_for_tag() readable
- Add two new tests: strict-mode blocks regex fallback, regex-only
  deployment still matches under match_any=False

* fix(ci): apply Black formatting to 14 files and stabilize flaky caplog tests

- Run Black formatter on 14 files that were failing the lint check
- Replace caplog-based assertions in TestAliasConflicts with
  unittest.mock.patch on verbose_logger.warning for xdist compatibility
- The caplog fixture can produce empty text in pytest-xdist workers
  in certain CI environments, causing flaky test failures

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-03-14 09:40:00 -07:00
..
adding_provider feat(guardrails): team-based guardrail registration and approval workflow (#22459) 2026-03-02 22:06:49 -08:00
anthropic_unified docs(anthropic): add v1/messages → /responses parameter mapping reference 2026-03-05 15:51:19 +05:30
caching fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
completion merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
contribute_integration
contributing merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
debugging
embedding merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
extras fix: prompt registry 2026-02-18 00:34:54 +05:30
guides fix: prompt registry 2026-02-18 00:34:54 +05:30
integrations fix: prompt registry 2026-02-18 00:34:54 +05:30
langchain
observability fix: req changes 2026-02-25 22:27:51 +05:30
pass_through Development environment setup (#22432) 2026-02-28 14:50:06 -08:00
projects fix: prompt registry 2026-02-18 00:34:54 +05:30
provider_registration merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
providers fix(openai): drop all reasoning_effort for gpt-5.4 + tools, including 'none' 2026-03-12 16:22:40 -03:00
proxy [Feat] - Ishaan main merge branch (#23596) 2026-03-14 09:40:00 -07:00
search feat(search): add Serper (serper.dev) as search provider (#23112) 2026-03-09 08:40:37 -07:00
secret_managers fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
troubleshoot docs: pip venv upgrade workflow (#23290) 2026-03-10 13:53:54 -07:00
tutorials Add Retool Assist tutorial with LiteLLM Proxy to docs (#21952) 2026-03-11 13:17:08 -07:00
vector_stores
a2a_agent_headers.md docs(agents): add A2A agent authentication headers guide 2026-03-05 15:11:18 +05:30
a2a_agent_permissions.md
a2a_cost_tracking.md fix: prompt registry 2026-02-18 00:34:54 +05:30
a2a_invoking_agents.md fix: prompt registry 2026-02-18 00:34:54 +05:30
a2a_iteration_budgets.md Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849) 2026-03-07 19:12:42 -08:00
a2a.md Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849) 2026-03-07 19:12:42 -08:00
aiohttp_benchmarks.md
anthropic_count_tokens.md merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
apply_guardrail.md merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
assistants.md
audio_transcription.md merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
batches.md fix: prompt registry 2026-02-18 00:34:54 +05:30
bedrock_converse.md
bedrock_invoke.md
benchmarks.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
budget_manager.md
contact.md
container_files.md fix: prompt registry 2026-02-18 00:34:54 +05:30
containers.md
contributing.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
count_tokens.md merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
data_retention.md fix: prompt registry 2026-02-18 00:34:54 +05:30
data_security.md
default_code_snippet.md
enterprise.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
evals_api.md fix: prompt registry 2026-02-18 00:34:54 +05:30
exception_mapping.md
files_endpoints.md feat(anthropic): add Files API support for SDK 2026-03-11 12:45:19 -03:00
fine_tuning.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
generateContent.md fix: Metadata / Trace ID Missing in S3 Streaming Callbacks 2026-02-25 14:16:42 +05:30
image_edits.md merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
image_generation.md merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
image_variations.md
index.md fix: prompt registry 2026-02-18 00:34:54 +05:30
interactions.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
load_test_advanced.md fix: prompt registry 2026-02-18 00:34:54 +05:30
load_test_rpm.md
load_test_sdk.md
load_test.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_aws_sigv4.md merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
mcp_control.md [Chore] update mcp documentation for header forwarding 2026-03-04 13:07:25 +05:30
mcp_cost.md
mcp_guardrail.md merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
mcp_oauth.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_openapi.md feat(mcp): allow admins to override tool name and description per MCP server (#22828) 2026-03-04 17:58:05 -08:00
mcp_public_internet.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_semantic_filter.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_troubleshoot.md fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_usage.md
mcp.md merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
migration_policy.md
migration.md
moderation.md
ocr.md Enable local file support for OCR (#22133) 2026-02-27 10:50:02 -08:00
oidc.md fix: prompt registry 2026-02-18 00:34:54 +05:30
old_guardrails.md
projects.md
proxy_api.md
proxy_auth.md fix: prompt registry 2026-02-18 00:34:54 +05:30
proxy_server.md
rag_ingest.md fix: prompt registry 2026-02-18 00:34:54 +05:30
rag_query.md fix: prompt registry 2026-02-18 00:34:54 +05:30
realtime.md feat(realtime): guardrails support for /v1/realtime WebSocket endpoint (#22152) 2026-02-25 21:34:22 -08:00
reasoning_content.md fix(openai): drop all reasoning_effort for gpt-5.4 + tools, including 'none' 2026-03-12 16:22:40 -03:00
rerank.md feat: Add IBM watsonx.ai rerank support (#21303) 2026-02-16 20:12:16 -08:00
response_api_compact.md fix: prompt registry 2026-02-18 00:34:54 +05:30
response_api.md Add documentation related to responses websocket 2026-03-04 18:26:43 +05:30
router_architecture.md
routing.md fix: prompt registry 2026-02-18 00:34:54 +05:30
rules.md
scheduler.md
sdk_custom_pricing.md
secret.md fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
set_keys.md
skills.md
text_completion.md
text_to_speech.md fix: prompt registry 2026-02-18 00:34:54 +05:30
traffic_mirroring.md fix: prompt registry 2026-02-18 00:34:54 +05:30
troubleshoot.md fix: prompt registry 2026-02-18 00:34:54 +05:30
vector_store_files.md
vertex_batch_passthrough.md
videos.md
wildcard_routing.md