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 batch list showing stale "validating" status after completion
Ryan Crabbe3d55f7f6abf6
diff --git a/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py b/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.pyindex 4dcabb9c58b..d4ab1d881d9 100644--- a/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py+++ b/enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py@@ -239,8 +239,11 @@ class CheckBatchCost:# mark the job as completecompleted_jobs.append(job)- if len(completed_jobs) > 0:- await self.prisma_client.db.litellm_managedobjecttable.update_many(- where={"id": {"in": [job.id for job in completed_jobs]}},- data={"batch_processed": True, "status": "complete"},+ await self.prisma_client.db.litellm_managedobjecttable.update(+ where={"id": job.id},+ data={+ "batch_processed": True,+ "status": "complete",+ "file_object": response.model_dump_json(),+ },)diff --git a/tests/test_litellm/enterprise/proxy/test_managed_files_access_check.py b/tests/test_litellm/enterprise/proxy/test_managed_files_access_check.pyindex 2db5a2214cb..7b7643aeec5 100644--- a/tests/test_litellm/enterprise/proxy/test_managed_files_access_check.py+++ b/tests/test_litellm/enterprise/proxy/test_managed_files_access_check.py@@ -134,7 +134,7 @@ async def test_check_batch_cost_should_call_afile_content_directly_with_credentimock_prisma.db.litellm_managedobjecttable.find_many = AsyncMock(return_value=[mock_job])- mock_prisma.db.litellm_managedobjecttable.update_many = AsyncMock()+ mock_prisma.db.litellm_managedobjecttable.update = AsyncMock()# Mock proxy_logging_obj — should NOT be called for file contentmock_proxy_logging = MagicMock()