-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature request: Add flag to show estimated AI token usage before run
Description
It would be useful to have an option to estimate the potential AI token cost before executing the translations.
This would help users decide whether to proceed, especially with large .po files or multiple languages.
Proposed behavior
- New CLI flag:
--estimate-cost(or something else) - When used, the tool should:
- Count the approximate tokens in the
.pofiles that would be sent for translation. - Multiply by the number of target languages (if
--bulkor multiple langs are used). - Use the selected model’s token pricing to show an estimated cost before starting translation.
- Ask for confirmation (e.g.,
Proceed? (y/n)) unless overridden by--yes.
- Count the approximate tokens in the
Example output
Estimated total tokens: 45,230 (all languages combined)
Model: gpt-4o-mini
Estimated cost: $1.23 (based on $0.0000275 / 1K tokens)
Proceed? (y/n)Benefits
- Allows cost control before committing to a run
- Prevents unexpected high charges
- Improves transparency for budget-conscious users
Additional considerations
- Token counting can be approximate (use
tiktokenor similar) - Should support multiple AI providers if the tool is expanded
- Could also display estimated per-language cost breakdown
pescheck-bram
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request