Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

LiteLLM Python->Rust migration audit (proof mirroring).

Back to findings
Known issuerealtime-api-base-precedence-divergence

Python->Rust divergence: Rust realtime complete_url omits the litellm.api_base and OPENAI_API_BASE env precedence sources

OpenOpenLow

Low-severity issue, currently open.

How well is this finding proven?

  1. 1.Reported / candidate

    Complete

  2. 2.Reproducer written

    Complete

    View reproducer
  3. 3.Reproduces (recorded run)

    Not yet established

  4. 4.Independently re-run

    Not yet established

  5. 5.Meets quality standard

    Not assessed

  6. 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.

Parity finding for MIR-004 SW-REQ-260731-AB40. Python OpenAIRealtimeHTTPConfig.get_api_base resolves the first truthy source across caller -> litellm.api_base -> OPENAI_API_BASE env -> https://api.openai.com default. The Rust realtime complete_url (crates/core/src/providers/openai/realtime/transformation.rs) resolves only two: the caller-supplied api_base (trimmed, blank treated as absent) or the OPENAI_REALTIME_DEFAULT_API_BASE default. The litellm.api_base global and the OPENAI_API_BASE environment source are unported in the Rust core; a deployment relying on OPENAI_API_BASE would silently fall through to the OpenAI default. The AB40 obligation cells (nominal / empty_input / totality / pure-function) are still genuinely met by the Rust resolver's shape, so AB40 is mirrored in MIR-004, but this reduced source set is a real behavioral divergence recorded here. Audit-only; no code changed.

Reachability

Evidence disposition (issue #392): the reproducer is a Rust cargo test under litellm-rust/, outside the Python verification_scope declared in proof.yaml, so proof evidence refresh cannot execute it or hash its files and no current evidence row can be stamped in this project config. Reviewed and accepted as honest tracked debt below the runnable-reproducer floor; the divergence is witnessed by the named Rust unit test, runnable manually via the cargo command in reproducer_command. No evidence hash is fabricated.

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 Realtime: Python -> RustMIR-004
    Diverges on the Rust portPython → Rust
    View in Mirrors

Severity, explained

Why this is rated the way it is — and the scoring signals behind the rating (each ⓘ explains the term).

LowRated severity — the impact if this issue is exploited or hit.
why this rating
Risk-rated
risk area
Correctness
Security classification
Not a security surface
CVE surface
None

Where it is

The code the issue lives in — peek the affected function inline to see it in context.

  • OpenAIRealtimeHTTPConfig.get_api_base (Python, 4-source) vs providers::openai::realtime::transformation::complete_url (Rust, caller-or-default)

Reproduction steps

Technical steps for your engineers to confirm the issue by hand.

cargo test -p litellm-core --lib providers::openai::realtime::transformation::tests::complete_url_custom_base (pins caller-or-default resolution; no env/global source exists to test)

What protects you, and the fix

What limits your exposure today, and the planned remediation.

What protects you now

Callers to the Rust realtime path must pass api_base explicitly; OPENAI_API_BASE and litellm.api_base are not consulted.

The fix

Add the litellm.api_base and OPENAI_API_BASE precedence sources to the Rust realtime base resolution to fully match Python, or accept the narrowed contract deliberately. 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.

Tracing blast radius…

Touch this finding and you re-check 1 requirements · 2 code files · 0 tests.

Requirements (1)
Code files (2)
  • transformation.rs
  • http_transformation.py

Per-requirement evidence

For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.

Implementing code (2)
  • litellm-rust/crates/core/src/providers/openai/realtime/transformation.rs
    complete_url
  • litellm/llms/openai/realtime/http_transformation.py
    OpenAIRealtimeHTTPConfig.get_api_base
Tests & evidence (2)
  • docs/requirements/openai_realtime.md
  • litellm-rust/crates/core/src/providers/openai/realtime/transformation.rs
Proof obligations (4)
empty_input

Behavior when inputs are absent, nil, zero-length, or blank.

  • ✓nominal (required) — litellm-rust/crates/core/src/providers/openai/realtime/transformation.rs:108, litellm-rust/crates/core/src/providers/openai/realtime/transformation.rs:120
nominal

Happy-path behavior with valid inputs.

  • ✓nominal (required) — litellm-rust/crates/core/src/providers/openai/realtime/transformation.rs:148
pure_function_property_tested

A function declared pure (no I/O, no global state, output is f(input) only) shall carry property-based tests that exercise its declared algebraic properties (determinism, totality, commutativity, monotonicity, idempotency — whichever apply); example-based tests alone shall not be sufficient evidence for a pure-function obligation.

  • ✓nominal (required) — litellm-rust/crates/core/src/providers/openai/realtime/transformation.rs:149
totality

Every reachable input combination is covered by a requirement.

  • ✓nominal (required) — litellm-rust/crates/core/src/providers/openai/realtime/transformation.rs:109

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.

Sign in to discuss this with the proof team.Sign in