-
-
Notifications
You must be signed in to change notification settings - Fork 581
Features/refactor llm cost #1024
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
Conversation
…atures/refactor-llm-cost
Auto Review Result: Code Review SummaryChange Overview: The code changes are aimed at enhancing the TokenStatsModel by incorporating more detailed input and output token tracking, including separate accounting for text and audio tokens. This improves accuracy in determining token usage costs for various input/output types in a machine learning context. Issues FoundIssue 1: Consistency Issue
Issue 2: Potential Null Reference
Overall EvaluationThe changes enhance the token management system by differentiating between text and audio tokens accurately. While the logic seems sound, particular attention should be paid to code consistency and avoiding potential null reference issues. Consider refactoring or encapsulating repetitive null handling code to improve readability and maintainability. |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨Explore these optional code suggestions:
|
PR Type
Enhancement, Bug fix
Description
Refactored LLM token and cost tracking for multimodal support
Updated all LLM provider plugins to use new token/cost fields
Adjusted configuration to new cost schema in
appsettings.json
Improved statistics and reporting logic for LLM usage and costs
Changes walkthrough 📝
17 files
Refactor token stats model for multimodal support
Redesign LLM cost model for detailed input/output
Update statistics logic for new token/cost fields
Update token stats usage to new fields
Use granular token fields for Azure OpenAI chat
Use new token fields for text completions
Update DeepSeekAI chat to new token/cost model
Use new token fields for DeepSeekAI text completions
Update Gemini chat to new token/cost fields
Use new token fields for Gemini text completions
Update LangChain provider to new token stats
Use new token fields for MetaGLM chat completions
Add detailed input/output token structures for OpenAI
Update OpenAI chat to use granular token fields
Use detailed token stats in real-time OpenAI completions
Use new token fields for OpenAI text completions
Update SparkDesk provider to new token fields
1 files
Rename variable for audio data clarity
1 files
Migrate LLM model cost config to nested Cost object