Repository navigation
chore: sync LiteLLM fork to upstream main 1.82.6 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2752 commits
Select commit
Hold shift + click to select a range
3a878b8
Merge branch 'litellm_oss_staging_03_18_2026' into fix/proxy-only-fai…
379ed72
Merge pull request #24050 from alilxxey/fix/proxy-only-failure-call-type
5c93c10
Merge pull request #24043 from themavik/fix/24001-langsmith-usage-met…
08f0cbc
fix: address greptile feedback
11f0f06
Merge pull request #18120 from hytromo/improve-llm-repeated-message-d…
49443cc
Merge pull request #24080 from BerriAI/litellm_dev_03_18_2026_p1
df38fbc
docs: add Contributing to Guardrails section to Guardrail Providers s…
cursoragent 547a731
Merge pull request #24083 from BerriAI/cursor/missing-guardrails-docs…
e5baa22
Merge pull request #24082 from joereyna/fix/poetry-lock-content-hash
cac6850
feat: add proxy-wide default tpm/rpm limits per deployment
ephrimstanley bba3b1f
docs(release-notes): add missing Helicone and Langfuse entries to v1.…
joereyna 36dc893
fix: address review feedback on default tpm/rpm limits
ephrimstanley b90f520
perf: eliminate redundant router lookups in v1 parallel request limiter
ephrimstanley dab8721
chore: apply black formatting to fix lint CI
joereyna 48cb4a8
fix: update success-event handler to track tokens for deployment-defa…
ephrimstanley 477c541
perf: avoid unconditional router lookups in success handler
ephrimstanley 61df747
docs(release-notes): complete v1.82.3 changelog with 30+ missing feat…
joereyna d5ef754
docs(release-notes): align v1.82.3 notes with release notes guide
joereyna b20c448
fix(openai): handle missing 'id' field in streaming chunks for MiniMa…
chengyongru e19a717
Add IF NOT EXISTS to index creation in migration
superpoussin22 4dc645f
feat(polling): check rate limits before creating polling ID
Sameerlite c12717f
fix: address Greptile review comments
Sameerlite 66f97a0
fix(test): rewrite polling pre-call guard test to call responses_api(…
Sameerlite 528daa8
feat(router): add per-model-group deployment affinity configuration
Sameerlite 6af74f6
fix(router): restore debug log for missing deployment_model_name; war…
Sameerlite a14122c
docs: add per-model-group affinity configuration docs
Sameerlite e2e4f9e
Merge branch 'main' into litellm_oss_staging_03_17_2026
Sameerlite ecfcf24
Merge pull request #24119 from BerriAI/main
Sameerlite 532e0d1
feat(proxy): use AZURE_DEFAULT_API_VERSION for proxy --api_version de…
Sameerlite 067dab4
refactor: reduce statement count in langsmith and anthropic methods
Sameerlite b956483
Fix mypy errors
Sameerlite 1284e4e
Fix cicd fialing tests
Sameerlite 6146196
Fix tests
Sameerlite e562c1d
refactor: consolidate duplicate helpers and eliminate success-handler…
ephrimstanley ae0769b
fix: guard empty-dict team limits and malformed int in deployment def…
ephrimstanley 001501f
fix(proxy): defer logging until post-call guardrails complete
michelligabriele 1d7cff2
feat(ui): add click-to-copy icon on User ID in internal users table
ryan-crabbe 4b8c532
fix(proxy): pass guardrail_data to hooks in streaming deferred path
michelligabriele 0057452
fix(proxy): guard streaming deferred init with try/finally, fix test …
michelligabriele f415b72
feat(anthropic): support ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL …
devin-petersohn 81dadb6
Ishaan - March 18th changes (#24056)
ishaan-jaff b34231d
refactor(proxy): reuse unified_guardrail singleton, rename shadowing …
michelligabriele 6d0763b
fix: short-circuit websearch for non-Anthropic providers (github_copi…
johnib 0b07f62
[Test] UI: Add vitest coverage for 10 previously untested components
yuneng-jiang 41d9ecf
Address feedback
devin-petersohn b5a775d
style: fix Black formatting in test file
johnib 97e17fa
fix(proxy): guard lazy imports inside try, clean up orphaned streamin…
michelligabriele 3b12926
fix: use original_stream for short-circuit, propagate derived provider
johnib 141ad04
refactor: reuse get_last_user_message, fix UUID convention, move import
johnib ee17ef3
fix(proxy): replace sys.exc_info with boolean sentinel for orphan det…
michelligabriele b13ba1d
Merge pull request #24144 from BerriAI/litellm_add_vitest_coverage
yuneng-jiang 573f6b7
fix(proxy): split orphan cleanup into separate try blocks for resilience
michelligabriele 1f04fa2
fix(proxy): kill orphaned prisma engine subprocess on failed disconnect
michelligabriele afb3520
Merge remote-tracking branch 'origin' into litellm_yj_march_18_2026
yuneng-jiang 92b8e1a
address greptile review: async sleep, SIGKILL Windows guard, trailing…
michelligabriele b7e2269
Address review feedback: fix OAuth routing in get_auth_header and sel…
devin-petersohn dfcf978
Merge pull request #24092 from joereyna/fix/black-format-lint
yuneng-jiang c2b8ba8
[Fix] Resolve mypy errors in key_management_endpoints.py
yuneng-jiang f784da4
Fix get_complete_url to honour ANTHROPIC_BASE_URL in experimental pas…
devin-petersohn 004d8d0
chore: apply black formatting to fix lint CI
joereyna cf63697
[Fix] Update tests for _get_and_validate_existing_key refactor
yuneng-jiang 7393566
Merge pull request #24120 from BerriAI/litellm_proxy-azure-api-versio…
2df9655
Merge pull request #24153 from joereyna/fix/black-format-lint-2
joereyna 519afa4
[Refactor] UI - API Reference: Migrate to path-based routing
yuneng-jiang 8959517
Fix leftnav navigation regression and useProxySettings initial state
yuneng-jiang e9e5ed9
Move legacy redirect from render phase to useEffect
yuneng-jiang 2e70c23
Gate legacy redirect on authLoading to ensure proxyBaseUrl is resolved
yuneng-jiang e86ca7f
Revert "[Fix] Update tests for _get_and_validate_existing_key refactor"
yuneng-jiang d118bf4
chore: add poetry check --lock to lint CI to prevent stale lockfile m…
joereyna 3565059
Merge pull request #24155 from BerriAI/litellm_api_reference_path_rou…
yuneng-jiang 2d3cff9
Merge pull request #24159 from joereyna/fix/add-poetry-lock-check
yuneng-jiang 05620c8
[Fix] Update bulk key update tests for find_unique refactor
yuneng-jiang 32cb6f0
fix: guard short-circuit against providers with native agentic loop
johnib f60e3cf
remove returning key in error message
yuneng-jiang 7b600cd
linting
yuneng-jiang 0781f68
Merge pull request #24150 from BerriAI/litellm_yj_march_18_2026
yuneng-jiang 6f1bac0
chore: apply black formatting to proxy/_types.py to fix lint CI
joereyna 35d4984
Merge pull request #24167 from joereyna/fix/black-format-types
yuneng-jiang e668ca3
docs: add LiteLLM license key environment variable instructions
cursoragent b1731b6
Merge pull request #24168 from BerriAI/cursor/litellm-license-key-env…
d4857f6
Merge pull request #24135 from michelligabriele/fix/deferred-guardrai…
8d92d86
Merge branch 'main' into litellm_oss_staging_03_18_2026
482b77e
Merge pull request #24081 from BerriAI/litellm_oss_staging_03_18_2026
dddccc4
Merge pull request #24105 from superpoussin22/correct-migration
f3b1768
feat: add _assert_can_manage_team_mcp_server auth helper with tests
yuneng-jiang cc7e27e
feat: update MCP CRUD endpoints to support mcp_server_manager role
yuneng-jiang 971cc2a
fix: add team_id field to NewMCPServerRequest
yuneng-jiang f3c6915
feat: add useChatHistory hook with tests (extracted from ChatUI)
yuneng-jiang e88425b
refactor: wire ChatUI to use useChatHistory hook
yuneng-jiang 87b5039
chore: apply black formatting to fix lint CI (batch 3)
joereyna 75386d4
Merge pull request #24149 from michelligabriele/fix/kill-orphaned-pri…
d8b2814
Merge pull request #24173 from joereyna/fix/black-format-batch-3
2964785
Merge branch 'main' into fix/release-notes-v1-82-3-helicone-langfuse
2900e0e
Merge pull request #24090 from joereyna/fix/release-notes-v1-82-3-hel…
3a0652c
Merge branch 'main' into feat/anthropic-auth-token-and-base-url
61dde5e
Merge pull request #24143 from johnib/fix/websearch-short-circuit-cop…
48e9d0b
Merge pull request #24140 from devin-petersohn/feat/anthropic-auth-to…
3093ef8
fix: document new config_settings.md
e5dc912
bump: version 1.82.4 → 1.82.5
joereyna c545c96
Merge branch 'main' into litellm_oss_staging_03_17_2026
Sameerlite 954bfcb
chore: remove verbose console.log calls from useChatHistory hook
yuneng-jiang c6b5c07
chore: apply black formatting and enable black pre-commit hook
joereyna f34fe47
fix: stale closure, simplified session isolation, debounce-race in us…
yuneng-jiang ff6faac
fix: resolve mypy union-attr error in anthropic messages transformation
joereyna 6f6e23a
chore: apply black formatting to experimental_pass_through transforma…
joereyna 30589b0
Merge pull request #24187 from joereyna/fix/black-format-lint-cleanup
yuneng-jiang 32ada45
fix: upgrade mcp to 1.26.0
joereyna 784f943
Merge pull request #24188 from BerriAI/main
Sameerlite 883611a
[Feature] UI - Teams: Modernize teams table with AntD, server-side pa…
yuneng-jiang ad43a35
feat: add control plane for multi-proxy worker management
ryan-crabbe f4e5fb2
fix: exclude team_id from Prisma create payload in _prepare_mcp_serve…
yuneng-jiang 6c06e6d
fix: link new object_permission_id back to team on first MCP server c…
yuneng-jiang dfc4401
fix: use check_db_only=True in _assert_can_manage_team_mcp_server
yuneng-jiang e714104
fix: address Greptile review feedback
yuneng-jiang 65bfd44
address greptile review feedback (greploop iteration 2)
yuneng-jiang 34d954f
[Fix] UI: Migrate AntD message API to use context-based MessageManager
yuneng-jiang d7c419b
Merge pull request #24179 from joereyna/fix/upgrade-mcp-1.26.0
joereyna be2c679
fix: resolve recursion in OVHCloud get_supported_openai_params (#24118)
themavik f003c9c
Merge branch 'main' into litellm_oss_staging_03_17_2026
Sameerlite 9b519c4
Merge pull request #24192 from BerriAI/litellm_migrate_antd_message_t…
yuneng-jiang bdf2475
Merge pull request #24189 from BerriAI/litellm_teams_table_modernize
yuneng-jiang 8c396e5
Merge pull request #24172 from BerriAI/litellm_extract_useChatHistory…
yuneng-jiang bc4608e
fix(bedrock): respect api_base and aws_bedrock_runtime_endpoint in co…
stias 72902c3
Remove extra newline in common_utils.py
stias 009cbfa
Merge pull request #24088 from Point72/ephrimstanley/limits
Sameerlite 4088f2b
Merge branch 'main' into litellm_oss_staging_03_19_2026
Sameerlite ab8675d
Merge branch 'main' into litellm_oss_staging_03_05_2026
Sameerlite 2d02eaa
Merge pull request #23958 from Sameerlite/litellm_gpt-5.4_mini
Sameerlite 2634088
Merge branch 'litellm_dev_sameer_16_march_week' into litellm_file-sea…
Sameerlite ec7c94c
Add about managed ids in the doc
Sameerlite 4d06b1c
fix doc
Sameerlite aafe9da
Merge pull request #23999 from Sameerlite/litellm_feat_prompt_responses
Sameerlite 1104f92
Merge pull request #24009 from Sameerlite/litellm_vertex_paygo_tutorial
Sameerlite af036ef
Merge pull request #23969 from Sameerlite/litellm_file-search-emulate…
Sameerlite 7bf16b2
Merge pull request #24079 from Sameerlite/Sameerlite/passthrough-auth…
Sameerlite 8ad2068
Merge pull request #24106 from BerriAI/Sameerlite/pre-ratelimit-bg
Sameerlite 55d815b
Merge pull request #23854 from milan-berri/docs/encrypted-content-aff…
Sameerlite de21715
Merge pull request #24110 from BerriAI/Sameerlite/model-level-affinity
Sameerlite 8da3efd
Fix code qa and mypy lint issues
Sameerlite 9272483
Merge pull request #24015 from Sameerlite/litellm_fix_ensure_alternat…
Sameerlite eb73370
Update tests/litellm_utils_tests/test_bedrock_token_counter.py
stias d3afaf6
Update tests/litellm_utils_tests/test_bedrock_token_counter.py
stias b8c9bf7
refactor: extract _auto_assign and _remove helpers, use team_endpoint…
yuneng-jiang 523fbed
Merge pull request #24199 from stias/fix/bedrock-count-tokens-custom-…
1cd7a48
Add tests for edit and delete MCP server manager paths
yuneng-jiang f36a59d
fix(logging): merge hidden_params into metadata for streaming complet…
milan-berri 5372334
Merge branch 'main' into fix/streaming-metadata-hidden-params
milan-berri 330ef5e
docs: add Gemini/Vertex AI to prompt caching docs
589c6cd
fix(gemini-embeddings): convert task_type to camelCase taskType for G…
christopherbaer 8d843fd
Merge pull request #23957 from Sameerlite/litellm_vertex-cancel-batch
Sameerlite 0673c57
Merge pull request #23939 from Sameerlite/Sameerlite/azure-ai-annotat…
Sameerlite 2a69426
Fix mypy and code qa issues
Sameerlite 92e98a2
Fix test_aaamodel_prices_and_context_window_json_is_valid
Sameerlite 7c168ab
Fix gpt-5.4 using remote model cost map for tests
Sameerlite 8cb3a0f
Fix ruff PLR0915 error
Sameerlite 45f322c
Fix ruff PLR0915 error
Sameerlite e8ec9eb
Merge pull request #24220 from milan-berri/fix/streaming-metadata-hid…
714c1b8
docs(pricing): add official source links for Azure DeepSeek & Cohere …
Jayachander123 af7e2e6
Fix ruff PLR0915 error
Sameerlite 00dd984
fix(whisper): correct output_cost_per_second pricing and cost calcula…
gvioss 7813947
fix(moonshot): preserve reasoning_content on Pydantic Message objects…
BillionClaw a05824d
Fix code qa
Sameerlite d381b58
Merge branch 'main' into litellm_ryan_march_18
ryan-crabbe f884e4a
Merge branch 'main' into fix/team-member-budget-duration-on-create
yuneng-jiang 5927a77
Merge branch 'main' into fix/aggregated-activity-entity-breakdown
yuneng-jiang c6ffda9
Merge pull request #23484 from michelligabriele/fix/team-member-budge…
yuneng-jiang 700fd86
Fix importorskip guard and add LiteLLM_TeamTableCachedObj import
yuneng-jiang b36269e
Merge pull request #24171 from BerriAI/litellm_/awesome-dhawan
yuneng-jiang 3ea69c9
Merge remote-tracking branch 'origin' into litellm_yj_march_19_2026
yuneng-jiang 404c68c
Add missing team_member_budget_duration param to new_team docstring
yuneng-jiang 4d19855
Merge branch 'main' into litellm_/gifted-spence
yuneng-jiang 50f88c8
Merge pull request #24243 from BerriAI/litellm_/gifted-spence
yuneng-jiang 5d317c3
Merge remote-tracking branch 'origin' into litellm_yj_march_19_2026
yuneng-jiang ba4aae0
Fix outdated MCP server auth test for team MCP manager flow
yuneng-jiang 59b4a05
Merge branch 'main' into litellm_ryan_march_18
ryan-crabbe 6f81eb0
fix: apply Black formatting to ui_sso.py
ryan-crabbe 541863a
Merge branch 'litellm_ryan_march_18' of https://github.com/BerriAI/li…
ryan-crabbe 72c307d
Merge pull request #24217 from BerriAI/litellm_ryan_march_18
ryan-crabbe c9683c6
Revert "[Feature] Team MCP Server Manager Role"
yuneng-jiang 1fad0d5
Merge pull request #24255 from BerriAI/revert-24171-litellm_/awesome-…
yuneng-jiang 6862930
Revert test to match reverted team MCP manager feature
yuneng-jiang f0e0d98
fix(test): mock get_auth_header instead of get_api_key in anthropic f…
joereyna e678dde
Fix unreachable special MCP server name guard in add_mcp_server
yuneng-jiang e6e3085
Merge pull request #24258 from joereyna/fix/anthropic-file-content-te…
yuneng-jiang 1da02b6
Merge branch 'main' into litellm_audit_log_s3_export
ryan-crabbe 9c47d50
add startup messages
ryan-crabbe 2ca4fa6
Merge branch 'main' into litellm_yj_march_19_2026
yuneng-jiang d8e4fc4
Merge pull request #24260 from BerriAI/litellm_yj_march_19_2026
yuneng-jiang ae21527
fix black formatting
ryan-crabbe 4e32db2
Merge pull request #23167 from BerriAI/litellm_audit_log_s3_export
ryan-crabbe ead607a
Merge pull request #24072 from Chesars/fix/strict-additional-properti…
Chesars 29ab11a
fix(types): add CacheControlToolConfigInjectionPoint to union type
Chesars a4f091c
Merge pull request #24073 from Chesars/feat/gemini-context-circulation
Chesars a3095f4
Merge pull request #24076 from Chesars/feat/cache-control-tool-config…
Chesars 8766004
fix(ui): use useTags hook so tag dropdown populates on key creation
ryan-crabbe e1d2ab3
test(ui): add unit test for tags dropdown populated via useTags hook
ryan-crabbe c1e90ed
Fix mypy errors
Sameerlite 5b5c998
Merge branch 'main' into litellm_oss_staging_03_19_2026
Sameerlite 676a79e
bump: litellm-enterprise 0.1.34 → 0.1.35
Sameerlite 6830b63
Revert "fix(whisper): correct output_cost_per_second pricing and cost…
Sameerlite 8d3445f
Merge pull request #24297 from BerriAI/revert-23842-fix/deepgram-cost…
Sameerlite 00ee80e
Merge branch 'main' into litellm_oss_staging_03_05_2026
Sameerlite c68a8aa
Merge pull request #24273 from BerriAI/litellm_fix-create-key-tags-dr…
ryan-crabbe a427807
Merge branch 'main' into litellm_dev_sameer_16_march_week
Sameerlite 49abf98
Merge branch 'main' into litellm_oss_staging_03_17_2026
Sameerlite ea02c7c
Merge pull request #24174 from BerriAI/litellm_oss_staging_03_19_2026
c8a7d5d
Merge branch 'main' into docs/prompt-caching-gemini-support
b64b0d4
Merge pull request #24222 from BerriAI/docs/prompt-caching-gemini-sup…
c350d08
Merge branch 'main' into litellm_oss_staging_03_05_2026
a5b7e49
Merge branch 'main' into litellm_oss_staging_03_17_2026
509d2e9
Fix PR review issues: gpt-4-0314 prompt caching, case-insensitive dat…
0091d04
fix: make reasoning summary opt-in, fix missing injection path, narro…
031b3d8
fix: add key-name-based secret redaction to catch secrets in config d…
ryan-crabbe 4f1e484
Merge branch 'main' into litellm_dev_sameer_16_march_week
Sameerlite ad8c321
fix(proxy): use union-attr mypy ignores for deferred logging hooks
Sameerlite 41b1c44
Merge pull request #24305 from BerriAI/litellm_fix_secret_redaction_g…
ryan-crabbe b21948f
Merge pull request #24315 from BerriAI/litellm_copy_user_id_on_click
ryan-crabbe 7738710
Remove required asterisks from v3 login form fields
ryan-crabbe d2a0f79
Merge pull request #24318 from BerriAI/litellm_login_remove_asterisks
ryan-crabbe 2ea9e20
Litellm ishaan march 20 (#24303)
ishaan-jaff f41156a
Merge branch 'main' into litellm_oss_staging_03_05_2026
yuneng-jiang 262534a
Merge branch 'main' into litellm_dev_sameer_16_march_week
yuneng-jiang 35316e1
fix: apply Black formatting to 7 files
yuneng-jiang cb40275
fix: add explicit "summary" not in result guards to opt-out test paths
f911d8d
Merge pull request #23818 from BerriAI/litellm_oss_staging_03_17_2026
10b0139
Merge branch 'main' into litellm_oss_staging_03_05_2026
yuneng-jiang 2b889f1
Merge pull request #23471 from michelligabriele/fix/aggregated-activi…
yuneng-jiang e3b62c0
fix: apply Black formatting to 6 files after main merge
yuneng-jiang c6bb7a5
Apply Black formatting to 11 files
yuneng-jiang 9b90e80
fix: resolve mypy type errors in audit_logs.py
ryan-crabbe 7b31ea4
Merge pull request #22844 from BerriAI/litellm_oss_staging_03_05_2026
yuneng-jiang 72fba09
Merge remote-tracking branch 'origin/main' into litellm_dev_sameer_16…
yuneng-jiang 1986f10
Merge pull request #24211 from BerriAI/litellm_dev_sameer_16_march_week
yuneng-jiang f494ab5
docs: add High Availability Control Plane documentation
ryan-crabbe 3e27ff1
fix: resolve mypy type errors in audit_logs.py
ryan-crabbe e3d4c29
Merge pull request #24323 from BerriAI/litellm_ryan_march_20
yuneng-jiang d217e49
chore: update Next.js build artifacts (2026-03-22 01:02 UTC, node v22…
yuneng-jiang f5194b5
Merge pull request #24334 from BerriAI/litellm_yj_march_21_2026
yuneng-jiang 9963b31
Revert "fix(proxy): restore per-entity breakdown in aggregated daily …
yuneng-jiang aea8e32
[Fix] UI: Team table refresh, infinite team dropdown, leftnav for das…
yuneng-jiang 9073dae
[Fix] UI - TeamDropdown: Match org dropdown styling and fix test mock
yuneng-jiang 34d0799
chore: update Next.js build artifacts (2026-03-22 05:53 UTC, node v22…
yuneng-jiang 88a4c7a
bump: version 0.4.58 → 0.4.59
yuneng-jiang 071c864
bump: version 0.4.59 → 0.4.60
yuneng-jiang d91980d
adding build
yuneng-jiang fa65433
bump: version 1.82.5 → 1.82.6
yuneng-jiang 6bb0888
adding poetry lock
yuneng-jiang 38d4775
remove outdated e2e test
yuneng-jiang c89496f
Merge pull request #24342 from BerriAI/litellm_yj_march_21_2026
yuneng-jiang 97679ac
style: format audit log helper with black
nieta-zjj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: "LiteLLM CodeQL config" | ||
|
|
||
| # Use security-extended suite instead of security-and-quality to avoid | ||
| # result sets > 2 GiB on this codebase that cause fatal OOM failures. | ||
| queries: | ||
| - uses: security-extended | ||
|
|
||
| # These two queries are security queries included in security-extended that | ||
| # individually produce result sets > 2 GiB on this codebase, causing fatal | ||
| # OOM failures. Exclude them as a safety net until CI confirms they no longer | ||
| # OOM; drop these exclusions in a follow-up once verified. | ||
| query-filters: | ||
| - exclude: | ||
| id: py/clear-text-logging-sensitive-data # CWE-312 — > 2 GiB result set | ||
| - exclude: | ||
| id: py/polynomial-redos # CWE-730 — > 2 GiB result set | ||
|
|
||
| paths-ignore: | ||
| - tests | ||
| - docs | ||
| - "**/*.md" | ||
| - litellm/proxy/_experimental/out |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # LiteLLM Observatory Test Configuration | ||
| # This config is used by CI to spin up a temporary LiteLLM instance | ||
| # for running observatory tests against RC/stable releases. | ||
| # | ||
| # Add model definitions for the providers you want to test. | ||
| # Provider API keys are injected via environment variables in CI. | ||
|
|
||
| model_list: | ||
| - model_name: gpt-4o | ||
| litellm_params: | ||
| model: azure/gpt-4o | ||
| api_key: os.environ/AZURE_API_KEY | ||
| api_base: os.environ/AZURE_API_BASE | ||
|
|
||
| - model_name: gpt-4o-mini | ||
| litellm_params: | ||
| model: azure/gpt-4o-mini | ||
| api_key: os.environ/AZURE_API_KEY | ||
| api_base: os.environ/AZURE_API_BASE |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,208 @@ | ||
| #!/usr/bin/env python3 | ||
| """ | ||
| Detect and close duplicate GitHub issues using title similarity. | ||
|
|
||
| Modes: | ||
| --scan Compare all open issues against each other (batch) | ||
| --issue-number N Check a single issue against older open issues | ||
|
|
||
| Requires the `gh` CLI to be authenticated. | ||
| """ | ||
|
|
||
| import argparse | ||
| import difflib | ||
| import json | ||
| import re | ||
| import subprocess | ||
| import sys | ||
|
|
||
|
|
||
| def normalize_title(title: str) -> str: | ||
| """Strip common prefixes, lowercase, and collapse whitespace.""" | ||
| title = re.sub( | ||
| r"^\[?(bug|feature request|enhancement|question|docs)[:\]]?\s*", | ||
| "", | ||
| title, | ||
| flags=re.IGNORECASE, | ||
| ) | ||
| return " ".join(title.lower().split()) | ||
|
|
||
|
|
||
| def gh(*args: str) -> str: | ||
| """Run a gh CLI command and return stdout.""" | ||
| result = subprocess.run( | ||
| ["gh", *args], | ||
| capture_output=True, | ||
| text=True, | ||
| check=True, | ||
| ) | ||
| return result.stdout | ||
|
|
||
|
|
||
| def fetch_open_issues(repo: str | None) -> list[dict]: | ||
| """Fetch all open issues (excluding PRs) via gh api --paginate.""" | ||
| if repo: | ||
| endpoint = f"repos/{repo}/issues?state=open&per_page=100&sort=created&direction=asc" | ||
| else: | ||
| endpoint = "repos/{owner}/{repo}/issues?state=open&per_page=100&sort=created&direction=asc" | ||
| cmd = ["api", "--paginate", endpoint] | ||
|
|
||
| raw = gh(*cmd) | ||
| # gh --paginate concatenates JSON arrays, so we may get multiple arrays | ||
| issues = [] | ||
| for line in raw.strip().splitlines(): | ||
| line = line.strip() | ||
| if not line: | ||
| continue | ||
| parsed = json.loads(line) | ||
| if isinstance(parsed, list): | ||
| issues.extend(parsed) | ||
| else: | ||
| issues.append(parsed) | ||
|
|
||
| # Filter out pull requests (they also appear in the issues endpoint) | ||
| return [i for i in issues if "pull_request" not in i] | ||
|
|
||
|
|
||
| def close_as_duplicate( | ||
| issue_number: int, duplicate_of: int, repo: str | None, dry_run: bool | ||
| ) -> None: | ||
| """Close an issue as duplicate of another, adding a comment and label.""" | ||
| repo_args = ["--repo", repo] if repo else [] | ||
|
|
||
| if dry_run: | ||
| print(f" [DRY RUN] Would close #{issue_number} as duplicate of #{duplicate_of}") | ||
| return | ||
|
|
||
| # Add comment | ||
| comment_body = ( | ||
| f"Closing as duplicate of #{duplicate_of}.\n\n" | ||
| "If you believe this is not a duplicate, please reopen and add context " | ||
| "explaining how this differs." | ||
| ) | ||
| gh("issue", "comment", str(issue_number), "--body", comment_body, *repo_args) | ||
|
|
||
| # Add label | ||
| gh("issue", "edit", str(issue_number), "--add-label", "duplicate", *repo_args) | ||
|
|
||
| # Close with not_planned reason | ||
| gh( | ||
| "api", | ||
| f"repos/{repo or '{owner}/{repo}'}/issues/{issue_number}", | ||
| "-X", | ||
| "PATCH", | ||
| "-f", | ||
| "state=closed", | ||
| "-f", | ||
| "state_reason=not_planned", | ||
| ) | ||
|
|
||
| print(f" Closed #{issue_number} as duplicate of #{duplicate_of}") | ||
|
|
||
|
|
||
| def find_duplicate( | ||
| issue: dict, candidates: list[dict], threshold: float | ||
| ) -> dict | None: | ||
| """Return the first candidate whose normalized title is above threshold.""" | ||
| norm = normalize_title(issue["title"]) | ||
| for candidate in candidates: | ||
| if candidate["number"] == issue["number"]: | ||
| continue | ||
| cand_norm = normalize_title(candidate["title"]) | ||
| ratio = difflib.SequenceMatcher(None, norm, cand_norm).ratio() | ||
| if ratio >= threshold: | ||
| return candidate | ||
| return None | ||
|
|
||
|
|
||
| def scan_all(issues: list[dict], threshold: float, repo: str | None, dry_run: bool) -> int: | ||
| """Compare every issue against all older issues. Returns count of duplicates found.""" | ||
| # Sort oldest first | ||
| issues.sort(key=lambda i: i["number"]) | ||
| closed_count = 0 | ||
|
|
||
| for idx, issue in enumerate(issues): | ||
| older = issues[:idx] | ||
| if not older: | ||
| continue | ||
| dup = find_duplicate(issue, older, threshold) | ||
| if dup: | ||
| ratio = difflib.SequenceMatcher( | ||
| None, | ||
| normalize_title(issue["title"]), | ||
| normalize_title(dup["title"]), | ||
| ).ratio() | ||
| print( | ||
| f"#{issue['number']}: \"{issue['title']}\"\n" | ||
| f" -> duplicate of #{dup['number']}: \"{dup['title']}\" " | ||
| f"({ratio:.0%} similar)" | ||
| ) | ||
| close_as_duplicate(issue["number"], dup["number"], repo, dry_run) | ||
| closed_count += 1 | ||
|
|
||
| return closed_count | ||
|
|
||
|
|
||
| def check_single( | ||
| issue_number: int, issues: list[dict], threshold: float, repo: str | None, dry_run: bool | ||
| ) -> bool: | ||
| """Check a single issue against all older open issues. Returns True if duplicate found.""" | ||
| target = None | ||
| for i in issues: | ||
| if i["number"] == issue_number: | ||
| target = i | ||
| break | ||
|
|
||
| if target is None: | ||
| print(f"Issue #{issue_number} not found among open issues.") | ||
| return False | ||
|
|
||
| older = [i for i in issues if i["number"] < issue_number] | ||
| dup = find_duplicate(target, older, threshold) | ||
| if dup: | ||
| ratio = difflib.SequenceMatcher( | ||
| None, | ||
| normalize_title(target["title"]), | ||
| normalize_title(dup["title"]), | ||
| ).ratio() | ||
| print( | ||
| f"#{target['number']}: \"{target['title']}\"\n" | ||
| f" -> duplicate of #{dup['number']}: \"{dup['title']}\" " | ||
| f"({ratio:.0%} similar)" | ||
| ) | ||
| close_as_duplicate(issue_number, dup["number"], repo, dry_run) | ||
| return True | ||
|
|
||
| print(f"#{issue_number}: no duplicate found above threshold {threshold}") | ||
| return False | ||
|
|
||
|
|
||
| def main() -> None: | ||
| parser = argparse.ArgumentParser(description="Detect and close duplicate GitHub issues") | ||
| mode = parser.add_mutually_exclusive_group(required=True) | ||
| mode.add_argument("--scan", action="store_true", help="Scan all open issues") | ||
| mode.add_argument("--issue-number", type=int, help="Check a single issue number") | ||
| parser.add_argument("--threshold", type=float, default=0.85, help="Similarity threshold (0-1)") | ||
| parser.add_argument("--close", action="store_true", help="Actually close duplicates (default is dry-run)") | ||
| parser.add_argument("--repo", type=str, help="Repository (owner/repo). Auto-detected if omitted.") | ||
| args = parser.parse_args() | ||
|
|
||
| dry_run = not args.close | ||
|
|
||
| if dry_run: | ||
| print("=== DRY RUN MODE (pass --close to actually close issues) ===\n") | ||
|
|
||
| print("Fetching open issues...") | ||
| issues = fetch_open_issues(args.repo) | ||
| print(f"Found {len(issues)} open issues.\n") | ||
|
|
||
| if args.scan: | ||
| count = scan_all(issues, args.threshold, args.repo, dry_run) | ||
| print(f"\nTotal duplicates {'found' if dry_run else 'closed'}: {count}") | ||
| else: | ||
| found = check_single(args.issue_number, issues, args.threshold, args.repo, dry_run) | ||
| sys.exit(0 if found else 0) # Always exit 0; finding no dup is not an error | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium