mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-05 01:59:27 +00:00
* fix(bedrock): keep native Llama stream usage and stop reason Native Bedrock Llama invoke streams dropped prompt_token_count, generation_token_count and stop_reason, so passthrough spend logged 0 prompt tokens and a capped stream logged "stop". The decoder now reports the provider's running counts once a prompt count has been seen, leaves usage unreported when the counts are absent so estimation still applies, and maps stop_reason. The Bedrock passthrough collector places that finish reason on the Llama choice. Fixes #51456 * fix(bedrock): keep Llama passthrough streams coalesced and stop-only streams unchanged Per-event Llama usage stopped the passthrough collector from folding text chunks, so retained chunks grew with the event count. The collector now keeps only the latest running counts beside the coalesced chunks and attaches them when the response is built, including for streams cut before the last event. The decoder only signals a stop reason that differs from the default "stop", so stop-only streams behave as before, and passes the raw generation value through unchanged. * test(bedrock): read optional stream chunk usage safely in the Llama sequence test * fix(bedrock): read Llama stream fields through a typed event boundary --------- Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| batches | ||
| chat | ||
| count_tokens | ||
| embed | ||
| files | ||
| image | ||
| image_edit | ||
| image_generation | ||
| invoke_agent | ||
| messages | ||
| passthrough | ||
| realtime | ||
| rerank | ||
| responses | ||
| search | ||
| vector_stores | ||
| __init__.py | ||
| event_loop_probe.py | ||
| slow_upstream.py | ||
| test_anthropic_beta_support.py | ||
| test_base_aws_llm.py | ||
| test_bedrock_common_utils.py | ||
| test_bedrock_model_listing.py | ||
| test_bedrock_ssl_verify.py | ||
| test_claude_platform_provider.py | ||
| test_converse_context_management.py | ||
| test_cost_calculation.py | ||
| test_cost_explorer.py | ||
| test_cross_region_inference_profile_mapping.py | ||
| test_guardrail_attachments.py | ||
| test_mantle.py | ||
| test_nova_imported_models.py | ||
| test_request_metadata.py | ||
| test_session_identity.py | ||
| test_web_identity_session_policy.py | ||