Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Provide usage details in OpenAI-compatible /chat/completions and /embeddings endpoints#5204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
greg80303 wants to merge1 commit intotensorzero:main
base:main
Choose a base branch
Loading
fromgreg80303:usage_details

Conversation

@greg80303
Copy link

@greg80303greg80303 commentedDec 15, 2025
edited by ellipsis-devbot
Loading

This PR add details usage data (cached prompt tokens, etc) to the OpenAI inference endpoints. Tried to add support for as many model providers as I could, looking for how each model provider returns this information.

Did not touch the native T0 API. Also did not check the OpenAI/responses API -- this might make the implementation more complete (at least from the OpenAI API perspective).


Important

Enhance OpenAI-compatible endpoints with detailed token usage information, including cached and reasoning tokens, across various providers.

  • Behavior:
    • Adds detailed token usage information to OpenAI-compatible endpoints (/chat/completions and/embeddings).
    • Includes fields forcached_tokens,reasoning_tokens,audio_tokens,accepted_prediction_tokens, andrejected_prediction_tokens.
    • Details are conditionally included based on provider support.
  • Models:
    • UpdatesUsage struct inusage.rs to includeinput_tokens_details andoutput_tokens_details.
    • AddsInputTokensDetails andOutputTokensDetails structs for detailed token breakdown.
  • Documentation:
    • Updatesinference-openai-compatible.mdx anddata-model.mdx to document new usage details.
    • Addsusage-details.mdx to explain token usage details and provider support.
  • Tests:
    • Modifies tests inexact_match.rs,tests.rs, and other files to validate new usage details.
    • Adds tests for strict summation of usage details and JSON serialization behavior.

This description was created byEllipsis for5bfc8cd. You cancustomize this summary. It will automatically update as commits are pushed.

ellipsis-dev[bot] reacted with rocket emoji
@github-actions
Copy link
Contributor

github-actionsbot commentedDec 15, 2025
edited
Loading

All contributors have signed the CLA ✍️ ✅
Posted by theCLA Assistant Lite bot.

@greg80303
Copy link
Author

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

@GabrielBianconiGabrielBianconi

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@greg80303@GabrielBianconi

[8]ページ先頭

©2009-2025 Movatter.jp