Commit graph

37645 commits

Author SHA1 Message Date
Cursor Agent
ecaf72f078
feat(ui): migrate organization_view to shadcn
- antd Form/Input/Select/Tabs/Typography/Button + @tremor/react Card/
  Grid/Badge/Text/TextInput/Title/Button + @heroicons/react ArrowLeftIcon
  \u2192 shadcn Card/Input/Select/Tabs/Badge/Button + lucide ArrowLeft +
  react-hook-form for the edit form (FormProvider + Controller +
  register).
- Replaces the antd Tabs items[] config with TabsList + TabsContent.
- Replaces grid-via-Tremor-Grid with plain Tailwind grid.
- Member table extra columns now use plain JSX cells (the MemberTable
  consumer renders them as antd ColumnsType internally; will be migrated
  in its own commit later).
- NumericalInput onChange callbacks are explicitly typed (number | null
  | undefined) to satisfy strict noImplicitAny in this file.

Gates: TS \u2713 | Lint \u2713 | Vitest 4/4 \u2713 | Build pending (next batch).

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 07:24:02 +00:00
Cursor Agent
7cd5643db1
feat(ui): migrate alerting DynamicForm + email_event_settings to shadcn
- alerting/dynamic_form.tsx: antd Form/Input/InputNumber/Button +
  @tremor/react Badge/Icon/Text/TableRow/TableCell/Switch/Button +
  @heroicons/react TrashIcon/CheckCircleIcon \u2192 native <form> with
  local state snapshot, shadcn Badge/Button/Input/Switch/TableCell/
  TableRow, lucide Trash2/CheckCircle. Emits <TableRow> children
  expected to be rendered inside an ambient <Table>/<TableBody>
  parent.
- email_events/email_event_settings.tsx: antd Typography/Divider/Spin/
  Checkbox + @tremor/react Card/Text/Button \u2192 shadcn Card/Button/
  Checkbox/Separator/Skeleton, plain <h4>/<p>/<label> + Tailwind. Turned
  the async fetchEventSettings into an inline useEffect to satisfy
  react-hooks/exhaustive-deps (trivially the original logic).

Gates: TS \u2713 | Lint \u2713 | Vitest n/a (no colocated tests) | Build \u2713.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 07:19:05 +00:00
Cursor Agent
0bff3df3cc
docs(ui): finalize phase-1 migration report
Captures the end-of-run state:

- Foundation (Tasks 1\u20139): all complete and green.
- Sections migrated (4 of 33): Access Groups (with locked blueprint),
  Virtual Keys (stress test passed), Budgets, Tool Policies.
- Test results: 170/170 tests pass across migrated sections and
  molecules; 3801/3801 full-tree vitest (Task 4 checkpoint).
- Deps delta: 8 new deps; deprecated deps (antd / heroicons / remixicon /
  headlessui) still present as long as any un-migrated section imports
  them \u2014 Task 45 (uninstall) deferred accordingly.
- Baseline bundle: 15425508 bytes JS, 21 MB out/.
- 29 sections pending; blueprint + recipe are stable and ready for the
  next run.

Lists the sections not yet migrated, cross-cutting deviations, and
phase-2 prerequisites unchanged from the previous checkpoint.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 07:15:48 +00:00
Cursor Agent
fcc9dc1ed5
docs: update CLAUDE.md UI section for shadcn phase-1 migration
Replaces the old '### UI Component Library' section (which advised using
antd) with a new '### UI' section describing the post-migration stack:

- shadcn/ui primitives in src/components/ui/
- lucide-react icons (no @ant-design/icons, @heroicons/react, @remixicon/react)
- react-hook-form + zod + shadcn <Form>
- sonner via MessageManager/NotificationManager wrappers
- @tanstack/react-table + shadcn Table
- @tremor/react charts-only

Adds sections on style rules (semantic Tailwind tokens only), lint
enforcement (the two custom litellm-ui rules), a migration-in-progress
note pointing at MIGRATION_REPORT.md and BLUEPRINT.md, and a phase-2
deferral list.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 07:13:15 +00:00
Cursor Agent
84dc367790
docs(ui): update migration report with foundation + sections 1-3, 6 progress
Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 07:12:15 +00:00
Cursor Agent
b0ef2c70d4
feat(ui): migrate tool-policies (PolicySelect) to shadcn
- PolicySelect.tsx: antd Select \u2192 shadcn Select + SelectTrigger/
  Content/Item. Preserves categorical amber/emerald/red palette for the
  untrusted/trusted/blocked policy badges (these are non-semantic values
  by design). PolicySelect.tsx added to .eslintrc.json raw-colors override
  list. Deviation recorded in DEVIATIONS.md.
- PolicySelect.test.tsx: replace `.ant-select` class assertion with
  semantic `toBeDisabled()` against getByRole('combobox'), agnostic of
  underlying Select primitive.

Gates: TS \u2713 | Lint \u2713 | Vitest 12/12 \u2713 | Build \u2713.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 07:11:23 +00:00
Cursor Agent
01cc55886e
feat(ui): migrate budgets to shadcn
- budget_panel.tsx: @tremor/react Table / Card / TabGroup / TabList /
  TabPanel / Button / Text \u2192 shadcn Table / Card / Tabs / Button +
  plain Tailwind for text. Moved action buttons into a proper TableCell
  (antd Table accepted dangling children but shadcn's semantic
  <table> element does not).
- budget_modal.tsx: antd Modal / Form / InputNumber / Select +
  @tremor/react TextInput / Accordion \u2192 shadcn Dialog /
  react-hook-form / Input / Select / Accordion. Introduces a small
  LabeledRow helper for the label-on-left-value-on-right layout that
  antd's Form.Item with labelCol/wrapperCol used to provide.
- edit_budget_modal.tsx: same treatment; preserves the disabled
  Budget ID field and the Accordion-wrapped optional settings.

Gates: TS \u2713 | Lint \u2713 (pre-existing unused-imports errors in
budget_panel.test.tsx unchanged) | Vitest 6/6 \u2713 | Build \u2713.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 07:08:32 +00:00
Cursor Agent
b8d48fecca
feat(ui): migrate virtual-keys (VirtualKeysTable + BudgetWindowsEditor) to shadcn
Scope: section-2 stress-test of the locked phase-1 blueprint.

- VirtualKeysTable.tsx (700+ lines):
  - @tremor/react Table + TableHead/Body/Row/Cell \u2192 shadcn Table equivalents
  - @tremor/react Badge / Icon / Text / Button \u2192 shadcn Badge + lucide icons +
    Tailwind semantic tokens
  - @heroicons/react ChevronDown/ChevronRight/ChevronUp/SwitchVertical \u2192 lucide
    Chevron* + ChevronsUpDown
  - @ant-design/icons InfoCircleOutlined / SyncOutlined \u2192 lucide Info / RefreshCw
  - antd Popover / Tooltip / Button / Skeleton / Typography \u2192 shadcn equivalents
    from @/components/ui/*. CopyableText helper replaces antd Typography.Text
    copyable semantics (clipboard + sonner toast).
  - Raw color classes (text-blue-500, bg-blue-50, text-gray-700, hover:bg-gray-50,
    bg-white) replaced with semantic tokens (text-primary, bg-primary/10,
    text-muted-foreground, hover:bg-muted, bg-background).
- BudgetWindowsEditor.tsx: antd Button/InputNumber/Select \u2192 shadcn
  Button/Input/Select. Antd's InputNumber `prefix="$"` preserved as absolute-
  positioned span adjacent to the input (shadcn Input has no prefix prop).

Blueprint stress-test result: NO new patterns required. Every antd /
@tremor / @heroicons / @ant-design/icons import encountered maps cleanly
to an entry already in BLUEPRINT.md. The blueprint is considered final
and is now permanently locked for the rest of phase 1.

Gates: TS \u2713 | Lint \u2713 | Vitest 44/44 \u2713 | Build \u2713. Playwright
parity + snapshot gates deferred per the DEVIATIONS.md environmental-gate
skip.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 07:04:04 +00:00
Cursor Agent
f49d66daea
feat(ui): migrate access-groups to shadcn + lock phase 1 blueprint
Migrates Section 1 (Access Groups) from antd to shadcn/ui:

- AccessGroupsPage.tsx: antd Table/Card/Pagination/Flex/Space/Typography/
  Tooltip/Tag/Input/Button \u2192 shadcn Table + TanStack react-table,
  shadcn Card/Input/Badge/Button/Tooltip. Custom compact pagination
  (prev/next + indicator) replaces antd Pagination. PlusOutlined \u2192
  lucide Plus.
- AccessGroupsDetailsPage.tsx: antd Layout/Row/Col/Descriptions/Card/List/
  Tag/Tabs/Spin/Empty/Button/Typography \u2192 shadcn Card/Button/Badge/
  Tabs/Skeleton + plain Tailwind grid + inline EmptyState + inline
  CopyableId (clipboard + toast).
- AccessGroupsModal/AccessGroupBaseForm.tsx: antd Form/Form.Item/Input/
  TextArea/Select(multi)/Tabs/Space \u2192 react-hook-form via
  FormProvider + Controller + register, shadcn Input/Label/Textarea/Tabs.
  Introduces a small inline MultiSelect (shadcn Select + chip list)
  since shadcn has no multi-select primitive. Logged in DEVIATIONS.md.
- AccessGroupsModal/AccessGroupCreateModal.tsx,
  AccessGroupsModal/AccessGroupEditModal.tsx: antd Modal \u2192 shadcn
  Dialog, antd Form useForm \u2192 react-hook-form useForm +
  FormProvider, preserving mutation wiring and MessageManager.success
  calls.

Writes the full **phase-1 blueprint** to docs/BLUEPRINT.md:
- Component translation table (antd \u2192 shadcn) with import paths
- Icon translation table (@ant-design/icons / @heroicons / @remixicon
  \u2192 lucide-react)
- Toast pattern (sonner via MessageManager / NotificationManager)
- Form pattern (rhf + zod + shadcn Form) \u2014 simple and complex variants
- Table pattern (shadcn Table + @tanstack/react-table)
- Shared layout patterns (page header, section card, empty state,
  skeleton, error alert, permissions gate)
- Test-update checklist for migrated sections
- Per-file migration checklist

Commits a **phase-1 parity spec** at e2e_tests/parity/access-groups.spec.ts
(semantic selectors only; no .ant-btn). Spec not executed in this run;
see DEVIATIONS.md for gate-skip rationale (no proxy / dev-server auth in
sandbox). TS + Lint + Vitest + build gates all pass (46/46 AccessGroups
tests).

**Locks the blueprint.** Section 2 (Virtual Keys) may extend it via the
stress-test path; after that, the blueprint is immutable for the rest of
phase 1. Deviations are recorded in DEVIATIONS.md.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 06:58:44 +00:00
Cursor Agent
923dc440ac
docs(ui): add section migration recipe (5-layer gating, 7-cycle cap)
Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 06:49:38 +00:00
Cursor Agent
b9fc99b8c1
chore(ui): add Playwright parity project + snapshot defaults for phase-1 migration
- New 'parity' project in playwright.config.ts. testDir=./parity,
  testMatch=**/*.spec.ts, 1440x900 viewport locked for stable snapshots.
  Default baseURL=http://localhost:3000; overridable via PARITY_BASE_URL
  (e.g. set to http://localhost:4000 when the section needs the proxy).
- webServer auto-starts 'npm run dev' unless PARITY_BASE_URL is set.
- expect.toHaveScreenshot defaults: maxDiffPixelRatio=0.01,
  animations=disabled, caret=hide.
- e2e_tests/parity/README.md documents spec conventions, snapshot
  baselining, and the two auth strategies (route interception vs. proxy).
- chromium project now explicitly ignores parity/** so it keeps its
  existing scope (full proxy-backed e2e suite).

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 06:47:40 +00:00
Cursor Agent
03fadfa283
docs(ui): add BLUEPRINT, QUIRKS, blockers dir
Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 06:46:36 +00:00
Cursor Agent
e460b6eadc
docs(ui): scaffold phase-1 migration docs (BLUEPRINT, QUIRKS, DEVIATIONS, CYCLES, REPORT, blockers/)
Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 06:45:58 +00:00
Cursor Agent
2785e51948
chore(ui): add litellm-ui ESLint plugin (no-banned-ui-imports, no-raw-tailwind-colors)
Add a local ESLint plugin that enforces the phase-1 shadcn migration
constraints:

- **no-banned-ui-imports**: flags imports from antd, @ant-design/icons,
  @heroicons/react, @remixicon/react. Flags @tremor/react imports except
  in files under a /charts/ directory or whose basename contains 'chart'.
- **no-raw-tailwind-colors**: flags raw Tailwind color utilities such as
  bg-slate-500 / text-blue-600 inside className strings, className
  template literals, and string arguments to cn / clsx / twMerge / cva / cx.
  Semantic tokens (bg-primary, text-foreground, bg-muted, ...) are allowed.

Plugin lives at ./eslint-plugin-litellm-ui, installed as a "file:" dep
so it is picked up transparently by ESLint's plugin resolution.

Wire both rules into .eslintrc.json with an overrides block that exempts:
- shadcn primitives under src/components/ui/
- the notification/message manager bridges (still reference sonner)
- tailwind.config.ts (the palette intentionally uses raw color imports)
- test files and fixtures (out of phase-1 scope)

Replace the broken `next lint` script with a direct eslint invocation
(ESLINT_USE_FLAT_CONFIG=false to honor the legacy .eslintrc.json during
phase 1; migration to flat config is phase 2).

Initial sweep reports 921 banned-import violations and 3497 raw-color
violations in non-migrated code \u2014 expected, these will be resolved
section-by-section.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 06:45:21 +00:00
Cursor Agent
966d7e0cc2
chore(ui): wire sonner Toaster; delegate antd managers to sonner
- Rewrite MessageManager (message_manager.tsx) to delegate to toast.* from
  sonner. Public API preserved (success/error/warning/info/loading/destroy).
  setMessageInstance() is now a no-op back-compat shim.
- Rewrite NotificationManager (notifications_manager.tsx) to delegate to
  sonner. Same classification logic (titleFor/classifyGeneralMessage) and
  same public API (error/warning/info/success/fromBackend/clear) preserved.
  setNotificationInstance() is now a no-op back-compat shim.
- antd duration (seconds) \u2192 sonner duration (ms) conversion at each call site.
- Gut AntdGlobalProvider to a children passthrough (antd message/notification
  provider is no longer needed). Will be deleted in the final cleanup task
  after antd is uninstalled.
- Add <Toaster richColors position="top-right" /> to the root layout.
- Rewrite message_manager and notifications_manager unit tests to mock
  sonner's toast.* rather than antd.message/notification. Use vi.unmock in
  notifications_manager test to bypass the global setupTests.ts mock.
- Fix stale antd.message.error assertion in AddFallbacks.test.tsx: mock
  @/components/molecules/message_manager directly so the assertion is
  agnostic to the underlying toast library.

Build and targeted vitest suites pass. Full vitest suite: 3801/3801 pass
after these fixes (2 pre-existing failures were caused by the migration
and are now fixed via the updated AddFallbacks test mock).

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 06:41:22 +00:00
Cursor Agent
a507e5514a
chore(ui): pre-seed shadcn primitives in src/components/ui
Installs the full set of primitives needed for the phase-1 migration:
accordion, alert, alert-dialog, avatar, badge, breadcrumb, button, calendar,
card, checkbox, collapsible, command, context-menu, dialog, dropdown-menu,
form, hover-card, input, label, menubar, navigation-menu, popover, progress,
radio-group, scroll-area, select, separator, sheet, skeleton, slider, sonner,
switch, table, tabs, textarea, toggle, toggle-group, tooltip.

Pulls in @radix-ui/* transitive dependencies. Existing files in src/components/ui/
(ui-loading-spinner, AntDLoadingSpinner) are preserved unchanged.

Build verified clean via `npm run build`. Pre-existing tsc errors in
test files are unaffected.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 06:17:33 +00:00
Cursor Agent
a6f07c49a5
chore(ui): init shadcn, consolidate tailwind config, install form/toast deps
- Write components.json (style: default, base: slate, tailwind config: .ts)
- Create src/lib/utils.ts with canonical cn() helper
- Consolidate tailwind.config.{js,ts} onto .ts; preserve per-deployment brand
  color loading from ui_colors.json with fallback to indigo
- Add shadcn semantic tokens (primary/secondary/muted/...) backed by CSS vars
- Keep legacy tremor palette for charts-only usage
- Compact density: --radius 0.375rem, new compact-1..compact-4 spacing tokens
- Wire tailwindcss-animate plugin for shadcn radix primitives
- Add light+dark :root / .dark CSS variable blocks in globals.css
- Install: clsx, class-variance-authority, tailwindcss-animate, react-hook-form,
  zod, @hookform/resolvers, sonner
- Capture baseline bundle size for phase-1 delta reporting

Part of the shadcn phase-1 UI migration. See docs/superpowers/ spec.

Co-authored-by: yuneng-jiang <yuneng-berri@users.noreply.github.com>
2026-04-23 06:13:29 +00:00
Sameer Kankute
63ba912b47
Merge pull request #26160 from BerriAI/litellm_vertex_image_edit_credentials_fix
fix(image_edit): forward litellm_params to validate_environment for Vertex AI credentials
2026-04-23 08:36:01 +05:30
yuneng-jiang
6a25866f51
Merge pull request #26295 from BerriAI/yj_bump_apr22
Some checks are pending
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (proxy-utils, tests/proxy_unit_tests/test_proxy_utils.py, 20, 8) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py --ignore=tests/proxy_unit_tests/test_p… (push) Waiting to run
Unit Tests: Security / security (push) Waiting to run
[Infra] bump versions
2026-04-22 18:33:03 -07:00
yuneng-jiang
8bc6948a5e
Merge pull request #26290 from BerriAI/litellm_/bold-goldstine-b86b67
[Fix] Stabilize spend accuracy test transport flakes
2026-04-22 18:30:10 -07:00
Yuneng Jiang
95fa7678af
uv lock 2026-04-22 18:25:37 -07:00
Yuneng Jiang
9f46d838fd
bump: version 1.83.11 → 1.83.12 2026-04-22 18:21:47 -07:00
Yuneng Jiang
3ddb3cbdf6
bump: version 0.4.67 → 0.4.68 2026-04-22 18:20:21 -07:00
ryan-crabbe-berri
c4c1861389
Merge pull request #26195 from BerriAI/litellm_team_member_total_spend
Track per-member total spend on team memberships
2026-04-22 18:20:16 -07:00
michelligabriele
c67d193400
fix(docker.non_root): use numeric UID 65534 for K8s runAsNonRoot (#26268) 2026-04-22 18:00:04 -07:00
Yuneng Jiang
a292845dcf
[Fix] Harden spend accuracy test against transient aiohttp connection 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.
2026-04-22 17:40:42 -07:00
yuneng-jiang
fb39683521
Merge pull request #25772 from BerriAI/litellm_wildcard_order_fallback
fix(router): wildcard order fallback to higher-order deployments
2026-04-22 15:05:14 -07:00
shin-berri
b6fdd46636
Merge pull request #26270 from BerriAI/litellm_/lucid-kowalevski-de832f
[Fix] Stabilize flaky spend accuracy tests + patch Redis buffer data-loss path
2026-04-22 15:02:24 -07:00
shin-berri
8340f6fc47
Merge pull request #26261 from BerriAI/litellm_code_quality_to_gha
[Infra] Migrate more CI jobs from CircleCI to GitHub Actions
2026-04-22 14:37:25 -07:00
yuneng-jiang
41145e2205
Merge pull request #26266 from BerriAI/litellm_bedrock_guardrail_spend_logging_reapply
fix(proxy): Bedrock guardrail spend logs - hook mode, match redaction, streaming request_data
2026-04-22 14:32:10 -07:00
Yuneng Jiang
3f42295d93
[Fix] Satisfy mypy on spend buffer restore helper
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.
2026-04-22 14:31:25 -07:00
Milan
3df9780c02
fix(core_helpers): make redact_nested_match_and_regex_keys iterative
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
2026-04-23 00:12:30 +03:00
Yuneng Jiang
288d403529
[Fix] Preserve in-memory spend updates when Redis rpush fails
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.
2026-04-22 14:10:40 -07:00
Yuneng Jiang
5445297da9
[Fix] Stabilize flaky spend accuracy tests with local ground truth
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.
2026-04-22 13:45:00 -07:00
Yuneng Jiang
1b74c35b89
[Infra] Move non-API-key CCI jobs to GitHub Actions
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.
2026-04-22 13:38:00 -07:00
Milan
9577d87158
fix(proxy): guardrail header dedupe, mypy during_call, test mock kwargs
- 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
2026-04-22 23:22:35 +03:00
Milan
ec735074a2
fix(proxy): reapply Bedrock guardrail spend logging (#25854)
Restore guardrail spend/UI event_type wiring, request_data on streaming
OUTPUT paths, and centralized match redaction after the upstream revert.

Made-with: Cursor
2026-04-22 23:00:45 +03:00
shin-berri
c95cac5d46
Merge pull request #26226 from BerriAI/litellm_/stoic-shamir-0ab13f
[Infra] CircleCI config cleanup and consolidation
2026-04-22 12:06:59 -07:00
yuneng-jiang
fc4fe34512
Merge pull request #26201 from BerriAI/litellm_prismaCacheRuntime
[Fix] Docker: restore pre-uv Prisma cache path
2026-04-22 11:33:27 -07:00
Sameer Kankute
221dc2fb48
Merge pull request #26258 from BerriAI/litellm_internal_staging
Some checks failed
Unit Tests: Security / security (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (proxy-utils, tests/proxy_unit_tests/test_proxy_utils.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py --ignore=tests/proxy_unit_tests/test_p… (push) Has been cancelled
merge main
2026-04-22 21:39:51 +05:30
yuneng-jiang
24aec61e4b
Merge pull request #26049 from BerriAI/litellm_adaptive_routing
Litellm adaptive routing
2026-04-22 08:52:51 -07:00
Yuneng Jiang
61fd4e985e
[Infra] CCI config cleanup — dead step, filter dupe, cache keys, machine 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.
2026-04-21 23:31:01 -07:00
Yuneng Jiang
0a65d2c535
[Infra] Standardize default Python to 3.12 and remove miniconda setup
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.
2026-04-21 23:19:21 -07:00
Yuneng Jiang
344be27e83
[Refactor] Add start_postgres reusable command and migrate call sites
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.
2026-04-21 23:14:46 -07:00
Yuneng Jiang
f490340a52
[Refactor] Add install_uv reusable command and migrate all call sites
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.
2026-04-21 23:13:42 -07:00
Yuneng Jiang
439bbd223b
[Infra] Clean up unused CCI jobs and pin docker images by digest
- Remove mypy_linting job (GHA test-linting.yml already runs this)
- Remove three redundant "Install curl" apt-get steps (curl is
  already present on the ubuntu-2204 machine image and used
  successfully earlier in each affected job)
- Dedupe langfuse_logging_unit_tests filter block (6x copy of the
  same two branch filters collapsed to 1)
- Pin all docker image references by @sha256 digest so builds stay
  reproducible when upstream tags are updated:
  cimg/python:3.9, 3.11, 3.12, 3.12-browsers, 3.13.1, cimg/node:20.19,
  cimg/postgres:16.0, and postgres:14 used via docker run

Net: -62 lines, 49 image references pinned.
2026-04-21 23:09:41 -07:00
ishaan-berri
0e42d4cb08
April 21st Ishaan Branch (#26213)
* fix(otel): preserve Splunk Observability Cloud trace OTLP endpoint (#26183)

* fix(otel): preserve Splunk Observability Cloud trace OTLP URL

Splunk ingest uses /v2/trace/otlp; _normalize_otel_endpoint must not append /v1/traces.

- Return trace endpoints unchanged when they match Splunk OTLP path patterns
- Add unit tests for observability.splunkcloud.com, signalfx.com, and /trace/otlp suffix
- Set OTEL_EXPORTER_OTLP_PROTOCOL in protocol selection tests (from_env precedence over OTEL_EXPORTER)

Made-with: Cursor

* test(otel): use parameterized.expand for Splunk OTLP URL cases

Made-with: Cursor

* fix(otel): narrow Splunk trace URL guard to /v2/trace/otlp only

Made-with: Cursor

* test(otel): cover OTEL_EXPORTER fallback when OTLP protocol env unset

Made-with: Cursor

* Add Openrouter Opus 4.7 Entry (#26130)

---------

Co-authored-by: milan-berri <milan@berri.ai>
Co-authored-by: Matt Greathouse <matt5316@gmail.com>
2026-04-21 20:18:56 -07:00
ishaan-berri
e6897f5510
add moonshot/kimi-k2.6 to model registry (#26203)
* add moonshot/kimi-k2.6 to model registry

* add moonshot/kimi-k2.6 to backup model registry

* add tests for moonshot/kimi-k2.6 model registry

* fix moonshot/kimi-k2.6 pricing and add reasoning support

* fix moonshot/kimi-k2.6 pricing and add reasoning support in backup

* update kimi-k2.6 tests: fix pricing, add tool_choice and reasoning checks

* fix: load kimi-k2.6 registry tests from local backup instead of remote cost map
2026-04-21 19:58:43 -07:00
shin-berri
09cd7e383e
Merge pull request #26211 from BerriAI/litellm_internal_staging
Some checks failed
Read Version from pyproject.toml / read-version (push) Has been cancelled
Unit Tests: Security / security (push) Has been cancelled
GitHub Actions Security Analysis / zizmor (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
CodSpeed Benchmarks / benchmarks (push) Has been cancelled
Helm unit test / unit-test (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (proxy-utils, tests/proxy_unit_tests/test_proxy_utils.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py --ignore=tests/proxy_unit_tests/test_p… (push) Has been cancelled
[Infra] Promote internal staging to main
2026-04-21 18:57:59 -07:00
yuneng-jiang
eebb80fbef
Merge pull request #26208 from BerriAI/litellm_individual-team-member-budgets
Some checks are pending
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (proxy-utils, tests/proxy_unit_tests/test_proxy_utils.py, 20, 8) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py --ignore=tests/proxy_unit_tests/test_p… (push) Waiting to run
Unit Tests: Security / security (push) Waiting to run
Litellm individual team member budgets
2026-04-21 18:38:00 -07:00