Repository navigation
feat(ocr): add Vertex DeepSeek adapter and remove legacy OCR pipeline - #40509
Conversation
Greptile SummaryThis PR consolidates OCR execution into
Confidence Score: 5/5The current tip appears safe to merge; no actionable new regression remains after the passthrough and credential-provenance fixes. The latest changes correctly preserve request provenance for separately transported credentials without disabling credential fallback, and all previous Greptile root threads were manually resolved.
|
| Filename | Overview |
|---|---|
| litellm-rust/crates/core/src/ocr/adapters/vertex/deepseek.rs | Implements Vertex authentication, endpoint construction, model namespacing, and DeepSeek OCR transformations through the core adapter interface. |
| litellm-rust/crates/core/src/ocr/registry.rs | Extends OCR adapter resolution for Vertex DeepSeek while retaining specialized provider routing. |
| litellm-rust/crates/core/src/ocr/prepare.rs | Centralizes typed parameter preparation, guardrail body handling, and shared HTTP request construction. |
| litellm-rust/crates/ai-gateway/src/ocr/mod.rs | Replaces the legacy gateway-owned pipeline with delegation to the core OCR client and explicit rejection of unsupported host hooks. |
| litellm/rust_bridge/ocr.py | Preserves proxy credential provenance when marshaling OCR calls into Rust. |
| tests/test_litellm/ocr/test_rust_bridge.py | Adds regression coverage for credential fields transported outside the proxy request body. |
Reviews (6): Last reviewed commit: "fix(ocr): preserve DeepSeek credential p..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
287bec9 to
ecd1435
Compare
ecd1435 to
845ab3f
Compare
845ab3f to
a3e3e11
Compare
ea0b510 to
b468ec4
Compare
b468ec4 to
a1b48d1
Compare
a1b48d1 to
14392bc
Compare
14392bc to
4afd7ee
Compare
a060565 to
026fa18
Compare
026fa18 to
186d378
Compare
186d378 to
fcfcdd9
Compare
fcfcdd9 to
a609a0d
Compare
a609a0d to
985b28a
Compare
|
@greptileai Please review the current tip after corrected stack ancestry, Azure imports, and successful workspace Clippy verification |
|
@greptileai Please review current tip after lower-stack security and provider-option fixes plus successful all-features workspace Clippy |
|
@greptileai Please review current tip 8c488bc after all lower-stack security and passthrough fixes |
| async fn core_ocr(request: OcrRequest<'_>) -> Result<Value, Error> { | ||
| validate_host_hooks(&request)?; | ||
| let client = OcrClient::new(crate::client::http_client().clone())?; | ||
| let core_request = decode_request(OcrWireRequest { |
There was a problem hiding this comment.
Medium: OCR download policy bypass
The removed path read MAX_IMAGE_URL_DOWNLOAD_SIZE_MB and treated zero as disabling remote-document downloads. This wire request carries no download policy, so decode_request substitutes the core's fixed 50 MiB limit; an authenticated caller can still force outbound downloads and large in-memory base64 conversion when the operator configured a lower limit or disabled fetching. Pass the resolved setting into the core request and enforce it through OcrConnection::max_download_bytes.
Restack validation
Rebased onto #40507 (
f1324b6be6). Current tip:a0605654d6The seven-PR stack is based on
litellm_internal_stagingat8a4fae0e17and includes the additional fallback tests from #40502All seven PRs pass the type discipline gate against their immediate parents. Rust formatting, workspace Clippy, workspace tests, core tests with
bedrock-auth, gateway tests withserver, and full-stackmake checkpassedThe latest targeted Python run passes 60 tests, with 4 native-extension cases skipped