merge main - #26303
Merged
Sameerlite merged 341 commits intoApr 23, 2026
Merged
Conversation
fix(proxy): enforce organization boundaries in admin operations
fix(proxy): read guardrail config from admin metadata, fix tag routing consistency
fix(proxy): add URL validation for user-supplied URLs
…soning Add support for grok-4.20-0309-reasoning model
…ls params to new_team docstring
…ls to update_team docstring
* docs: add copy-page-as-markdown button + llms.txt generation Adds the signalwire llms-txt Docusaurus plugin + theme so every docs page gets: - A "Copy Page" dropdown in the breadcrumbs (Copy, View Markdown, Ask ChatGPT, Ask Claude) — defaults from the theme hook, no extra config required. - A raw `.md` companion at `<page>.md` for LLM consumption. - Site-wide `/llms.txt` index and `/llms-full.txt` corpus. The signalwire plugin README documents a `copyPageButton` option that the v1.2.2 Joi schema actually rejects; the theme's defaults cover the same feature set, so only `content.enableMarkdownFiles` and `enableLlmsFullTxt` are set. Theme is pinned to `1.0.0-alpha.9` because the floating version resolves to a broken canary whose `main` points at a missing file. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com> * docs: pin exact versions for signalwire llms-txt deps Drop the caret ranges on the two packages added in the prior commit so the docs site pulls byte-identical npm tarballs on every install. Matches the existing convention in this package.json (everything else is already exact) and protects against supply-chain substitution if a malicious patch version is published under the same minor. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com> * docs: upgrade signalwire llms-txt plugin to v2 alpha + enable copy button The stable v1.2.2 plugin we first pinned does not call setGlobalData during contentLoaded, so the theme's CopyPageContent component always returned null (its `!siteConfig` bailout). The theme v1.0.0-alpha.9 is built against the v2-alpha plugin API, which is the version that actually wires the copy-content JSON and plugin config into the theme via setGlobalData. Pins plugin to 2.0.0-alpha.7 (exact, no caret) and switches the config to the v2 schema: - top-level `markdown` + `llmsTxt` replace the v1 `content` block - new `ui.copyPageContent` (off by default in v2) enables the button with view-markdown + ChatGPT + Claude actions. Verified end-to-end: production build serves the dropdown with "Copy Raw Markdown", "View Markdown", "Reference in ChatGPT", and "Reference in Claude" on /docs/routing (button mounts at ~x=960 in the breadcrumbs row). Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com> --------- Co-authored-by: yuneng-jiang <yuneng@berri.ai> Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
[WIP][Perf] Litellm prometheus improvements
Add a single install_uv command in the commands: section that encodes the uv version (0.10.9) and its SHA256 in one place, then replace all 42 inline curl|sha256|install blocks across every job that needs uv. setup_litellm_test_deps now calls install_uv too, so the shared test-dep bootstrap goes through the same path. Bumping uv version or SHA is now a one-line change instead of 43. Net: -203 lines.
Add a start_postgres command parameterized on db_name (default circle_test) that runs the postgres-db container and waits for port 5432 to accept connections. Replace all 11 inline docker run / wait_for_service blocks with a single - start_postgres call. The helm chart test overrides db_name to litellm_test; everything else uses the default. One of the 11 sites previously used a bespoke pg_isready loop instead of wait_for_service; it now goes through the same TCP-probe path everyone else uses, which is sufficient for test ordering purposes. Net: -112 lines.
Docker-executor jobs: - Consolidate base images on cimg/python:3.12. Jobs previously on 3.11 (26 jobs), 3.9 (1 historical: upload-coverage), and an incidental 3.13.1 (litellm_assistants_api_testing) now use 3.12. - installing_litellm_on_python_3_13 keeps cimg/python:3.13.1 as its explicit "latest Python supported" install-check matrix job. Machine-executor jobs: - Delete the miniconda install step from 10 jobs. uv now manages Python directly: uv sync --python 3.12 auto-downloads a python-build-standalone interpreter if the ubuntu-2204 base image's default python doesn't match. - Remove 37 "if [ -f conda.sh ]; then conda activate myenv" wrappers and 2 unconditional conda activate blocks left behind from the conda days. - proxy_build_from_pip_tests keeps its 3.13 target (it was conda create -n myenv python=3.13) via uv sync --python 3.13. Net: -301 lines.
…ine image
Follow-up cleanup after an independent review pass surfaced a few
loose ends:
- Delete a 6x-duplicated filter block in litellm_mapped_tests_proxy_part2
(same kind of copy-paste residue we fixed earlier in
langfuse_logging_unit_tests).
- Delete the empty "Install Semgrep" run step in the semgrep job — the
command body was empty because semgrep is installed on-demand via
uv tool run in the next step.
- Standardize machine-executor image: one job was on ubuntu-2204:2023.10.1
while build_docker_database_image was already on ubuntu-2204:2024.04.1.
Bumped everything to 2024.04.1.
- Remove the legacy "version: 2" inside the workflows: block — CircleCI
2.1 top-level already declares the version.
- Drop `{{ checksum ".circleci/config.yml" }}` from cache keys (13 sites).
It was busting the cache on every unrelated config edit; the uv.lock
checksum alone is the right dependency cache key.
- Add partial-restore fallbacks to every restore_cache with a single
templated key (10 sites). Jobs now fall back to the latest cache with
a matching prefix if the exact uv.lock hash isn't cached yet.
Net: -14 lines.
Litellm adaptive routing
[Fix] Docker: restore pre-uv Prisma cache path
[Infra] CircleCI config cleanup and consolidation
Restore guardrail spend/UI event_type wiring, request_data on streaming OUTPUT paths, and centralized match redaction after the upstream revert. Made-with: Cursor
- Dedupe names in add_guardrail_to_applied_guardrails_header (matches policies). - Inline unified during_call condition so mypy narrows UserAPIKeyAuth. - Extend bedrock guardrails test mock for logging_event_type. Made-with: Cursor
Principle: GHA handles work that doesn't need external API keys; CCI
stays for integration tests that hit real API endpoints.
Four CCI jobs moved to new or extended GHA workflows:
1. check_code_and_doc_quality (was 25 runs: ruff + import-safety +
21 code_coverage_tests + 3 documentation_tests + circular-imports).
- The 21 tests/code_coverage_tests/*.py scripts and the 3
tests/documentation_tests/*.py scripts run in the new
.github/workflows/test-code-quality.yml workflow.
- ruff, import-safety, and circular-imports were already run by
.github/workflows/test-linting.yml — no new migration needed.
- The 3 documentation_tests scripts read
docs/my-website/docs/proxy/config_settings.md. Since docs have
moved to BerriAI/litellm-docs, the GHA workflow checks out that
repo and symlinks docs/my-website -> the checkout so the
existing hardcoded paths resolve without touching the scripts.
The stale local docs/my-website/ copy in this repo will be
removed in a separate PR.
2. semgrep (custom-rule SAST against .semgrep/rules).
- New .github/workflows/test-semgrep.yml.
3. installing_litellm_on_python + installing_litellm_on_python_3_13
(pip install compat checks on Python 3.12 and 3.13).
- New .github/workflows/test-install-litellm.yml as a matrix job.
- 3.12 run also verifies litellm_enterprise import; 3.13 run
skips that check (matches previous CCI behavior).
- installing_litellm_on_python_v2_migration_resolver stays in CCI
because it requires a postgres service.
CCI .circleci/config.yml: -112 lines, 4 jobs and their workflow refs
removed.
Replace the calibration step (one request + 10-minute poll) with an independent ground truth computed from response usage via litellm.cost_per_token. All N requests are made up front, so a single dropped Redis write no longer kills the test. Add /health/readiness checks at test start and on poll timeout so the failure message surfaces proxy state (db, cache) instead of "calibration timed out". Set PROXY_BATCH_WRITE_AT=2 in the spend tracking CI job to shorten the scheduler flush window.
store_in_memory_spend_updates_in_redis drained the in-memory queues into local variables before the rpush pipeline. If rpush raised (cloud Redis hiccup, timeout, connection blip), those already-drained transactions were garbage-collected with the scheduler job, silently losing all spend aggregated during that tick. Wrap the rpush in try/except. On failure, re-enqueue the aggregated transactions into their respective in-memory queues so the next scheduler tick retries. Add a unit test that seeds real queues, simulates an rpush failure, and asserts the transactions land back in-memory.
Replace recursive `_walk` helper with a stack-based traversal so the recursive_detector CI check passes without adding to the ignore list, and avoid Python recursion limits on deeply nested payloads. Made-with: Cursor
The daily queue parameter types on _restore_spend_updates_to_in_memory_queues were narrowed to specific subtypes (DailyUserSpendTransaction, etc), but the caller passes Dict[str, BaseDailySpendTransaction] — the return type of flush_and_get_aggregated_daily_spend_update_transactions. Widen the parameters to the base type. Also replace dynamic TypedDict key lookup (which returned object) with explicit literal-keyed get() calls so mypy can type-narrow each field.
…d_logging_reapply fix(proxy): Bedrock guardrail spend logs - hook mode, match redaction, streaming request_data
[Infra] Migrate more CI jobs from CircleCI to GitHub Actions
[Fix] Stabilize flaky spend accuracy tests + patch Redis buffer data-loss path
fix(router): wildcard order fallback to higher-order deployments
… errors Two changes, both test-only: - Configure the aiohttp session with TCPConnector(force_close=True) and an explicit ClientTimeout(total=30, connect=10). Prevents reuse of idle TCP connections that the proxy/kernel may have closed during the long window between setup POSTs and the later poll loop, and surfaces a blocked proxy event loop quickly instead of hanging on aiohttp's 5-minute default. - In poll_key_spend_until, catch aiohttp.ClientError and asyncio.TimeoutError around the single /key/info call. A transient transport hiccup now logs and retries on the next tick instead of failing the entire polling loop. Addresses the ConnectionTimeoutError observed on the first /key/info call after the 20 chat completions.
Track per-member total spend on team memberships
[Fix] Stabilize spend accuracy test transport flakes
[Infra] bump versions
Sameerlite
merged commit Apr 23, 2026
94288d7
into
litellm_Sameerlite/openai-chat-to-responses
176 of 180 checks passed
Contributor
|
Too many files changed for review. ( |
|
|
fzowl
pushed a commit
to fzowl/litellm
that referenced
this pull request
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/test_litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
CI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Screenshots / Proof of Fix
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes