Proof Portal
litellm
BerriAI117 findings · 107 requirementsLiteLLM Python->Rust migration audit (proof mirroring).
Python->Rust: sub-minimum max_output_tokens floor (<16 -> 16) absent in Rust
Medium-severity issue, currently open.
How well is this finding proven?
- 1.Reported / candidate
Complete
- 2.Reproducer written
Complete
View reproducer - 3.Reproduces (recorded run)
Not yet established
- 4.Independently re-run
Not yet established
- 5.Meets quality standard
Needs attention
- 6.Validated for submission
Not assessed
Recorded runs show whether the issue reproduces. Independent re-runs are shown separately. A later review does not fill in a missing earlier step.
Description
The issue as recorded.
MIR-003 divergence (SW-REQ-TK17). Python _enforce_min_max_output_tokens raises any integer max_output_tokens below OPENAI_RESPONSES_API_MIN_MAX_OUTPUT_TOKENS=16 up to 16 (values None or >=16 pass through unchanged), applied inside map_openai_params. This exists specifically so a Claude Code max_tokens=1 warmup probe on model switch does not 400 with 'Invalid max_output_tokens: integer below minimum value. Expected >= 16, but got 1'. Rust has no max_output_tokens handling on the Responses surface at all (grep across crates confirms). A request with max_output_tokens=1 that Python silently floors to 16 would be left at 1 (upstream 400) if Rust owned the transform. This is the 'token clamp bounds' divergence class. Portable-but-not-yet-ported; MIR-003 cell stays honest debt. No behavior changed.
Evidence disposition (issue #392): this finding documents an ABSENCE in the Rust target (litellm-rust/crates/, outside the Python verification_scope in proof.yaml), established by the static grep/read recorded in reproducer_command. There is no runnable Python-scope tripwire that can reproduce a Rust-side absence, so proof evidence refresh cannot stamp a current evidence row. Reviewed and accepted as honest tracked debt below the runnable-reproducer floor; fabricating an evidence hash would be dishonest.
Affected requirements
The requirement(s) this issue violates — click through to the spec.
Port parity
How this finding relates to the port: whether the behaviour diverges, isn't ported yet, was fixed, or matches across both implementations.
- OpenAI Responses API: Python -> RustMIR-003Not yet ported to RustPython → RustView in Mirrors
Severity, explained
Why this is rated the way it is — and the scoring signals behind the rating (each ⓘ explains the term).
- why this rating
- Risk-rated
- risk area
- Correctness
- CVE surface
- None
Where it is
The code the issue lives in — peek the affected function inline to see it in context.
- OpenAIResponsesAPIConfig._enforce_min_max_output_tokens (Python) vs Rust (none)
Reproduction steps
Technical steps for your engineers to confirm the issue by hand.
grep -rniE 'max_output_tokens|= *16|floor' litellm-rust/crates/core/src/responses litellm-rust/crates/core/src/providers/openai/responses (no matches)
What protects you, and the fix
What limits your exposure today, and the planned remediation.
What protects you now
Python path floors sub-minimum tokens; Rust WS transport does not carry this.
The fix
Port _enforce_min_max_output_tokens to Rust. Audit finding only.
Blast radius
If you touch this issue, what else may need re-checking — the requirements it affects and the code and tests that hang off them. Historical view: authored trace links only — automatically derived links aren't reconstructible for past runs.
Touch this finding and you re-check 12 requirements · 1 code files · 1 tests.
- transformation.py
- test_openai_responses_transformation.py
Per-requirement evidence
For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.
Per-requirement evidence
For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.
Change history
Every recorded revision of this finding's source file — when it was added, edited, or re-classified, with the diff for each change.
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.