mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-13 17:10:08 +00:00
6eb8c25e88
M4 (signed off at integration per the PR #30138 tenet clause): a quirky compat finish value fired a typed error AFTER the request was sent and billed, where no v1 fallback exists; v1 is deliberately lenient there (map_finish_reason + native stash). The native string now rides the wire body/chunk verbatim and BOTH sides normalize through the live Choices/StreamingChoices map_finish_reason, so v2 inherits v1's lenient mapping with no mirror table. Loud errors stay for semantics-changing shapes (n>1, legacy function_call output/delta/finish, audio, logprobs). New differential rows pin mapped ("eos") and unmapped finish strings on the response path and an "eos" stream replayed through the SDK's lenient construct_type (the production seam; model_validate would reject what the SDK serves). M1: the frozenset-membership narrowing that needed `type: ignore` in the strict zone is gone; the semantic IR finish narrows through a literal match (_semantic_finish), no suppressions left in the package.
Testing for litellm/
This directory 1:1 maps the the litellm/ directory, and can only contain mocked tests.
The point of this is to:
- Increase test coverage of
litellm/ - 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.pymaps tolitellm/proxy/caching_routes.pytest_<filename>.pymaps tolitellm/<filename>.py