Repository navigation
ci: run the standard logging payload stack (never merge) - #54524
Draft
narmstrong-berri wants to merge 10 commits into
Draft
narmstrong-berri wants to merge 10 commits into
narmstrong-berri wants to merge 10 commits into
Conversation
… and params on the call record
…gging payload The call record keeps the answer that served a /v1/messages call: a complete answer's body, or what a stream's events add up to as they pass. The new litellm-standard-logging messages_response module turns either into the chat ModelResponse Python logs for anthropic_messages, as model_dump() writes it: AnthropicConfig.transform_response for a complete answer, and the Anthropic passthrough handler's chunk parser plus stream_chunk_builder for a stream. Both shapes are pinned against model_dump() output captured from Python.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
callbacks/standard_logging.rs ports get_standard_logging_object_payload and its StandardLoggingPayloadSetup helpers for a /v1/messages call the gateway served or failed: standard_logging_payload reads the call's record (request facts, logged request, served message, failure, attempts, charged key) plus the deployment a failed call last ran on and Python's redact_string, and returns the typed StandardLoggingPayload. Tests build the record for the unary, stream, provider 4xx and key limit 429 goldens and compare the rendered bytes, taking the times and the cost keys from the golden. standard-logging gains get_additional_headers and process_anthropic_headers for hidden_params.additional_headers, CallFailure::Raised keeps the headers its exception carries, and Routing names the deployment a call last ran on. Nothing calls the builder yet.
…s3_v2 on the gateway A gateway callback that reads the standard logging payload now gets it from a Rust payload host. The payload is built once per hook from the call's record when a callback on that hook reads it, held by handle, rendered as the standard-logging crate's wire JSON with the null keys the Python host sets, and released when the last reference drops. The JSON copy and the log id are derived from the same payload The config's s3_v2 callback is built from s3_callback_params and the constants S3Logger reads from the environment, runs in the config's callback order, and is flushed on DEFAULT_S3_FLUSH_INTERVAL_SECONDS, when its config is replaced and at shutdown. Admit honors s3_v2 and its params, and sends a config to Python when s3_v2 is named twice, its params are not a mapping, or they ask for a web identity token, base64 stripping or their own TLS verification
…ages for calls refused before an attempt The Rust payload host now renders through litellm-python-compat's new json::dumps_serde, json.dumps's default layout over a serde value: ", " and ": " separators, ensure_ascii escapes with surrogate pairs, and Python's float repr. Each standard-logging golden's json.dumps bytes, captured from CPython, pin the rendered payloads LoggedRequest::sent now logs what _handle_logging_proxy_only_error logs for a call refused before its first attempt: the body's messages without its system prompt, which never reaches the logged kwargs, and the body's stream as the only model parameter. An attempt overwrites both as before. The key limit 429 builder test takes them from the real path
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Never merge. CI only runs on PRs into main, so this draft points at the top of the standard logging payload stack (#54516 to #54521 and the PRs above them) to run the Rust and Python suites on all of it at once