Repository navigation
Support usage.input_tokens and output_tokens fallback - #131
Merged
Merged
Conversation
Owner
Author
Live GPU smoke test on HF Jobs (
|
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.
Summary
usage.input_tokensandusage.output_tokensinsaturate.transport.usage_tokens()whenprompt_tokens/completion_tokensare absent ornull.input_tokens/output_tokensnaming convention — including OpenAI's/v1/responses, Anthropic's/v1/messages, and Flide's/v1/systemone— now populateStats.prompt_tokens,Stats.completion_tokens,Stats.tokens_per_sec, and controllertok_sobservations instead of reporting0.prompt_tokens/completion_tokenskeep precedence (including explicit0), and malformed non-Noneprimary values still clamp to0without falling back.Testing
tests/test_transport_retry.pycoveringinput_tokens/output_tokens, precedence, explicit0,Nonefallback, and malformed values.tests/test_run_stats.pyverifyingStatstotals,tokens_per_sec, and persisted telemetrytok_s > 0.764 passed),ruff check,ruff format --check, andty checkgreen./v1/systemone) running now (results will be added in a comment).