litellm/litellm/rust_bridge
Kerry Lu 07c7229895
feat(proxy): per-request header opts a stream into usage.cost without the global include_cost_in_streaming_usage flag (#50574)
* feat(proxy): let one streaming request opt into usage.cost with x-litellm-include-cost-in-streaming-usage

The global include_cost_in_streaming_usage flag moved every stream off the
fast path. A request can now send x-litellm-include-cost-in-streaming-usage: true
to get usage.cost on its usage-carrying stream event (/v1/messages and the
Anthropic and OpenAI pass-throughs) while requests without the header keep the
fast path. The global flag keeps working unchanged.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test: type the new stream cost header tests

* fix(types): keep reportUnknownArgumentType at its merge-base count

* fix(proxy): the stream cost header only accepts true

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-07 16:57:20 -08:00
..
chat_completions feat: add OpenRouter-style -latest model aliases for first-party providers (#50315) 2026-11-06 18:22:38 +08:00
embeddings refactor(rust-bridge): return an unstarted Execution from native entrypoints and drive it in Python (#46299) 2026-10-14 17:50:44 -07:00
host fix(anthropic): disable optional default thinking for reasoning effort none (#50541) 2026-11-07 12:51:37 -08:00
messages feat(proxy): per-request header opts a stream into usage.cost without the global include_cost_in_streaming_usage flag (#50574) 2026-11-07 16:57:20 -08:00
ocr refactor(rust-bridge): move the route host modules under host/routes (#46786) 2026-10-15 18:27:06 -07:00
responses refactor(prompt_templates): move JSON schema helpers out of common_utils into json_schema_utils (#50241) 2026-11-05 17:25:53 -08:00
transcription refactor(rust-bridge): unify native call inputs and Messages settings (#45126) 2026-10-07 15:05:43 -07:00
__init__.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
_native.pyi fix(redis): share one native circuit breaker between RedisCache and the Rust stores (#50473) 2026-11-07 17:50:06 +09:00
AGENTS.md refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
bindings.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
catalog.py feat(proxy): per-request header opts a stream into usage.cost without the global include_cost_in_streaming_usage flag (#50574) 2026-11-07 16:57:20 -08:00
clickhouse.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
configuration.py feat(tokenizer): preserve Python defaults with opt-in Rust dispatch (#42174) 2026-09-22 04:41:11 +00:00
detectors.py feat: add OpenRouter-style -latest model aliases for first-party providers (#50315) 2026-11-06 18:22:38 +08:00
diagnostics.py refactor(rust-bridge): remove the LoggerRule concept from the catalog (#46711) 2026-10-15 17:49:51 +00:00
dispatch.py refactor(rust-bridge): detect Python-only features in the catalog instead of Rust declines (#46714) 2026-10-20 15:06:25 -07:00
execution.py refactor(rust-bridge): return an unstarted Execution from native entrypoints and drive it in Python (#46299) 2026-10-14 17:50:44 -07:00
failures.py chore(lint): remove the LIT002 mutable-construction rule (#43971) 2026-10-01 12:24:02 -07:00
fork_guard.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
logger.py feat(redis): extend the native Redis foundation for the store families (#50169) 2026-11-06 12:30:07 +09:00
preflight.py refactor(rust): move credential inheritance and the SDK limits out of the legacy callback crate into a driver preflight (#43259) 2026-09-26 01:09:36 +00:00
public_call.py refactor(rust-bridge): detect Python-only features in the catalog instead of Rust declines (#46714) 2026-10-20 15:06:25 -07:00
response_metadata.py refactor(router): route the router family through RoutingContext and close the outside surface (#49118) 2026-10-30 19:18:54 -07:00
runtime.py refactor(rust-bridge): require the native extension (#48852) 2026-10-28 13:16:56 -07:00
token_counter.py feat(tokenizer): preserve Python defaults with opt-in Rust dispatch (#42174) 2026-09-22 04:41:11 +00:00
tokenizer.py refactor(sdk): separate core AWS and tokenizer dependencies (#44447) 2026-10-08 19:07:57 -07:00