Skip to content

Add --usage support#34

Merged
tonybaloney merged 12 commits intotonybaloney:mainfrom
cmbrose:cmbrose/usage
May 28, 2025
Merged

Add --usage support#34
tonybaloney merged 12 commits intotonybaloney:mainfrom
cmbrose:cmbrose/usage

Conversation

@cmbrose
Copy link
Contributor

@cmbrose cmbrose commented May 26, 2025

$ llm -m github/gpt-4o --usage "what's the best kind of cheese? No reasons, just pick it" --async
Gruyère.
Token usage: 21 input, 5 output
llm -m github/o3 --usage "what's the best kind of cheese? No reasons, just pick it" 
Comté
Token usage: 20 input, 85 output, {"completion_tokens_details": {"reasoning_tokens": 64}}

@tonybaloney
Copy link
Owner

please run ruff format and ruff check --fix on the code to get the CI to pass.

@tonybaloney
Copy link
Owner

Fantastic. This is a great contribution

@tonybaloney
Copy link
Owner

@cmbrose lmk if you're done then I'll merge this and ship it

@cmbrose
Copy link
Contributor Author

cmbrose commented May 28, 2025

Thanks @tonybaloney - I'm good to go here now. I tested all the models directly and they're all outputting usage no, except for the Phi vision model (which appears to be expected as it's unsupported)

@tonybaloney tonybaloney merged commit 9a62278 into tonybaloney:main May 28, 2025
5 checks passed
@cmbrose cmbrose deleted the cmbrose/usage branch May 28, 2025 14:08
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

Successfully merging this pull request may close these issues.

2 participants