Commit Graph

24391 Commits

Author SHA1 Message Date
WilsonSunBritten
4ea92d96cb lint fix 2025-08-28 17:11:50 -06:00
WilsonSunBritten
0721345703 Switch to string constant based truncation 2025-08-28 16:28:36 -06:00
WilsonSunBritten
026480358b Revert "Allow configuration to on what threshold to try truncating request content in db"
This reverts commit 771052d67d.
2025-08-28 16:12:42 -06:00
Wilson Britten
771052d67d Allow configuration to on what threshold to try truncating request content in db 2025-08-28 09:48:50 -06:00
Krish Dholakia
e638c5490d
Merge pull request #13945 from NoWall57/feature/force-anthropic-custom-api-base
feat: Add support for custom Anthropic-compatible API endpoints
2025-08-27 22:28:55 -07:00
Krish Dholakia
74c9663189
Merge pull request #12797 from ericgtkb/fix-vertex-ai-anyof
Fix additional anyOf corner cases for Vertex AI Gemini tool calls - issue #11164
2025-08-27 22:26:13 -07:00
Krish Dholakia
68f4847659
Merge pull request #12865 from aholmberg/holmberg/default-reasoning
fix: make gemini and openai responses return reasoning by default
2025-08-27 22:25:30 -07:00
Krish Dholakia
fc738c5822
Merge branch 'main' into holmberg/default-reasoning 2025-08-27 22:25:22 -07:00
Krish Dholakia
df39320889
Merge pull request #12885 from xywei/main
Remove vector store methods from global scope
2025-08-27 22:22:59 -07:00
Krish Dholakia
67d432a6d7
Merge pull request #13243 from nagyv-team/main
Ensure that `function_call_prompt` extends system messages following its current schema
2025-08-27 22:16:53 -07:00
Krish Dholakia
10816a44d4
Merge pull request #13160 from pangeacyber/aidr-update
Update Pangea Guardrail to support new AIDR endpoint
2025-08-27 22:15:32 -07:00
Krish Dholakia
cf491a7931
Merge pull request #13562 from qidu/main
refactor(router): choose weights by 'weight', 'rpm', 'tpm' in one loop for simple_shuffle
2025-08-27 22:13:42 -07:00
Krish Dholakia
c692f19346
Merge branch 'main' into main 2025-08-27 22:13:29 -07:00
Krish Dholakia
12bef8fbf4
Merge pull request #13691 from timelfrink/feat/github-copilot-thinking-reasoning-support
feat: Add thinking and reasoning_effort parameter support for GitHub Copilot provider
2025-08-27 22:09:22 -07:00
Krish Dholakia
a913ecf60b
Merge branch 'main' into feat/github-copilot-thinking-reasoning-support 2025-08-27 22:09:15 -07:00
Krish Dholakia
f01c7d13e7
Merge pull request #13991 from ikaadil/fix/gemini-imagen-model-name-validation
[Bug Fix] Resolve invalid model name error for Gemini Imagen models
2025-08-27 21:56:19 -07:00
Krish Dholakia
f764e415be
Merge pull request #14012 from KRRT7/in-memory-cache-optimization
️ Speed up InMemoryCache.evict_cache by 21%
2025-08-27 21:55:34 -07:00
Ishaan Jaff
d5774d89cc
Update Docker image tag to v1.75.8-stable (#14014)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ishaan <ishaan@berri.ai>
2025-08-27 16:44:50 -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
Xingyao Wang
9acf80b8ad
Fix issue #13995: Handle None metadata in batch requests (#13996)
* Fix issue #13995: Handle None metadata in batch requests

- Added null check in add_key_level_controls method to prevent NoneType error
- Updated type hint to Optional[dict] for better type safety
- Added comprehensive test suite to verify the fix works correctly
- All existing tests pass, confirming no regression

Fixes #13995

Co-authored-by: openhands <openhands@all-hands.dev>

* Move test file to tests/test_litellm/proxy/ directory

- Moved test_batch_metadata_none_fix.py from tests/ to tests/test_litellm/proxy/
- Updated import structure to match existing test patterns
- This ensures the test runs in GitHub Actions as requested by @krrishdholakia

Co-authored-by: openhands <openhands@all-hands.dev>

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2025-08-27 14:51:09 -07:00
Ishaan Jaff
165242e31f
[Feat] langfuse_otel logger - allow using LANGFUSE_OTEL_HOST for configuring host (#14013)
* feat - add _get_langfuse_otel_host

* test_get_langfuse_otel_config_with_otel_host_priority

* docs: LANGFUSE_OTEL_HOST
2025-08-27 14:43:47 -07:00
Ifta Khairul Alam Adil
75aeca14b2 Merge branch 'main' into fix/gemini-imagen-model-name-validation 2025-08-27 21:52:47 +02:00
Sam Xie
ee13c65701
[Bug]: /responses endpoint proxy ignores extra_headers in GitHub Copilot (#13775)
* fix: pass extra_headers parameter through responses API transformation chain

Ensure extra_headers parameter is properly forwarded from the responses() function
through the transformation handler and config to maintain header propagation in
litellm_completion_request dict.

* Add tests
2025-08-27 12:35:09 -07:00
Ishaan Jaff
4fff05f1cc
[Feature]: Support Gemini requests with only system prompt (#14010)
* _default_user_message_when_system_message_passed

* test_system_prompt_only_adds_blank_user_message

* test_system_message_with_no_user_message
2025-08-27 12:12:47 -07:00
Kevin Turcios
8404fdea5b Update in_memory_cache.py 2025-08-27 13:35:48 -05:00
Ishaan Jaff
f35ce02475
[Bug Fix] LLM Translation - Allow using dynamic api_key for image generation requests (#14007)
* fix - allow using dyanmic api key for img gen

* test_aiml_image_generation_with_dynamic_api_key
2025-08-27 10:51:24 -07:00
Ifta Khairul Alam Adil
d9f8eb27c9 fix: enable tool choice support for model prices and context window
- Updated the "supports_tool_choice" field to true in the model_prices_and_context_window.json file, allowing for tool choice functionality in the specified model.

Signed-off-by: Ifta Khairul Alam Adil <ikaadil007@gmail.com>
2025-08-27 19:46:53 +02:00
Ishaan Jaff
ed52b67fcf test_image_edit_array_handling 2025-08-27 09:51:22 -07:00
Ishaan Jaff
d5440f9614 test_image_edit_array_handling 2025-08-27 08:27:57 -07:00
Ishaan Jaff
76f78f7b2a fix: LITELLM_LOG_FILE test 2025-08-27 08:25:24 -07:00
Ifta Khairul Alam Adil
8808f78ba6 Merge branch 'main' into fix/gemini-imagen-model-name-validation 2025-08-27 15:45:59 +02:00
Ifta Khairul Alam Adil
ab4cd48c40 refactor: remove unnecessary whitespace in GoogleImageGenConfig
- Cleaned up the code by removing an extra blank line in the GoogleImageGenConfig class.
- This minor adjustment improves code readability without affecting functionality.

Signed-off-by: Ifta Khairul Alam Adil <ikaadil007@gmail.com>
2025-08-27 11:55:19 +02:00
Ifta Khairul Alam Adil
2d515e72ff refactor: simplify URL construction for Gemini image generation
- Remove unnecessary model name prefix stripping
- Directly use the model name in the API URL construction

This change streamlines the URL generation process for the Google AI API, ensuring compatibility with model names without the 'gemini/' prefix.

Signed-off-by: Ifta Khairul Alam Adil <ikaadil007@gmail.com>
2025-08-27 11:53:47 +02:00
Krish Dholakia
539b94ad4e
Merge pull request #13394 from Deviad/feature/enhance_logging_for_containers
Enhance logging for containers to log on files both with usual format and json format
2025-08-26 23:21:34 -07:00
Krish Dholakia
900bd10905
Merge branch 'main' into feature/enhance_logging_for_containers 2025-08-26 23:21:15 -07:00
Krish Dholakia
71af7bcf9c
Merge pull request #13374 from blahgeek/fix-count-special-token
Fix token_counter with special token input
2025-08-26 23:19:26 -07:00
Krish Dholakia
ddec6c69c8
Merge pull request #13534 from cometapi-dev/main
docs: Add CometAPI documentation with authentication, usage examples, and error handling
2025-08-26 23:17:04 -07:00
Krish Dholakia
4613f7821d
Merge pull request #13536 from edwardsamuel/feat/openrouter-gpt-5-pricing
Add openrouter gpt-5 family models pricing
2025-08-26 23:16:53 -07:00
Krish Dholakia
45f465d84f
Merge pull request #13572 from Noma-Security/noma-security-guardrails-support
Add Noma Security guardrail support
2025-08-26 23:15:17 -07:00
Krish Dholakia
201d96b2d2
Merge pull request #13917 from Toy-97/patch-1
Deepinfra Metadata Update 24082025
2025-08-26 23:13:46 -07:00
Krish Dholakia
28f7df8da8
Merge pull request #13965 from manascb1344/feat/nebius-models-update
feat(constants): expand Nebius provider models and normalize model IDs
2025-08-26 23:13:06 -07:00
Krish Dholakia
682fb697d0
Merge pull request #13969 from dttran-glo/patch-1
bump `orjson` version to "3.11.2"
2025-08-26 23:09:57 -07:00
Ishaan Jaff
ee324943d7 bump: version 1.76.0 → 1.76.1 2025-08-26 20:02:57 -07:00
Ishaan Jaff
c839b2c751 installing_litellm_on_python 2025-08-26 19:51:02 -07:00
Ishaan Jaff
80d4cc1283
[Perf] Use fastuuid for fast UUID generations - 2.1x Faster (#13992)
* use fastuuid

* add fastuuid

* add fastuuid==0.12.0
2025-08-26 19:47:25 -07:00
Ifta Khairul Alam Adil
0f5b31fd78 fix: resolve invalid model name error for Gemini Imagen models (#13851)
- Fix URL construction in Gemini image generation to strip 'gemini/' prefix
- Google AI API expects base model name without the prefix
- Update model references and pricing information for consistency
- Remove outdated image generation pricing entries

Fixes issue where models like 'gemini/imagen-4.0-fast-generate-preview-06-06'
were being rejected by the Google AI API due to incorrect URL formatting.
2025-08-27 04:17:35 +02:00
Ishaan Jaff
ab7efaa832
test_pre_process_non_default_params (#13990) 2025-08-26 19:15:17 -07:00
Cole French
6696955506
[Bug]: Fix tests to reference moved attributes in braintrust_logging module (#13978)
* Mock instance attribute moved from globals

* Support looking up mock message on mock choice
2025-08-26 18:58:16 -07:00
codeflash-ai[bot]
5dba5822f2
️ Speed up function _is_debugging_on by 45% (#13988)
The optimization eliminates unnecessary conditional branching by replacing the explicit `if-else` structure with a direct return of the boolean expression. Instead of evaluating the condition and then branching to return `True` or `False`, the optimized version directly returns the result of the boolean expression `verbose_logger.isEnabledFor(logging.DEBUG) or set_verbose is True`.

This change removes Python's conditional jump overhead and reduces the number of executed bytecode instructions per function call. The line profiler shows the original version required 3 lines of execution (condition check, conditional return True, fallback return False) while the optimized version executes only 1 line.

The 45% speedup is achieved by:
- **Eliminating branching overhead**: No conditional jumps needed
- **Reducing bytecode instructions**: From ~3 instructions to 1 instruction per call
- **Leveraging Python's short-circuit evaluation**: The `or` operator still evaluates left-to-right and stops early when the first condition is True

The optimization is particularly effective for this logging utility function which is likely called frequently throughout the application. All test cases show consistent 40-75% improvements across different scenarios (debug on/off, verbose flag variations, edge cases with different logging levels), demonstrating the optimization works well regardless of the boolean expression's outcome.

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
2025-08-26 17:25:45 -07:00
Ishaan Jaff
5647757ab3
[Feat] New model gemini-2.5-flash-image-preview (#13979)
* add gemini-2.5-flash-image-preview

* add gemini-2.5-flash-image-preview
2025-08-26 15:04:02 -07:00