litellm/litellm
Marcos Griselli 6b1ce4e766
fix(rag): use router for completion in RAG query pipeline (#19550)
The RAG query endpoint was failing with "Object of type Router is not
JSON serializable" when called through the proxy. This was caused by two
issues:

1. The Router object passed via kwargs was leaking into the request
   payload sent to providers like Bedrock, causing JSON serialization
   errors.

2. The RAG query pipeline was calling litellm.acompletion() directly
   instead of using the router, so virtual model names configured in the
   proxy weren't being resolved to actual provider model IDs.

This fix:
- Extracts the router from kwargs and uses router.acompletion() when
  available, falling back to litellm.acompletion() otherwise
- Adds "Router" to the list of non-serializable types in
  filter_exceptions_from_params as a defensive measure

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 20:11:17 -08:00
..
a2a_protocol a2a agent Header-Based Context Propagation (#19504) 2026-01-23 19:56:04 -08:00
anthropic_interface [bug fix] do not fallback to token counter if disable_token_counter is enabled (#19041) 2026-01-13 16:53:38 -08:00
assistants
batch_completion
batches Fix: generation config empty for batch 2026-01-22 14:32:44 +05:30
caching Add support for caching for responses API 2026-01-14 13:33:07 +05:30
completion_extras Add ChatGPT subscription support and responses bridge (#19030) 2026-01-19 05:37:45 -08:00
containers Make keepalive_timeout parameter work for Gunicorn (#19087) 2026-01-16 03:32:59 +05:30
endpoints/speech/speech_to_completion_bridge
experimental_mcp_client chore: switch experimental client to streamable_http_client API 2026-01-20 07:37:50 +09:00
files [Feat] Manus FILES API - Add File upload, get, delete, list (#18904) 2026-01-10 13:27:54 -08:00
fine_tuning
google_genai Add custom vertex ai mapping to the output 2026-01-22 15:18:24 +05:30
images Add None as default image value 2026-01-19 09:08:38 +05:30
integrations Add GCS mock mode for testing without API calls (#19683) 2026-01-23 16:25:32 -08:00
interactions [Feat] Interactions API - allow using all litellm providers (interactions -> responses api bridge) (#18373) 2025-12-23 22:30:22 +05:30
litellm_core_utils fix(rag): use router for completion in RAG query pipeline (#19550) 2026-01-23 20:11:17 -08:00
llms Merge pull request #19548 from BerriAI/litellm_staging_01_22_2026 2026-01-23 20:03:11 +05:30
ocr
passthrough [Fix] VertexAI Pass through - Ensure only anthropic betas are forwarded down to LLM API (#19542) 2026-01-21 19:12:04 -08:00
proxy a2a agent Header-Based Context Propagation (#19504) 2026-01-23 19:56:04 -08:00
rag fix(rag): use router for completion in RAG query pipeline (#19550) 2026-01-23 20:11:17 -08:00
realtime_api Fix: handling of model name in query param 2026-01-15 15:06:37 +05:30
rerank_api
responses Merge pull request #19649 from BerriAI/litellm_fix_responses_api_logging_eror 2026-01-23 19:51:45 +05:30
router_strategy feat(tag-routing): support toggling tag matching between ANY and ALL (#18776) 2026-01-08 23:39:03 +05:30
router_utils Fix extract_cacheable_prefix to handle string content with message-level cache_control (fixes #19228) 2026-01-17 10:35:40 +05:30
search
secret_managers ci cd fixes - linting security 2026-01-23 10:37:16 -08:00
skills [Feat] Unified Skills API - works across Anthropic, Vertex, Azure, Bedrock (#18232) 2025-12-19 18:55:59 +05:30
types [Feat] Guardrail Policy Management - Allow using UI to manage guardrail policies (#19668) 2026-01-23 12:44:22 -08:00
vector_store_files
vector_stores
videos
__init__.py [Feat] New LiteLLM Policy engine - create policies to manage guardrails, conditions - permissions per Key, Team (#19612) 2026-01-22 19:49:53 -08:00
_lazy_imports_registry.py Merge branch 'main' into litellm_staging_01_19_2026 2026-01-20 19:19:36 +05:30
_lazy_imports.py refactor: migrate utils.py lazy imports to registry pattern (#18657) 2026-01-05 09:55:48 -08:00
_logging.py fix(logging): Include langfuse logger in JSON logging when langfuse callback is used (#19162) 2026-01-17 00:59:38 +05:30
_redis.py
_service_logger.py fix(langfuse_otel): ignore service logs and fix callback shadowing (#19298) 2026-01-19 05:53:47 -08:00
_uuid.py
_version.py
budget_manager.py
constants.py Adding EOS to finish reasons 2026-01-22 15:16:44 -08:00
cost_calculator.py Fix Azure AI costs for Anthropic models (#19530) 2026-01-21 21:10:27 -08:00
cost.json
exceptions.py Fix unsafe access to request attribute (#19573) 2026-01-22 10:58:29 -08:00
main.py Merge pull request #19562 from BerriAI/litellm_stop_setting 2026-01-22 19:44:56 +05:30
model_prices_and_context_window_backup.json [Fix] Anthropic models on Azure AI cache pricing (#19532) (#19614) 2026-01-22 20:00:40 -08:00
mypy.ini
py.typed
router.py Add support for sarvam models 2026-01-21 15:17:26 +05:30
scheduler.py Fix queue persistence to Redis (#19304) 2026-01-19 19:01:34 -08:00
timeout.py
utils.py Merge pull request #19638 from BerriAI/main 2026-01-23 14:54:17 +05:30