Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
93 withheld (location undisclosed)
As a LiteLLM user, I need the Mistral OCR provider to accept my documents, filter parameters to what Mistral supports, target the correct Mistral OCR endpoint, authenticate my request, and return structured OCR results so that I can extract text and structured content from documents reliably
Specification
The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.
As a LiteLLM user, I need the Mistral OCR provider to accept my documents, filter parameters to what Mistral supports, target the correct Mistral OCR endpoint, authenticate my request, and return structured OCR results so that I can extract text and structured content from documents reliably
Rationale & tags
Why this requirement exists, and how it is categorised.
Rationale & tags
Why this requirement exists, and how it is categorised.
Mistral OCR is the reference OCR provider integration; its request/response contract and error handling must be specified and verified
Verification & provenance
How this requirement was checked: the review trail, edit history, and the machine-analysis status terms (each ⓘ explains what it means).
Review
- Status
- approved
- Reviewer
- Buger · system_owner
- Reviewed
- Jul 1, 2026, 16:42 UTC
History
- Created
- Jul 1, 2026, 09:52 UTC · Claude Code · AI agent
- Modified
- Jul 2, 2026, 05:52 UTC · Claude Code · AI agent
Hazard review
- scenarioreviewednominalerror_handlingmalformed_input
Stakeholder aggregate carries the OCR request/response behavioral partitions: nominal structured OCRResponse (AC-001), error_handling for missing-key rejection before any provider call (AC-003) and parse re-raise, malformed_input for non-dict document rejection; these decompose into the mistral_ocr SW-REQs
- domainreviewed
The external-call reliability and http-client domain classes govern the concrete POST /v1/ocr network call, which lives at INT-REQ-001 (callee mistral_ocr_api) and the OCR call path litellm/ocr/main.py plus BaseLLMHTTPHandler; INT-REQ-001 already accepts all six, so they are suppressed on this aggregate that performs no I/O
- propertynot applicable
Cross-cutting property invariants (determinism, idempotency, commutativity, monotonicity, totality, atomicity, invariant_preservation) do not pertain to a single-shot OCR request/response stakeholder aggregate: the Mistral OCR call is a non-idempotent external POST with no ordering or accumulation semantics, and invariant_preservation is Go-only lemma authoring while this component is Python
- structuralnot applicable
Structural language-safety classes (nil_safety, overflow_safety, encoding_safety, pointer_arithmetic_bounded, format_string_constant, manual_memory_ownership_clear) target C/low-level memory and printf hazards; this is an informal Python stakeholder aggregate with no runtime code of its own and no manual memory, pointer arithmetic, or format strings
Change history
Every recorded revision of this requirement's source file — newest first, each with its commit message and the diff for that change.
Obligations
What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.
3 obligations · 3 discharged
Browse the catalogueEvidence tagged via <REQ> is witnessed by a requirement that satisfies this one — normal for stakeholder / aggregate requirements, which are proven through the requirements that refine them.
Behavior when operations fail or dependencies are unavailable.
- negativerequiredpresentCovered by 3 tests
- nominalrecommendedpresentCovered by 2 tests
Behavior when inputs are syntactically or structurally invalid.
- negativerequiredpresentCovered by 1 test
- nominalrecommendedpresentCovered by 1 test
Happy-path behavior with valid inputs.
- nominalrecommendedpresentCovered by 2 tests
Acceptance criteria
Stakeholder conditions for satisfaction, traced to the derived requirements and evidence that discharge them.
Acceptance criteria
Stakeholder conditions for satisfaction, traced to the derived requirements and evidence that discharge them.
Stakeholder-authored conditions defining when the requirement is satisfied, traced to derived requirements / evidence.
- AC-001verify: test
A user OCR request with a valid Mistral-format document dict returns a structured OCRResponse with pages, model, and object=ocr
Derived requirementsAcceptance test - AC-002verify: test
An OCR request carrying unsupported parameters forwards only Mistral-supported parameters to the provider endpoint
Derived requirementsAcceptance test - AC-003verify: test
An OCR request with no resolvable Mistral API key is rejected with a clear error before any provider call
Derived requirementsAcceptance test - AC-004verify: test
A user OCR request targets exactly one Mistral /v1/ocr endpoint for the default base and for a caller-supplied api_base, never doubling into /v1/v1
Derived requirementsAcceptance test - AC-005verify: test
A user OCR request is authenticated with a Bearer header whose key is taken from the api_key argument when supplied, otherwise from MISTRAL_API_KEY, with the argument taking precedence over the environment
Derived requirementsAcceptance test
Its place
How this requirement connects — what proves it, what it affects, and what it rests on. Authored links only here; automatically derived links come from the audit index.
Loading graph…
Trace evidence
The concrete artifacts linked to this requirement — implementing code, verifying tests, documents, and the findings raised against it.
No implementation linked
No source files are traced to this requirement yet.
Mirrors
Ports this requirement participates in — it carries a reviewed exemption on one side, or a finding raised against it is tracked as part of the port.
Mirrors
Ports this requirement participates in — it carries a reviewed exemption on one side, or a finding raised against it is tracked as part of the port.
- Mistral OCR: Python -> RustMIR-001DiffersPython → RustView in Mirrors
Impact
Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).
Impact
Blast radius — authored trace links only (automatically derived links come from the audit index and aren't shown here).
If you change this
Requirements (15)
- The Mistral OCR integration shall honor the provider…mistral_ocr · SYS
- The Rust ai-gateway shall bound every outbound provider…ai_gateway_outbound_http · SYS
- Interface decomposition of SYS-REQ-260701-3HNG between…mistral_ocr · INT
- transform_ocr_response re-raises the underlying exception…mistral_ocr · SW
- validate_environment raises ValueError when no API key is…mistral_ocr · SW
- map_ocr_params forwards a parameter iff it is in the…mistral_ocr · SW
- transform_ocr_response returns an OCRResponse carrying…mistral_ocr · SW
- validate_environment returns headers with a Bearer…mistral_ocr · SW
- get_complete_url appends only /ocr when the effective base…mistral_ocr · SW
- transform_ocr_request raises ValueError when the document…mistral_ocr · SW
- transform_ocr_request builds a request body of model,…mistral_ocr · SW
- get_supported_ocr_params returns exactly the set of…mistral_ocr · SW
- The OCR handler-to-shared-reqwest-client interface shall…ai_gateway_ocr_client · INT
- [Redactedai_gateway_document_fetch · SW
- A secret-bearing outbound request to an https endpoint…ai_gateway_provider_call · SW
Files to re-check (4)
- transformation.rslitellm-rust/crates/core/src/providers/mistral/ocr/transformation.rs
- transformation.pylitellm/llms/mistral/ocr/transformation.py
- transformation.rslitellm-rust/crates/core/src/ocr/transformation.rs
- common_utils.rslitellm-rust/crates/ai-gateway/src/ocr/common_utils.rs
Tests to re-run (2)
- test_mistral_ocr_transformation.pytests/test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py
- tests.rslitellm-rust/crates/ai-gateway/src/ocr/tests.rs
What this rests on
Discussions
Discuss this with the proof team. Nothing changes in your audit automatically — you open a request and a staff member records any outcome inside the thread.