Commit graph

33297 commits

Author SHA1 Message Date
Yuneng Jiang
3eed4e21b2
chore: fixes 2026-04-04 23:23:55 -07:00
Cursor Agent
33cceafa54 fix: address remaining policy engine reliability issues
1. Fix race condition in update_version_status promote-to-production:
   - Wrap demote (update_many) + promote (update) in a Prisma transaction
   - Prevents concurrent promote calls from leaving two versions as production

2. Fix stale _policies_by_id cache in delete methods:
   - delete_policy_from_db: remove entry from _policies_by_id when deleting
     a draft/published version
   - delete_all_versions: scan and remove all _policies_by_id entries
     matching the deleted policy_name

3. Fix docstring for update_version_status:
   - Remove documented-but-unimplemented 'production -> published' transition
   - Clarify which transitions are valid vs invalid

4. Add tests for new behavior:
   - test_published_to_production_removes_from_policies_by_id
   - test_delete_draft_removes_from_policies_by_id_cache
   - test_delete_all_versions_cleans_policies_by_id_cache
   - Update existing promote-to-production tests to mock transaction

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-02-22 03:58:23 +00:00
Cursor Agent
916abeb395 fix: address greptile code review issues on policy engine reliability
1. Fix stale _policies_by_id cache after status transitions:
   - Add _update_policies_by_id_cache() helper method
   - Update cache when draft->published transition occurs
   - Remove entry from cache when promoting to production (resolved by name)

2. Fix race condition in create_new_version:
   - Wrap find_first + update_many + create in a Prisma transaction
   - Prevents concurrent version number collisions and orphaned is_latest state

3. Validate version_status query parameter in list_policies:
   - Use Literal['draft', 'published', 'production'] type
   - Returns 422 for invalid values instead of silently returning empty results

4. Add Literal validation to PolicyVersionStatusUpdateRequest:
   - Change version_status field from str to Literal['published', 'production']
   - Validates at request parsing level rather than at runtime

5. Fix duplicate auth dependency in endpoints:
   - Remove decorator-level dependencies=[Depends(user_api_key_auth)] when
     the function parameter already uses Depends(user_api_key_auth)
   - Prevents auth check from running twice per request

6. Update tests to mock Prisma transaction context manager

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-02-22 03:38:26 +00:00
yuneng-jiang
d6bd917421
Merge pull request #21863 from BerriAI/litellm_yj_docs_feb21_release
[Docs] store_model_in_db Release Docs
2026-02-21 18:12:20 -08:00
yuneng-jiang
5bb52d0202 adding image 2026-02-21 18:09:18 -08:00
yuneng-jiang
ea37f59de4 Merge remote-tracking branch 'origin' into litellm_yj_docs_feb21_release 2026-02-21 18:05:11 -08:00
Ishaan Jaffer
84b572d719 docs 2026-02-21 18:00:38 -08:00
yuneng-jiang
cb4b638958 Merge branch 'doc_yj_feb21' of github.com:BerriAI/litellm into litellm_yj_docs_feb21 2026-02-21 17:58:44 -08:00
yuneng-jiang
5e26891da2 release note docs 2026-02-21 17:58:36 -08:00
Ishaan Jaffer
19f7e881f3 docs fix 2026-02-21 17:53:51 -08:00
Ishaan Jaffer
356eb5a413 docs fix 2026-02-21 17:51:45 -08:00
Ishaan Jaffer
522954fe0d docs fix 2026-02-21 17:47:44 -08:00
Ishaan Jaffer
45bef9ade8 docs fix 2026-02-21 17:46:01 -08:00
Ishaan Jaffer
5e71f6128b docs fix 2026-02-21 17:40:39 -08:00
Ishaan Jaffer
e157f5a8f2 docs fix 2026-02-21 17:35:16 -08:00
Ishaan Jaffer
661c6faac6 docs fix 2026-02-21 17:28:04 -08:00
Ishaan Jaffer
efebd37183 docs fix 2026-02-21 17:28:04 -08:00
yuneng-jiang
6228148963
Merge pull request #21857 from BerriAI/litellm_yj_docs_feb21
[Doc] Server Root Path Regression Incident Doc#21853
2026-02-21 17:26:43 -08:00
yuneng-jiang
386a8fbd5b
Merge branch 'main' into litellm_yj_docs_feb21 2026-02-21 17:21:35 -08:00
Ishaan Jaffer
7e567a5352 ui new build 2026-02-21 17:16:10 -08:00
Ishaan Jaffer
67a64266ef fix rendering 2026-02-21 17:15:18 -08:00
yuneng-jiang
823bb023df
Merge branch 'main' into litellm_yj_docs_feb21 2026-02-21 17:12:28 -08:00
Ishaan Jaffer
44f69038de UI new build 2026-02-21 17:00:45 -08:00
Ishaan Jaffer
52294029a0 test_vertex_ai_gemini_2_5_pro_streaming 2026-02-21 16:59:22 -08:00
Ishaan Jaffer
2270a3aaf3 Revert "Merge pull request #21140 from BerriAI/litellm_perf_user_api_key_auth"
This reverts commit 0e1db3f7e4, reversing
changes made to 7e2d6f2355.
2026-02-21 16:57:42 -08:00
milan-berri
5390469c1b
fix: replace Zapier webhook with Google Form for survey submission (#21621)
* Replace Zapier webhook with Google Form for survey submission

* Add back error logging for survey submission debugging

---------

Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
2026-02-21 16:55:59 -08:00
Ishaan Jaffer
ab032c292c docs fix 2026-02-21 16:36:22 -08:00
yuneng-jiang
a3238a4563
Merge branch 'main' into doc_yj_feb21 2026-02-21 16:35:28 -08:00
ryan-crabbe
0e1db3f7e4
Merge pull request #21140 from BerriAI/litellm_perf_user_api_key_auth
perf: optimize user_api_key_auth
2026-02-21 16:23:54 -08:00
yuneng-jiang
79a55ff164
Merge branch 'main' into doc_yj_feb21 2026-02-21 16:06:15 -08:00
ryan-crabbe
ce22524ac5
Merge branch 'main' into litellm_perf_user_api_key_auth 2026-02-21 16:05:33 -08:00
yuneng-jiang
241141d70b Merge branch 'doc_yj_feb21' of github.com:BerriAI/litellm into doc_yj_feb21 2026-02-21 16:05:27 -08:00
yuneng-jiang
aefc7c14f6 Merge remote-tracking branch 'origin' into doc_yj_feb21 2026-02-21 16:05:07 -08:00
Ishaan Jaffer
7e2d6f2355 ui fix 2026-02-21 16:05:03 -08:00
yuneng-jiang
70fd2aa219 fixing syntax 2026-02-21 16:04:42 -08:00
Ryan Crabbe
643c9b6c04 Merge remote-tracking branch 'origin/main' into litellm_perf_user_api_key_auth 2026-02-21 16:03:31 -08:00
yuneng-jiang
2e8d942d17
Merge branch 'main' into doc_yj_feb21 2026-02-21 16:00:46 -08:00
yuneng-jiang
153bf1d856 server root path regression doc 2026-02-21 15:57:06 -08:00
Ishaan Jaffer
d31d5b8486 fix failing tests 2026-02-21 15:48:26 -08:00
Ishaan Jaffer
775fb79260 fix 2026-02-21 15:45:03 -08:00
Ishaan Jaffer
26ea29afd3 test_get_usage_as_dict 2026-02-21 15:39:06 -08:00
Ishaan Jaffer
a58232ac5b fix prisma 2026-02-21 15:35:50 -08:00
Krish Dholakia
1f7eeb274c
Agent Builder - improve rejected response detection based on agent response (#21850)
* fix: feat: add litellm_system_prompt support

* feat: support new 'litellm_agent' model provider

* feat: ui/ - new agent builder ui

* fix(anthropic/chat/transformation.py): normalize max_tokens if decimal

* feat(agentbuilderview.tsx): run compliance datasets against litellm agent

* feat: new response rejection detector

* fix: multiple fixes

* feat: add mcp tools support to agent builder

create an agent with access to llm's + mcp servers
2026-02-21 15:34:42 -08:00
Krish Dholakia
9fc6fd647c
Agent Builder - support new experimental agent builder, to ensure agents pass compliance checks (#21817)
* fix: feat: add litellm_system_prompt support

* feat: support new 'litellm_agent' model provider

* feat: ui/ - new agent builder ui

* fix(anthropic/chat/transformation.py): normalize max_tokens if decimal

* feat(agentbuilderview.tsx): run compliance datasets against litellm agent
2026-02-21 15:32:47 -08:00
Ishaan Jaffer
2acc93e451 BUMP 2026-02-21 15:28:18 -08:00
Ishaan Jaff
bab4127cae
fix(tests): fix flaky test_use_prisma_db_push_flag_behavior (#21849)
Replace Click CliRunner with standalone_mode=False to avoid
"I/O operation on closed file" errors caused by Click's stream
isolation in CI environments.
2026-02-21 15:23:55 -08:00
Ishaan Jaff
f74a1c94df
test(router): add coverage tests for _is_complexity_router_deployment and init_complexity_router_deployment (#21848) 2026-02-21 15:21:10 -08:00
Ishaan Jaff
6dc9823926
docs(release-notes): update v1.81.14 - split guardrail sections, add eval results, fix key highlights and section placement (#21847) 2026-02-21 15:18:46 -08:00
Ryan Crabbe
c7ad8053b1 Merge origin/main into litellm_perf_user_api_key_auth
Resolve conflicts:
- pass_through_endpoints.py: take main's version, re-apply
  MAPPED_PASS_THROUGH_PREFIXES startswith(tuple) optimization
- test_user_api_key_auth.py: keep both auth optimization regression
  tests and JWT admin identity field tests
2026-02-21 15:14:20 -08:00
Ishaan Jaff
eac3ae8121
docs: update v1.81.14 release notes - guardrail model garden, complexity router placement (#21843)
* docs(release-notes): update v1.81.14 key highlights and section placement

* docs(release-notes): rewrite key highlights and add guardrail narrative section

* docs(release-notes): rewrite guardrail narrative to match release notes style

* docs(release-notes): add guardrail eval results section
2026-02-21 15:10:21 -08:00