Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] --json: Save metadata as JSON #609

Open
NightMachinery opened this issue Nov 5, 2024 · 0 comments
Open

[FR] --json: Save metadata as JSON #609

NightMachinery opened this issue Nov 5, 2024 · 0 comments

Comments

@NightMachinery
Copy link

I like to track usage costs. Previously, I manually counted the tokens in the inputs and outputs. However, now that models support multimedia input/output, reasoning tokens, and more, my previous approach is no longer feasible. It would be helpful to provide a --json (e.g., --log-json, --json-out, etc.) option that saves the input/output token count and other metadata to a JSON file. This way, my wrapper can read the exact token usage and compute the costs accordingly.

Including the inputs and outputs in this file would also make it useful for logging. In general, this file offers a way to output information without cluttering stdout and hindering interactive, streaming usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant