mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
* perf(rust): store the sent wire bytes as the Messages request instead of re-serializing The Rust /v1/messages path handed record_response the body as a Python dict, and Python ran json.dumps on the whole body again to build httpx_response.request. Rust now keeps the bytes it serialized for the final attempt and passes them through, so the stored request is exactly what the provider received and Python does no extra full-body serialization. The hosted transport path sends the same Rust bytes instead of a second Python json.dumps. This also fixes the stored request after a retry with a wide int, NaN or Infinity, which previously carried the internal marked string instead of the real value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bne5zRJx1T5sEYBcsGtvqx * perf(rust): serialize the Messages logged input in Rust instead of json.dumps messages_input ran json.dumps on the whole pre_call body in Python for every Rust /v1/messages request. Rust now serializes it with the same raw_json writer it uses for the wire, at the same point (after caller substitution, before Logging.pre_call), so callback edits still reach the wire but not the logged input. Python only returns the top-level key order, with the handler signature read once, and top-level scalars keep the caller's own spelling. The logged input string becomes compact JSON with raw UTF-8. Top-level key order and values are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bne5zRJx1T5sEYBcsGtvqx * fix(rust): keep body keys missing from the order list in the Messages logged input The logged input only wrote keys named by Python's order tuple, so a key left out of that tuple would vanish from the log without an error. Keys the order does not name now follow in their sent order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bne5zRJx1T5sEYBcsGtvqx --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cache | ||
| chat_completions | ||
| embeddings | ||
| messages | ||
| ocr | ||
| responses | ||
| support | ||
| tokenizer | ||
| AGENTS.md | ||
| conftest.py | ||
| test_clickhouse_spend.py | ||
| test_dispatch.py | ||
| test_fork_guard.py | ||
| test_public_entries.py | ||