Add LLM cost change analysis to CI#737
Open
Jwrede wants to merge 1 commit into
Open
Conversation
Adds a CI workflow that runs tokentoll on pull requests to detect changes in LLM API calls (model swaps, new call sites, removed endpoints) and posts the cost impact as a PR comment. The action is pinned to SHA 753ca4d1150c74169b52a843439049b65e256d2b (v0.6.1) and installs tokentoll==v0.6.1 from PyPI. Zero runtime dependencies.
|
✔️ Propel has finished reviewing this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add tokentoll GitHub Action to analyze LLM API cost changes on pull requests.
When a PR modifies code that makes LLM API calls (model swaps, max_tokens changes, new call sites), tokentoll posts a comment showing the projected cost impact. It stays silent on PRs that don't touch LLM code.
What it detects
tokentoll uses Python AST analysis (zero runtime dependencies) to find calls to:
chat.completions.create,responses.create,embeddings.create)messages.create)generate_content)completion,embedding)ChatOpenAI,ChatAnthropic,init_chat_model)ZhipuAiClient,ZhipuAI)Current scan of this project
tokentoll Scan Report
api/agent/core/llm_utils.pyapi/agent/core/llm_utils.pyapi/agent/tools/outbound_duplicate_guard.pyconsole/api_views.pyscripts/marketing/email-campaign.pyscripts/prototype/agent.pyTotal estimated monthly cost: $232.16
Assumptions
Generated by tokentoll
How it works
Changes
.github/workflows/llm-costs.yml(17 lines)