litellm/basedpyright-code-budget.json
devin-ai-integration[bot] c4f19c3e4c
feat(messages): route Azure Anthropic /messages through Rust behind rust:true (#33616)
* feat(messages): route Azure Anthropic /messages through Rust behind rust:true

Adds an opt-in Rust path for non-streaming Azure Anthropic Messages. A
deployment sets rust: true in litellm_params to route litellm.messages()
and the proxy /v1/messages endpoint through the native Rust bridge; a
missing flag or rust: false keeps the existing Python path, and non-Azure
providers, streaming, an unavailable bridge, or a None result all fall
back to Python. Rust-backed responses carry an x-litellm-rust: true
response header so callers can see which path served the request.

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* test(docs): exclude LITELLM_USE_RUST_MESSAGES rollout flag from env-doc check

Mirrors the existing LITELLM_USE_RUST_OCR entry; the flag is an internal
rollout toggle that is intentionally not in the public environment settings
docs yet.

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* fix(rust_bridge): isolate OCR enable flag and drop dead messages global toggle

use_litellm_rust only mutates the OCR enabled flag when configuring OCR (or
called with no bridge kwargs, preserving the legacy contract), so configuring
only the messages bridge no longer flips OCR state.

Remove the vestigial global enabled/env state from the messages bridge. Routing
is controlled per deployment by rust:true in the shared handler gate, so the
messages module never consulted the global toggle; drop it rather than leave a
no-op switch.

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* refactor(rust/messages): split Anthropic config into its own provider file and type the request/response contract

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* feat(messages): route eligible Azure Anthropic streaming through Rust via buffered fake-stream

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* fix(messages): fold system-role messages for Azure Anthropic and fall back to Python on Rust bridge errors

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* fix(rust_bridge): use Python::attach for amessages after pyo3 bump

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* test(proxy): mock get_configured_token_limits in model_info tests

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* ci: run rust_bridge unit tests in misc shard

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

* Revert "ci: run rust_bridge unit tests in misc shard"

This reverts commit c86d861a03.

* test(anthropic): move rust messages bridge tests into misc-shard dir

Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
2026-07-18 11:56:25 -07:00

146 lines
2.5 KiB
JSON

{
"reportAny": {
"limit": 37484
},
"reportArgumentType": {
"limit": 2704
},
"reportAssignmentType": {
"limit": 330
},
"reportAttributeAccessIssue": {
"limit": 516
},
"reportCallIssue": {
"limit": 124
},
"reportConstantRedefinition": {
"limit": 59
},
"reportDeprecated": {
"limit": 326
},
"reportDuplicateImport": {
"limit": 42
},
"reportExplicitAny": {
"limit": 10389
},
"reportFunctionMemberAccess": {
"limit": 11
},
"reportGeneralTypeIssues": {
"limit": 227
},
"reportIncompatibleMethodOverride": {
"limit": 78
},
"reportIncompatibleVariableOverride": {
"limit": 12
},
"reportInconsistentOverload": {
"limit": 18
},
"reportIndexIssue": {
"limit": 37
},
"reportInvalidTypeForm": {
"limit": 35
},
"reportInvalidTypeVarUse": {
"limit": 5
},
"reportMatchNotExhaustive": {
"limit": 0
},
"reportMissingParameterType": {
"limit": 5900
},
"reportMissingTypeArgument": {
"limit": 15903
},
"reportMissingTypeStubs": {
"limit": 41
},
"reportOperatorIssue": {
"limit": 0
},
"reportOptionalCall": {
"limit": 0
},
"reportOptionalIterable": {
"limit": 0
},
"reportOptionalMemberAccess": {
"limit": 1085
},
"reportOptionalOperand": {
"limit": 0
},
"reportOptionalSubscript": {
"limit": 0
},
"reportPossiblyUnboundVariable": {
"limit": 77
},
"reportPrivateUsage": {
"limit": 2438
},
"reportRedeclaration": {
"limit": 12
},
"reportReturnType": {
"limit": 225
},
"reportTypedDictNotRequiredAccess": {
"limit": 27
},
"reportUndefinedVariable": {
"limit": 0
},
"reportUnknownArgumentType": {
"limit": 45894
},
"reportUnknownLambdaType": {
"limit": 113
},
"reportUnknownMemberType": {
"limit": 40539
},
"reportUnknownParameterType": {
"limit": 20403
},
"reportUnknownVariableType": {
"limit": 32141
},
"reportUnnecessaryCast": {
"limit": 177
},
"reportUnnecessaryComparison": {
"limit": 1025
},
"reportUnnecessaryContains": {
"limit": 7
},
"reportUnnecessaryIsInstance": {
"limit": 1209
},
"reportUntypedBaseClass": {
"limit": 165
},
"reportUntypedFunctionDecorator": {
"limit": 33
},
"reportUnusedClass": {
"limit": 33
},
"reportUnusedFunction": {
"limit": 206
},
"reportUnusedImport": {
"limit": 1005
},
"reportUnusedVariable": {
"limit": 1297
}
}