ollieb89/llm-cost-tracker
Track LLM API costs in CI pipelines and alert on budget overruns
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| provider | LLM provider: openai | anthropic | google | cohere | no | — |
| model | Model name (e.g. gpt-4o, claude-sonnet-4, gemini-2.5-flash) | no | — |
| input-tokens | Number of input/prompt tokens used | no | — |
| output-tokens | Number of output/completion tokens used | no | — |
| budget-limit | Budget limit in USD per run. Set to trigger alerts. | no | — |
| on-budget-exceeded | Action on budget breach: warn | fail | comment. Default: warn | no | warn |
| post-comment | Post a cost report as a PR comment. Default: false | no | false |
| log-file | Path to CI log file to scan for LLM usage patterns | no | — |
| output-file | Path to write cost report JSON or CSV artifact | no | — |
| github-token | GitHub token for PR comments (required if post-comment: true) | no | ${{ github.token }} |
Outputs
| name | description |
|---|---|
| cost-usd | Total cost in USD for this run |
| total-tokens | Total tokens consumed (input + output) |
| budget-remaining | Remaining budget in USD (empty if no budget set) |
| budget-exceeded | Whether the budget was exceeded (true/false) |