Files
litellm/tests/test_litellm
mateo-berri b64b732772 fix(translation): take critic-grok M1-M4 and verifier-grok F1/F2 (+ NITs N1, N2, N4, N5)
M1: the use_xai_oauth guard arm is documented as defense-in-depth (it is
unreachable through _raw_openai_body: litellm param, never in
non_default_params); the REAL protection is now a HARD seam obligation in
CLAUDE.md (route the kwarg or fall back pre-deps, pinned at completion()
level before flag-on) and test_use_xai_oauth_guard_reachability_facts pins
the classification facts the analysis rests on.
M2: usage token coercion now mirrors v1's int(x or 0) exactly — numeric
strings and bools fold, uncoercible values are typed boundary errors (loud
where v1 raises out of chunk_parser / Usage validation, never a silent 0);
two-sided corpus row numeric_string_usage_coerced plus loud-on-both-sides
rows for response and stream, and a fold-equality row against v1's own
static methods.
M3: one make_parse_line(parse_event) factory in openai_compat/stream.py;
openai/azure/xai all compose it (copies 1-3 deleted) before the long-tail
waves template off this port.
M4: test_supported_list_mirrors_track_v1_at_head pins supports_stop /
supports_reasoning against XAIChatConfig.get_supported_openai_params for
EVERY xai chat model in the map at HEAD, plus the params v2 emits
unconditionally staying in v1's supported list.
F1 (verifier, refutes a report claim): v1 FORWARDS a stream refusal that
rides a role/content delta (only refusal-only deltas are swallowed); the
parser now forwards it verbatim when the wire key is present; pinned by
the refusal_rides_content_deltas two-sided row. The false 'wrapper drops
refusal' claim is corrected in code comments and the report.
F2 (verifier): folded usage attaches ONLY to the choices:[] tail; v1's
wrapper strips usage from every emitted content/finish chunk; pinned by
usage_withheld_on_content_chunks (the fold still runs, so uncoercible
values stay loud).
N1: _contains_strict_key fails CLOSED at the recursion cap. N2: inbound
fold docstrings cover the xai dialect. N4: Block import at module top.
N5: the xai/-prefix capability trap is asserted, not just narrated.
Differential report regenerated: 336 IDENTICAL / 78 FALLBACK / 0 divergent.
2026-06-12 09:18:50 +00:00
..
2026-06-10 10:34:07 -07:00
2026-06-08 13:49:52 -07:00
2026-03-27 21:21:43 +05:30
2026-02-27 13:33:34 +05:30
2026-05-18 16:27:44 -07:00
2026-06-10 10:34:07 -07:00
2026-03-28 19:17:38 -07:00

Testing for litellm/

This directory 1:1 maps the the litellm/ directory, and can only contain mocked tests.

The point of this is to:

  1. Increase test coverage of litellm/
  2. Make it easy for contributors to add tests for the litellm/ package and easily run tests without needing LLM API keys.

File name conventions

  • litellm/proxy/test_caching_routes.py maps to litellm/proxy/caching_routes.py
  • test_<filename>.py maps to litellm/<filename>.py