Commit Graph
4783 Commits
Author SHA1 Message Date
Cesar GarciaandGitHub 650b18974f fix(gemini): skip thinking config for image models (#17027)
* fix(gemini): exclude image models from automatic thinking_level parameter (#17013)

- gemini-3-pro-image-preview does not support thinking_level parameter
- Added check to skip adding thinkingConfig for models containing "image"
- Fixes BadRequestError: "Thinking level is not supported for this model"
- Only affects automatic default behavior, user can still pass reasoning_effort explicitly

Fixes #17013

* test: add tests for gemini-3 image models thinking_level exclusion

* update docs
2025-11-24 20:54:12 -08:00
1ae80955e8 Docs: Add link to logging payload spec (#17049)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-11-24 20:48:10 -08:00
Sameer KankuteandGitHub fc219c7db8 Integrate eleven labs text-to-speech (#16573)
* Add elevenlaps tts support

* fix mypy error

* add simple usage in docs
2025-11-24 18:49:30 -08:00
Mubashir OsmaniandGitHub aec6590486 add strands tutorial (#17039)
* add strands tutorial

* configgg
2025-11-24 17:31:59 -08:00
YutaSaitoandGitHub f5a3349fef feat: add UI support for configuring tool permission guardrails (#17050)
* feat: add UI support for configuring tool permission guardrails

* chore: rename UI/Docs references to "LiteLLM Tool Permission Guardrail"
2025-11-24 17:13:07 -08:00
Ishaan JaffandGitHub d2b90e6644 [Docs] Claude Skills API (#17052)
* add skillls api

* init doc

* docs fix

* skills API
2025-11-24 15:32:03 -08:00
a807fe4450 add claude opus 4.5 (#17043)
* add claude opus 4.5

* Apply suggestion from @Chesars

Co-authored-by: Cesar Garcia <128240629+Chesars@users.noreply.github.com>

---------

Co-authored-by: Cesar Garcia <128240629+Chesars@users.noreply.github.com>
2025-11-24 14:30:36 -08:00
62b84d6aad Prompt security litellm (#16365)
* add prompt security guardrails provider

* cosmetic

* small

* add file sanitization and update context window

* add pdf and OOXML files support

* add system prompt support

* add tests and documentation

* remove print

* fix PLR0915 Too many statements (96 > 50)

* cosmetic

* fix mypy error

* Fix failed tests due to naming conflict of responses directory with same-named pip package

* Fix mypy error: use 'aembedding' instead of 'embeddings' for async embedding call type

* Fix: Install enterprise package into Poetry virtualenv for tests

The GitHub Actions workflow was installing litellm-enterprise to system Python
using 'python -m pip install -e .', but tests run in Poetry's virtualenv using
'poetry run pytest'. This caused ImportError for enterprise package types.

Changed to 'poetry run pip install -e .' so the package is available in the
same virtualenv where pytest executes.

Fixes enterprise test collection errors in GitHub Actions CI.

* Move Prompt Security guardrail tests to tests/test_litellm/

Per reviewer feedback, move test_prompt_security_guardrails.py from
tests/guardrails_tests/ to tests/test_litellm/proxy/guardrails/ so
it will be executed by GitHub Actions workflow test-litellm.yml.

This ensures the Prompt Security integration tests run in CI.

---------

Co-authored-by: Ori Tabac <oritabac@prompt.security>
Co-authored-by: Vitaly Neyman <vitaly@prompt.security>
2025-11-24 11:44:20 -08:00
559142a738 Add table explaining different callback hooks (#17035)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-11-24 08:37:35 -08:00
7c1dfd4462 docs: Clarify optional user_allowed_email_domain (#17034)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-11-24 08:34:35 -08:00
c368b4c180 Document model pricing contribution process (#17031)
* Add doc for adding model pricing and context window

Co-authored-by: krrishdholakia <krrishdholakia@gmail.com>

* Refactor model pricing documentation to include sample spec and examples

Co-authored-by: krrishdholakia <krrishdholakia@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-11-24 08:28:24 -08:00
f18cec2fe3 Update release notes to v1.80.5.rc.2 (#17032)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-11-24 08:25:57 -08:00
Krish DholakiaandGitHub 760bce24bd feat(proxy_server.py): preserve content field even if null (#16988)
* feat(proxy_server.py): preserve content field even if null

* fix(proxy/utils.py): fix recursive function

* docs: new params

* docs: cleanup docs

* fix: fix linting errors
2025-11-23 22:05:58 -08:00
Ishaan Jaffer 73d3d151ab fix 1.80.5 2025-11-22 19:24:46 -08:00
YutaSaitoandGitHub 06f2ecef42 feat: tool permission argument check (#16982) 2025-11-22 19:21:25 -08:00
Ishaan JaffandGitHub f3cd0b0bc4 docs - ai gateway prompt management (#16990)
* docs prompt management

* docs

* add prompt mgmt imgs

* docs fix

* docs prompt management

* docs fix

* docs prompt versions

* docs fix
2025-11-22 18:49:29 -08:00
Ishaan Jaffer 1c864dc0de docs 1.80.5 2025-11-22 17:54:50 -08:00
Ishaan Jaffer 7e338f1beb docs sso roles 2025-11-22 17:36:44 -08:00
Ishaan Jaffer 2ebfc92dca docs fix 2025-11-22 17:34:45 -08:00
Ishaan Jaffer 036b2848e3 docs 2025-11-22 17:33:57 -08:00
Ishaan Jaffer f1e4242cbf docs fix 2025-11-22 17:33:57 -08:00
Alexsander HamirandGitHub 815136fbef perf release notes (#16978) 2025-11-22 17:23:31 -08:00
Ishaan Jaffer 023eefb6d5 docs fix 2025-11-22 16:54:30 -08:00
Ishaan Jaffer 93c2103097 fix docs 2025-11-22 16:16:56 -08:00
Ishaan Jaffer 7cbb159997 v1.80.0-stable 2025-11-22 16:09:52 -08:00
Krrish Dholakia d0cb2db0c6 docs(ai_hub.md): document mcp servers on ai hub 2025-11-22 16:07:38 -08:00
yuneng-jiangandGitHub c6e0a0209f Docs for Model Compare UI (#16979) 2025-11-22 15:48:42 -08:00
c966c122ad feat: Add Presidio PII masking tutorial (#16969)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2025-11-22 15:45:43 -08:00
Krish DholakiaandGitHub b9f2cc1c98 Model Armor - Logging guardrail response on llm responses (#16977)
* Litellm dev 11 22 2025 p1 (#16975)

* fix(model_armor.py): return response after applying changes

* fix: initial commit adding guardrail span logging to otel on post-call runs

sends it as a separate span right now, need to include in the same llm request/response span

* fix(opentelemetry.py): include guardrail in received request log + set input/ouput fields on parent otel span instead of nesting it

allows request/response to be seen easily on observability tools

* fix(model_armor.py): working model armor logging on post call events

* fix: fix exception message

* fix(opentelemetry.py): add backwards compatibility for litellm_request

allow users building on the spec change to use previous spec
2025-11-22 15:44:28 -08:00
Ishaan Jaffer 4fb9e33a95 fixes 2025-11-22 14:11:13 -08:00
Ishaan Jaffer b43b68a072 docs fix 2025-11-22 14:02:14 -08:00
Alexsander HamirandGitHub b02baf53a9 Fix: prevent memory blowout in LoggingWorker (#16559)
* fix: prevent memory blowout in LoggingWorker

Tasks were being executed sequentially with each task awaited before
processing the next one. When the queue had 10k+ tasks, only one could
execute at a time. Since the request rate exceeded execution speed,
objects accumulated in memory (50k+), holding references to heavy
objects and causing memory blowout.

The new implementation uses a semaphore to allow up to 1000 concurrent
tasks while properly tracking and cleaning up each task, significantly
improving throughput and preventing queue buildup.

* fix: require semaphor before removing task from queue

* fix: make worker concurrency configurable

* fix: clean comments

* fix: clarify new env purpose

* fix: add missing lib

* make constants configurable instead of hardcoded

* add more aggressive cleaning when queue is full

* add helpers function for the aggressive cleaning functionality

* use envs instead of static constants

* import and document constants

* add unit test for new functionality

* fix default value on config_settings

* fix: remove unused variables and imports to resolve linter errors

- Remove unused time_since_last_clear variable in logging_worker.py
  The variable was calculated but never used in _handle_queue_full()
  method, causing F841 linter error.

- Remove unused TYPE_CHECKING import in mcp_server/server.py
  The import was not used anywhere in the file, causing F401 linter error.

These changes improve code cleanliness and ensure the codebase passes
all linter checks without affecting functionality.

* add missing log expected by test_queue_full_handling

* fix: clean config_setting.md file

* fix: handle logging errors gracefully during shutdown in _flush_on_exit

During process shutdown, logging handlers may be closed while _flush_on_exit
tries to flush queued logging coroutines. This causes 'ValueError: I/O
operation on closed file' errors when coroutines attempt to log.

Changes:
- Add _safe_log helper method that wraps logging calls and suppresses
  errors when logging handlers are closed (ValueError, OSError, AttributeError)
- Replace all verbose_logger calls in _flush_on_exit with _safe_log
- Remove logging from exception handler in coroutine execution loop
  to prevent cascading errors during shutdown

This ensures graceful shutdown even when logging handlers are closed,
which is common during process termination.
2025-11-22 13:58:29 -08:00
Ishaan Jaffer a06e7edd85 docs 1.80.5 2025-11-22 13:52:26 -08:00
Krish DholakiaandGitHub ac3aa74c22 (feat) Anthropic - support Structured Outputs output_format for Claude 4.5 sonnet and Opus 4.1 + Arize Phoenix - root span logging (#16949)
* feat(anthropic/chat/transformations): for claude-4-5-sonnet and opus-4-1 support passing structured output to anthropic api

* docs: document new feature

* fix: fix output format

* fix: cleanup

* fix(transformation.py): conditionally pass in json tool call

* fix: support ARIZE_SPACE_ID instead of ARIZE_SPACE_KEY

* docs(arize_integration.md): cleanup arize docs

* feat(callback_info_helpers.tsx): allow setting arize space id via ui

* fix: fix linting error

* fix(opentelemetry.py): working arize phoenix root span tracing
2025-11-22 12:08:26 -08:00
Ishaan Jaffer 3ba3faefb8 fix sec scan 2025-11-22 11:50:32 -08:00
Ishaan Jaffer ff99f93dfc fix req.txt 2025-11-22 11:46:17 -08:00
Cesar GarciaandGitHub 6810e0699b docs: Add mini-swe-agent to Projects built on LiteLLM (#16971)
* docs: Add mini-swe-agent to projects page

Add mini-swe-agent to the documentation projects page.
mini-swe-agent is a minimal AI coding agent that resolves >70% of
GitHub issues in SWE-bench, built on LiteLLM for model flexibility.

- Added projects/mini-swe-agent.md documentation
- Updated sidebars.js to include mini-swe-agent in projects list

* docs: Update Singularity to Apptainer in mini-swe-agent.md
2025-11-22 10:45:29 -08:00
Ishaan Jaffer badbadba0d fix img URL for tests 2025-11-22 09:41:15 -08:00
Sameer KankuteandGitHub 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 JaffandGitHub 661117678c Revert "remove deprecated embedding model (#16724)" (#16970)
This reverts commit b9bc903536.
2025-11-22 09:34:53 -08:00
bbaf0af907 Grayswan guardrail passthrough on flagged (#16891)
* attempt to implement the passthrough feature

* Formatting and small change

* Fix formatting

* Format test file

---------

Co-authored-by: Xiaohan Fu <xiaohan@grayswan.ai>
2025-11-21 20:01:35 -08:00
Mubashir OsmaniandGitHub db58f6aeb1 fix: arize phoenix logging (#16301)
* arize phx

* fix arize integration

* traces to specific project name

* fix

* look for http endpoint
2025-11-21 18:46:18 -08:00
yuneng-jiangandGitHub 1ebe1fea37 Docs for Model Compare UI and Org Usage (#16928)
* Docs for Model Compare UI and Org Usage

* Fix typo in img path and add Model Compare to sidebars.js

* Updated to remove from 1.80 writeup
2025-11-21 16:45:55 -08:00
Ishaan JaffandGitHub 8e318dd06c [Feat] New LLM Provider - Docker Model Runner (#16948)
* add DOCKER_MODEL_RUNNER

* add DockerModelRunnerChatConfig Transorm

* add docker_model_runner

* add docker_model_runner

* docs docker model runner

* add DockerModelRunnerChatConfig

* add docker_model_runner to providers

* test_completion_hits_correct_url_and_body

* fix sidebar

* TestDockerModelRunnerIntegration

* test_completion_with_custom_engine_and_host

* docs docker model runner

* docs fix
2025-11-21 16:09:32 -08:00
Suresh KumarandGitHub 5b4a848391 fix anthropic pass-through endpoint (#16883) 2025-11-21 16:00:05 -08:00
Cesar GarciaandGitHub 1c65800f4a Feat: add support for Grok 4.1 Fast models (#16936)
* feat: Add support for Grok 4.1 Fast models

Add new xAI Grok 4.1 Fast models optimized for high-performance agentic tool calling:

- xai/grok-4-1-fast (alias for grok-4-1-fast-reasoning)
- xai/grok-4-1-fast-reasoning (with reasoning capabilities)
- xai/grok-4-1-fast-reasoning-latest
- xai/grok-4-1-fast-non-reasoning (without reasoning for faster responses)
- xai/grok-4-1-fast-non-reasoning-latest

Features:
- Context window: 2,000,000 tokens
- Pricing: $0.20/1M input, $0.50/1M output tokens
- Cached tokens: $0.05/1M tokens
- Supports: Function calling, Structured outputs, Vision, Audio input, Web search, Reasoning

Fixes #16927

* docs: Add comprehensive Grok models documentation

- Add 'Supported Models' section highlighting new Grok 4.1 Fast models
- Include comparison guide for reasoning vs non-reasoning models
- Add complete model family table (Grok 4.1, 4, 3, Code, 2)
- Add features legend explaining capabilities
- Remove pricing details (link to xAI docs instead for current rates)
- Improve documentation clarity and consistency

Related to #16927

* docs: Minor corrections to xai.md
2025-11-21 15:57:55 -08:00
YutaSaitoandGitHub 7c4ef090c1 docs: fix mcp url format (#16940)
* docs: fix mcp url format

* fix: update Cursor MCP example to use url instead of server_url
2025-11-21 15:43:26 -08:00
colinlin-stripeandGitHub f9d8eeaf8e [stripe] gemini 3 thought signatures in tool call id (#16895)
* though signature tool call id

* [stripe] refactor and tests

* [stripe] remove md and move to factory

* [stripe] remove redudant test

* [stripe] ran black formatting

* [stripe] add thought signature docs

* [stripe] remove unused import
2025-11-21 13:44:53 -08:00
YutaSaitoandGitHub 041ac054b6 feat: allow custom violation message for tool-permission guardrail (#16916) 2025-11-21 08:52:01 -08:00
Krrish Dholakia e7751f0c12 docs: fix docs bug 2025-11-20 16:05:39 -08:00