Proof Portal

Project overview

litellm

BerriAI117 findings · 107 requirements

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

93 withheld (location undisclosed)

All requirements
RequirementSW-REQ-260730-FAKESoftwareReview

should_fake_stream enables fake-streaming if and only if streaming was requested (stream is True) AND a model id was supplied AND that model is known to not support native streaming; a non-streaming request, an absent model, or a native-streaming model yields no fake-streaming

All automated checks pass and 2/2 obligations are satisfied. Human review is still pending.
PriorityshallTypeguaranteeCategoryfunctionalComponentopenai_responsesAssuranceEFindingsnone open

Specification

The requirement exactly as authored — its complete prose text and, where present, the formal FRETish sentence it compiles to.

Description

should_fake_stream enables fake-streaming if and only if streaming was requested (stream is True) AND a model id was supplied AND that model is known to not support native streaming; a non-streaming request, an absent model, or a native-streaming model yields no fake-streaming

FRETish formula
the openai_responses shall always satisfy (fake_stream_enabled <-> (stream_requested & model_known & native_streaming_unsupported))
View full formal model

Verification & provenance

How this requirement was checked: the review trail, edit history, and the machine-analysis status terms (each ⓘ explains what it means).

Assurance levelE
Formalizationvalid
Strategyfretish

Review

Status
pending

History

Created
Jul 31, 2026, 00:00 UTC · Claude Code · AI agent
Modified
Jul 31, 2026, 00:00 UTC · Claude Code · AI agent

Hazard review

Reviewed Jul 31, 2026, 00:00 UTCby agent:claude-codecatalog v1.9.0
  • scenarioreviewednominal

    nominal is the streaming gate over the stream/model-known/native-support conditions; the capability-lookup exception path is swallowed to a False (no fake-streaming) default and is exercised as part of the native-support condition rather than a distinct error partition

  • propertyreviewedpure_function_property_tested

    The gate decision is a pure branch on stream/model/native-support (the lookup is delegated to litellm.utils), so the biconditional is property-testable; determinism follows from the pure branch

  • structuralnot applicable

    Garbage-collected Python branch with no manual memory, pointer arithmetic, overflow, or format string

  • domainnot applicable

    The native-streaming capability is a local model-metadata lookup; should_fake_stream issues no network/filesystem/IPC call of its own

Change history

Every recorded revision of this requirement's source file — newest first, each with its commit message and the diff for that change.

Review history

Human and AI-agent approvals of this requirement — the 'why was this approved' lineage, each with the reviewer's justification and the code it cites.

  1. Claude Code · AI agentApprovedSpec conformanceJul 31, 2026 · 4 months agoREVIEW-21

    should_fake_stream: line 419 'if stream is not True: return False'; 421 'if model is not None'; 423 'supports_native_streaming(...) is False: return True'. FRETish fake_stream_enabled <-> (stream_requested & model_known & native_streaming_unsupported) matches the three short-circuiting gates; all other paths return False.

    Cited code (3)

Obligations

What this requirement must witness to be considered satisfied — the required evidence, and the tests that discharge each one.

2 obligations · 2 discharged

Browse the catalogue
Discharged

Happy-path behavior with valid inputs.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 1 test
Discharged

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.

Discharging evidence1/1 required witnessed
  • nominalrequiredpresent
    Covered by 1 test

Code signals

Static-analysis signals from external scanners that bear on this requirement's obligations — the source location, the obligation each touches, and its closure status.

  • Missingbuiltinunordered_set_to_output
    Obligation: Determinism · Property

    Output identical regardless of collection ordering or runtime conditions.

    OpenAIResponsesAPIConfig.get_supported_openai_params: list(set(...)) — no total order

Formula evidence

The formal formula behind this requirement, the variables it is written over, and the tests that exercise it (each term is explained inline).

FRETish formula

the openai_responses shall always satisfy (fake_stream_enabled <-> (stream_requested & model_known & native_streaming_unsupported))

Witnesses· 2 scenarios total

  • test_fake_stream_gate
    exercises 2 condition scenarios

MC/DC truth table· 6 rows

Each row assigns the formula's conditions (T/F) and shows the Result— the formula's value for that input row, not a test pass/fail. A row proves a condition when flipping only that condition flips the outcome. The test that covers each row is linked.

Covereda test exercises this rowExempteda reviewed mcdc:ignoreNo-actionfalse-result row satisfied by designUncoveredneeds a covering test
#fake_stream_enabledmodel_knownnative_streaming_unsupportedstream_requestedResultProvesCovering test
1FFFFTfake_stream_enabled
2TFFFFfake_stream_enabledExempted · defensive — fake-streaming is enabled only when all three conditions hold, so enabling it with every condition false is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
3TFTTFmodel_knownExempted · defensive — with no model the gate returns no fake-streaming, so enabling it is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
4TTFTFnative_streaming_unsupportedExempted · defensive — a natively-streaming model never fake-streams, so enabling it is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
5TTTFFstream_requestedExempted · defensive — a non-streaming request short-circuits to no fake-streaming, so enabling it without a stream request is unreachable in a correct build (reviewed: agent:claude-opus-4-8)
6TTTTTmodel_known

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.

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
0
Files
1
Tests
1
At-risk contracts
0

Files to re-check (1)

  • transformation.pylitellm/llms/openai/responses/transformation.py

Tests to re-run (1)

  • test_openai_responses_transformation.pytests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py

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.

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