Skip to content

🔄 sync: upstream v1.79.3-stable - #41

Closed
Cartofante wants to merge 4201 commits into
carto/mainfrom
main
Closed

🔄 sync: upstream v1.79.3-stable#41
Cartofante wants to merge 4201 commits into
carto/mainfrom
main

Conversation

@Cartofante

Copy link
Copy Markdown
Collaborator

🔄 Upstream Sync: v1.79.3-stable

This PR syncs CARTO's LiteLLM fork with the latest stable upstream release.

📊 Release Information

🔀 Branch Flow

  1. BerriAI/litellm:main merged into CartoDB/litellm:main
  2. 📝 This PR: CartoDB/litellm:mainCartoDB/litellm:carto/main

📝 CARTO-Specific File Guidelines

When reviewing or resolving conflicts, follow these guidelines:

✅ Keep CARTO Versions (Ours)

  • .github/workflows/carto_*.yaml - All CARTO-specific workflows
  • .github/workflows/carto-*.yml - CARTO workflows
  • CARTO_*.md - CARTO documentation files
  • docs/CARTO_*.md - CARTO documentation in docs/

🔄 Accept Upstream (Theirs)

  • pyproject.toml - Version field (should match upstream)
  • litellm/ - Core LiteLLM library code
  • tests/ - Upstream test files
  • requirements.txt - Upstream dependencies

⚠️ Manual Review Required

  • Dockerfile - Check sections marked with # CARTO: comments
  • docker/Dockerfile.non_root - Contains CARTO customizations
  • Makefile - Check sections marked with # CARTO: comments
  • db_scripts/ - CARTO may have custom scripts

🧪 Testing Checklist

Before merging, ensure the following tests pass:

  • make lint - Linting passes
  • make test-unit - Unit tests pass
  • Docker build succeeds: docker build -f docker/Dockerfile.non_root .
  • CARTO workflows still work (check carto_*.yaml files)
  • Review pyproject.toml version matches upstream

📚 Documentation

🔧 Conflict Resolution

If this PR has conflicts, there are two options:

Option 1: Automated Claude Code Resolution (Recommended)

The carto-upstream-sync-resolver workflow will automatically trigger when conflicts are detected.

It will:

  1. 🤖 Detect conflicts in this PR
  2. 🔀 Checkout carto/main and merge main into it
  3. ✏️ Resolve conflicts following CARTO priority rules
  4. ✅ Run all tests (make lint, make lint-mypy, make test-unit)
  5. 📝 Create a resolution PR: upstream-sync-resolver/<PR-number> → carto/main

What you need to do:

  1. Review the resolution PR created by Claude Code
  2. Verify CARTO customizations are preserved
  3. Merge the resolution PR into carto/main
  4. Close this PR (changes already merged via resolution PR)

Option 2: Manual Resolution

If you prefer manual resolution or Claude fails:

  1. Checkout and merge locally:
git fetch origin
git checkout carto/main
git pull origin carto/main
git merge main  # Creates conflicts
  1. Resolve conflicts following guidelines above

  2. Test your changes:

make lint
make lint-mypy
make test-unit
  1. Push resolved changes:
git push origin carto/main
  1. Close this PR (changes already in carto/main)

🤖 This PR was automatically created by the carto-upstream-sync workflow.

yuneng-jiang and others added 30 commits November 25, 2025 14:46
* include server_tool_use in streaming usage

* add test
…#16791)

* fix transcription exception handling

* reraise the exception
* init RAG api types

* add RAG endpoints

* init main.py for RAG ingest API

* init RecursiveCharacterTextSplitter

* add BaseRAGIngestion

* fix OpenAIRAGIngestion

* fix img handler

* init OpenAIRAGIngestion

* init BedrockRAGIngestion

* init BedrockRAGIngestion

* init rag tests

* init BedrockVectorStoreOptions

* implement BedrockRAGIngestion

* add BaseRAGAPI

* add endpoint for RAG ingest

* add ingest RAG endpoints

* add test doc

* add parse_rag_ingest_request

* update endpoints

* docs add docs for new RAG API

* fix qa check

* fix linting

* docs ficx

* docs

* add max depth checks

* docs anthropic
…text-format-bridge-conversion

fix: Support response_format parameter in completion -> responses bridge
- Automatically pass LiteLLM virtual key context as X-LiteLLM-* headers
- Includes key_alias, user_id, team_id, org_id, and user_email
- No configuration required - always enabled for application/user tracking
- Excludes sensitive data (metadata, API tokens) for security
- Add comprehensive tests (30 tests, all passing)
- Update documentation with header details
This should allow postgres to perform a more efficient index scan instead of a sequential table scan.

These two queries consistently show up in the longest-running ones in our instance, and are a major latency source for the usage page on the admin UI.
…meters (BerriAI#17019)

- Add model identifier to FLASH_IMAGE_PREVIEW_MODEL_IDENTIFIERS
- Add imageSize parameter support (1K, 2K, 4K) with GeminiImageSize type
- Add tests for imageSize parameter transformation
- Update documentation with new model
[Feature] UI - Disable edit, delete, info, for dynamically generated spend tags
…s_fix

[Feature] UI - Org Admin Team Permissions Fix
Sameerlite and others added 15 commits December 2, 2025 14:00
We recommend using 10–20 connections. Our actual default is 10, but the documentation incorrectly listed the default as 100.
* add OPENAI_COMPATIBLE_BATCH_AND_FILES_PROVIDERS

* fix use OPENAI_COMPATIBLE_BATCH_AND_FILES_PROVIDERS

* add _get_batch_job_total_usage_from_file_content

* fixes for vLLM + 12 labs async invoke

* fix: vLLM Batch APIs

* afile_retrieve

* test_hosted_vllm_full_workflow

* fix SERVER_URL for test
…ribute_error_code_raise

Fix 500 error for malformed request
…ader_forwarding

Fix: litellm user auth not passing issue
…7104)

* docs: add Azure AI Foundry documentation for Claude models

Add documentation explaining how to use Claude models (Sonnet 4.5,
Haiku 4.5, Opus 4.1) deployed on Azure AI Foundry with LiteLLM.

Azure exposes Claude using Anthropic's native API, so users can use
the existing anthropic/ provider with their Azure endpoint.

Closes BerriAI#17066

* docs: Add alternative method for Azure AI Foundry using anthropic/ provider

Document that users can use anthropic/ provider with Azure endpoint
as an alternative to the dedicated azure_ai/ provider.
* Update constants.py

added constants

* Update base_aws_llm.py

added steps

* Update invoke_handler.py

added openai support

* Update base_invoke_transformation.py

added

* Update test_bedrock_completion.py

added
[Fix] Bedrock Guardrail Indent and Import fix
[Infra] Add Google Private API Endpoint to Vertex AI fields
Automatic sync from upstream BerriAI/litellm
Preparing for v1.79.3-stable release

Strategy: Merge with history preservation (main mirrors upstream)
@Cartofante

Copy link
Copy Markdown
Collaborator Author

🤖 Automated Conflict Resolution Started

Claude Code is now resolving conflicts for this PR.

Process:

  1. 🔍 Analyzing conflicts in all files
  2. 📋 Reading CARTO customization guidelines
  3. ⚖️ Applying resolution priorities (CARTO first, then upstream)
  4. ✏️ Resolving conflicts file by file
  5. 🧪 Running tests (lint, mypy, unit tests)
  6. 🔀 Creating resolution PR

Status: In progress...

This process may take 30-90 minutes for large PRs.

View workflow run →

mateo-di added a commit that referenced this pull request Dec 2, 2025
…rges

## Changes

### carto-upstream-sync.yml
- Add automatic resolver dispatch after PR creation
- Check mergeable status with retries (handles GitHub's async computation)
- Trigger resolver workflow when conflicts are detected

### carto-upstream-sync-resolver.yml
- Add prominent merge warning at top of resolution PR body
- Add warning comment step after resolution PR creation
- Warn against squash/rebase merge which destroys upstream history

## Why

1. **Resolver not triggering**: GitHub doesn't fire `pull_request` events
   when PRs are created by workflows, even with PAT tokens. This adds
   explicit workflow dispatch as a reliable trigger.

2. **Squash merge prevention**: PR #26 was squash-merged, which lost all
   upstream commit history (4201 commits). This caused PR #41 to show
   inflated diff counts. Adding clear warnings to prevent this.

Shortcut

- Autolink: [sc-521238]
@Cartofante

Copy link
Copy Markdown
Collaborator Author

❌ Conflict Resolution Failed

Claude Code encountered an error while resolving conflicts.

Please check:

  • Workflow logs for error details
  • May need manual conflict resolution
  • Consider adjusting max-turns or timeout if job was interrupted

Workflow Run: https://github.com/CartoDB/litellm/actions/runs/19874377145

Manual Resolution Steps:

  1. Checkout main branch locally
  2. Create resolution branch
  3. Resolve conflicts following CARTO_CLAUDE.md guidelines
  4. Run tests and create PR

mateo-di added a commit that referenced this pull request Dec 2, 2025
…rges (#43)

* fix: improve upstream sync workflow reliability and prevent squash merges

## Changes

### carto-upstream-sync.yml
- Add automatic resolver dispatch after PR creation
- Check mergeable status with retries (handles GitHub's async computation)
- Trigger resolver workflow when conflicts are detected

### carto-upstream-sync-resolver.yml
- Add prominent merge warning at top of resolution PR body
- Add warning comment step after resolution PR creation
- Warn against squash/rebase merge which destroys upstream history

## Why

1. **Resolver not triggering**: GitHub doesn't fire `pull_request` events
   when PRs are created by workflows, even with PAT tokens. This adds
   explicit workflow dispatch as a reliable trigger.

2. **Squash merge prevention**: PR #26 was squash-merged, which lost all
   upstream commit history (4201 commits). This caused PR #41 to show
   inflated diff counts. Adding clear warnings to prevent this.

Shortcut

- Autolink: [sc-521238]

* fix: reverse merge direction in resolver to preserve upstream commit history

The previous approach (checkout carto/main, merge main INTO it) lost upstream
commit history because the PR only showed Claude's resolution commits, not
the upstream commits.

New approach:
1. Checkout main (has all upstream commits)
2. Merge carto/main INTO it (brings CARTO customizations)
3. Resolve conflicts
4. Create PR to carto/main

This ensures the resolution PR shows ALL upstream commits + resolution commits,
preserving full commit history in carto/main.

Also updated Claude's prompt to reflect:
- Reversed conflict marker interpretation (HEAD=upstream, theirs=CARTO)
- Updated ours/theirs terminology in file-specific rules
- Clear explanation of why this approach preserves history
@Cartofante

Copy link
Copy Markdown
Collaborator Author

🤖 Automated Conflict Resolution Started

Claude Code is now resolving conflicts for this PR.

Process:

  1. 🔍 Analyzing conflicts in all files
  2. 📋 Reading CARTO customization guidelines
  3. ⚖️ Applying resolution priorities (CARTO first, then upstream)
  4. ✏️ Resolving conflicts file by file
  5. 🧪 Running tests (lint, mypy, unit tests)
  6. 🔀 Creating resolution PR

Status: In progress...

This process may take 30-90 minutes for large PRs.

View workflow run →

Cartofante pushed a commit that referenced this pull request Dec 2, 2025
Conflict resolution strategy:
- Preserved CARTO customizations in infrastructure files
- Accepted upstream improvements to core LiteLLM functionality
- Fixed upstream bugs in batch_utils.py (missing model_name parameter)
- Fixed linting issues (unused imports, type errors, complexity warnings)

Testing:
- ✅ make format passed (626 files reformatted)
- ✅ make lint passed (Black + Ruff checks)
- ✅ make lint-mypy passed (MyPy type checking)
- 🔄 make test-unit running (5221 tests with 4 parallel workers)

Files resolution summary:
- Accepted upstream: 631 files (core litellm, tests, docs, UI)
- CARTO preserved: 0 conflicted files (CARTO workflows already non-conflicting)
- Manually reviewed: 7 files (Dockerfile, Makefile, docker/Dockerfile.non_root, README.md, .circleci/config.yml, .circleci/requirements.txt, ci_cd/security_scans.sh)

Key changes:
- OpenAI SDK upgraded: 1.99.5 → 2.8.0 (upstream)
- Added responses==0.25.7 to CircleCI requirements
- Fixed batches/batch_utils.py missing model_name parameters
- Fixed generic_guardrail_api.py TypedDict literal-required error
- Added PLR0915 noqa comments for complex functions

Total files modified: 939 (156 added, 9 modified, 81 deleted, 3 renamed, 690 from formatting)
@Cartofante

Copy link
Copy Markdown
Collaborator Author

✅ Conflict Resolution Complete

Claude Code has successfully resolved conflicts and created a resolution PR.

Resolution PR: #45

Next Steps:

  1. Review the resolution PR
  2. Verify CARTO customizations are preserved
  3. Check that all tests pass
  4. Merge the resolution PR to update this PR

Workflow Run: https://github.com/CartoDB/litellm/actions/runs/19874888463

@Cartofante

Copy link
Copy Markdown
Collaborator Author

🔒 PR Closed - Superseded by Resolution PR

This PR has been automatically closed because conflicts have been resolved in a separate PR.

✅ Resolution PR: #45 (#45)

Why was this closed?

  • Conflicts were resolved by Claude Code in the resolution PR
  • Merging the resolution PR will bring all changes into carto/main
  • This PR becomes redundant once resolution PR is merged
  • Prevents confusion about which PR to merge

Next Steps:

  1. ✅ Review and merge the resolution PR: fix: resolve conflicts for upstream sync PR #41 #45
  2. 🎉 All upstream changes will be in carto/main (sync complete!)

🤖 Automatically closed by carto-upstream-sync-resolver

@Cartofante

Copy link
Copy Markdown
Collaborator Author

Conflicts resolved via #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.