Commit Graph

28 Commits

Author SHA1 Message Date
yuneng-jiang 4fc0975d22 Fix flaky e2e batch test: set batch_processed=True on completion in retrieve_batch
The retrieve_batch endpoint sets batch status to "complete" but never set
batch_processed=True, permanently blocking file deletion. CheckBatchCost
(the safety net) also excluded completed batches from its primary query,
so batch_processed was never set by either path.

Three fixes:
1. update_batch_in_database sets batch_processed=True when status reaches
   "complete", with old-schema fallback retry
2. CheckBatchCost primary query no longer excludes complete/completed
   (batch_processed=False filter prevents reprocessing)
3. retrieve_batch early-return now includes "complete" (DB-normalized
   spelling) to avoid unnecessary provider re-polls

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 18:18:32 -07:00
Sameer Kankute 82f5055d89 test(responses): add end-to-end test for responses API WebSocket mode
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 17:24:39 +05:30
Sameer Kankute 410e54648c Fix: Managed Batches: Inconsistent State Management for list and cancel batches 2026-02-03 14:47:28 +05:30
Ishaan Jaffer 96a0f960a9 test_e2e_batches_files 2025-11-27 09:14:43 -08:00
Ishaan Jaff 31ecd4ce49 Revert "Respect custom llm provider in header" (#17211) 2025-11-27 09:12:44 -08:00
Sameer Kankute d4bc1cf23d Respect custom llm provider in header 2025-11-27 16:38:37 +05:30
Sameer Kankute 82dc0354ce Litellm sameer nov 3 stable branch (#16963)
* Add openai metadata filed in the request

* Add docs related to openai metadata

* Add utils

* test_completion_openai_metadata[True]

* Added support for though signature for gemini 3 in responses api (#16872)

* Added support for though signature for gemini 3

* Update docs with all supported endpoints and cost tracking

* Added config based routing support for batches and files

* fix lint errors

* Litellm anthropic image url support (#16868)

* Add image as url support to anthropic

* fix mypy errors

* fix tests

* Fix: Populate spend_logs_metadata in batch and files endpoints (#16921)

* Add spend-logs-metadata to the metadata

* Add tests for spend logs metadata in batches

* use better names

* Remove support for penalty param for gemini 3 (#16907)

* Remove support for penalty param

* remove halucinated model names

* fix mypy/test errors

* fix tests

* fix too many lines error

* fix too many lines error

* Add config for cicd test case

* Fix final tests

* fix batch tests

* fix batch tests
2025-11-22 09:35:05 -08:00
Ishaan Jaffer 94c2c28f3d claude-sonnet-4-5-20250929 fix 2025-10-31 18:20:52 -07:00
Ishaan Jaff aea78b8d1a [Feat] Add support for Batch API Rate limiting - PR1 adds support for input based rate limits (#16075)
* add count_input_file_usage

* add count_input_file_usage

* fix count_input_file_usage

* _get_batch_job_input_file_usage

* fixes imports

* use _get_batch_job_input_file_usage

* test_batch_rate_limits

* add _check_and_increment_batch_counters

* add get_rate_limiter_for_call_type

* test_batch_rate_limit_multiple_requests

* fixes for batch limits

* fix linting

* fix MYPY linting
2025-10-29 18:28:52 -07:00
Timothée Lecomte 3ef9b2015a feat: read from custom-llm-provider header (#15528) 2025-10-18 22:04:53 -07:00
Ishaan Jaffer 68105ce1a7 fix type 2025-09-16 15:41:52 -07:00
Ishaan Jaff 8e22cf5d65 [Fix] /responses API - add cancel endpoint + allow non-admins to use this as an llm api endpoint (#14594)
* fix: ensure /responses/cancel works for non admins

* test: cancel endpoint

* fix responses API  cancel endpoint

* test fix

* TestGoogleAIStudioResponsesAPITest
2025-09-15 18:49:54 -07:00
Sameer Kankute 110ce543c2 [Feat]Add cancel endpoint support for openai and azure (#14561)
* Add cancel endpoint support for openai
 and azure

* fix lint error

* fix cancel url contruction azure

* readd changes
2025-09-15 07:08:56 -07:00
Ishaan Jaff 93af8fd6ba [QA] E2E - Testing for bedrock batches api (#14525)
* add bedrock/batch-anthropic.claude-3-5-sonnet-20240620-v1:0

* test_bedrock_batches_api

* fix

* fix import

* test_bedrock_batches_api
2025-09-12 19:31:19 -07:00
Ishaan Jaff 04dc1a5351 [Feat] Add support for returning images with gemini/gemini-2.5-flash-image-preview with /chat/completions (#13983)
* add gemini-2.5-flash-image-preview

* add gemini-2.5-flash-image-preview

* add image in ChatCompletionResponseMessage

* test_gemini_image_generation_async

* Revert "Merge pull request #13394 from Deviad/feature/enhance_logging_for_containers"

This reverts commit 539b94ad4e, reversing
changes made to 71af7bcf9c.

* include `image` in Delta

* fix _process_candidates should show the image response

* fix: _handle_special_delta_attributes

* test_gemini_image_generation_async_stream

* image_generation_chat

* UI - allow looking at generated images from /chat/completions

* _create_streaming_choice

* fix import StreamingChoices

* fix ChatCompletionResponseMessage

* test_gemini_image_generation

* add gemini img migration

* fix _extract_candidate_metadata

* ui fix

* fix batch endpoint test
2025-08-27 16:16:19 -07:00
Krish Dholakia 22d28f5853 Batches - support batch retrieve with target model Query Param + Anthropic - completion bridge, yield content_block_stop chunk (#12228)
* fix(batches_endpoints/endpoints.py): support passing target model names for batch list as a query param

Fixes issue where cloud run fails calls because GET can't contain request body

* test(test_openai_batches_endpoints.py): add unit test

* docs(managed_batches.md): update docs

* feat(spend_tracking_utils.py): support STORE_PROMPTS_IN_SPEND_LOGS env var

ensures prompt is stored in spend logs

* fix(streaming_iterator.py): fix anthropic - completion streaming iterator to yield content block stop

ensures claude code renders messages

* test: skip local test
2025-07-01 22:13:48 -07:00
Ishaan Jaff 4e7115bc34 Bug Fix - responses api fix got multiple values for keyword argument 'litellm_trace_id' (#12225)
* fix - handling trace id arg on responses api

* test_async_response_api_handler_merges_trace_id_without_error

* test_anthropic_with_responses_api
2025-07-01 18:12:22 -07:00
Ishaan Jaff 2e3a0222e6 Revert "test_anthropic_with_responses_api"
This reverts commit 2f0bdf887e80f85669fb0bae9fcede16863d658e.
2025-07-01 17:43:21 -07:00
Ishaan Jaff 648e8d6533 test_anthropic_with_responses_api 2025-07-01 17:43:21 -07:00
Ishaan Jaff e3094c2249 set flaky tests as flaky 2025-06-14 13:51:52 -07:00
Ishaan Jaff 2e9fb2f6ba # expect an error when getting the response again since 2025-04-25 09:42:35 -07:00
Ishaan Jaff cb87dbbd51 fix responses test 2025-04-24 21:23:25 -07:00
Ishaan Jaff 5de101ab7b [Feat] Add GET, DELETE Responses endpoints on LiteLLM Proxy (#10297)
* add GET responses endpoints on router

* add GET responses endpoints on router

* add GET responses endpoints on router

* add DELETE responses endpoints on proxy

* fixes for testing GET, DELETE endpoints

* test_basic_responses api e2e
2025-04-24 17:34:26 -07:00
Ishaan Jaff d41856ce3d test_bad_request_bad_param_error 2025-03-13 16:02:21 -07:00
Ishaan Jaff 3b632ac825 test_async_bad_request_bad_param_error 2025-03-13 15:57:19 -07:00
Ishaan Jaff 63783383e7 add basic validation tests for e2e responses create endpoint 2025-03-13 15:25:50 -07:00
Ishaan Jaff e9f3d97eb0 working e2e tests for responses api 2025-03-13 15:17:47 -07:00
Ishaan Jaff 08f4a6844b rename folder to test openai endpoints 2025-03-13 15:13:48 -07:00