The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(proxy): re-encode response IDs in cancel_batch for model-based routing
Chesars7506fd0426a7
diff --git a/litellm/proxy/batches_endpoints/endpoints.py b/litellm/proxy/batches_endpoints/endpoints.pyindex d3e983c5ad5..7ab50e321ac 100644--- a/litellm/proxy/batches_endpoints/endpoints.py+++ b/litellm/proxy/batches_endpoints/endpoints.py@@ -855,7 +855,28 @@ async def cancel_batch(custom_llm_provider=credentials["custom_llm_provider"],**data # type: ignore)-++ # Re-encode response IDs so the client always sees encoded IDs.+ if response and hasattr(response, "id") and response.id:+ response.id = encode_file_id_with_model(+ file_id=response.id, model=model_from_id, id_type="batch",+ )++ if hasattr(response, "output_file_id") and response.output_file_id:+ response.output_file_id = encode_file_id_with_model(+ file_id=response.output_file_id, model=model_from_id+ )++ if hasattr(response, "error_file_id") and response.error_file_id:+ response.error_file_id = encode_file_id_with_model(+ file_id=response.error_file_id, model=model_from_id+ )++ if hasattr(response, "input_file_id") and response.input_file_id:+ response.input_file_id = encode_file_id_with_model(+ file_id=response.input_file_id, model=model_from_id+ )+verbose_proxy_logger.debug(f"Cancelled batch using model: {model_from_id}, original_id: {original_batch_id}")