Repository navigation
feat(rust-bridge): extend native dispatch foundation to chat completions, responses, and messages - #42805
Merged
yujonglee-berri merged 7 commits intoSep 23, 2026
Conversation
…ings Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
…e surface Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…eddings in the stub Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
yujonglee-berri
enabled auto-merge (squash)
September 23, 2026 21:41
yujonglee-berri
approved these changes
Sep 23, 2026
yujonglee-berri
deleted the
litellm_native_dispatch_chat_responses_messages
branch
September 23, 2026 21:47
2 of 5 tasks
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.
TLDR
Problem this solves:
completion/acompletion/responses/aresponsesthat the extension never exportedHow it solves it:
PYTHON_ONLYcatalog rules forCHAT_COMPLETIONSandRESPONSES, matching embeddings and Messagescompletion/acompletion/responses/aresponsesscaffolds, same shape as embeddings (feat(embeddings): add native dispatch foundation #42799)_native.pyideclarations for the four new exportsrust-wheelhas had on main since feat(embeddings): add native dispatch foundation #42799: runtime parameter names and__all__now match_native.pyiRoutes left Python-only after this PR: chat completions, Responses, Messages, embeddings. None of them ships a native rollout. The existing keyword-style
chat_completions/achat_completionsnative functions and the Responses WebSocket connection are untouched. No provider-native execution is addedUser Flow
Before: a developer calls any of the three routes and gets the Python result
After: the same calls return the same Python results
Relevant issues
Follows #42799
Affected release
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
This PR is foundation only: no user-visible behavior changes and no provider calls are added, so there is no live before/after to capture. Validation at the tip (b1fa7dd), merge base dc14e76:
Before (dc14e76)
python -c "from litellm.rust_bridge import _native; _native.completion"fails withAttributeError: module has no attribute 'completion'(same foracompletion,responses,aresponses)After (b1fa7dd)
python -I -m mypy.stubtest --mypy-config-file tests/test_litellm/rust_bridge/stubtest.ini litellm.rust_bridge._nativeon a freshmaturin developbuild:Success: no issues found in 1 module(main fails with 19 errors on the embeddings exports)maturin developthenpython -c "from litellm.rust_bridge import _native; _native.completion({}, (), {})"raisesRustBridgeDeclined: native chat completions route is not implemented(same shape for the other three)LITELLM_LOCAL_MODEL_COST_MAP=True uv run --no-sync pytest tests/test_litellm/chat_completions tests/test_litellm/messages tests/test_litellm/rust_bridge tests/test_litellm/responses/test_dispatch.py tests/test_litellm/embeddings: all pass except one preexistingtenacityimport error intest_responses_with_retries_uses_the_dispatch_entrypoint, unrelated to this changecargo fmt --all --check,cargo clippy -p litellm-python-bridge --all-targets,cargo test -p litellm-python-bridge routes::(39 passed) cleanruff format/ruff checkandbasedpyrightclean on every changed Python fileType
🆕 New Feature
✅ Test
Caveats (if any)
Low
Link to Devin session: https://app.devin.ai/sessions/f5e1e146960e47a997e39f10827bd261
Open in Devin Desktop: https://app.devin.ai/desktop/session/f5e1e146960e47a997e39f10827bd261?variant=devin
Requested by: @yujonglee-berri