-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
fix: Use eval_duration for output TPS calculations in Ollama LLM provider #4568
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
base: master
Are you sure you want to change the base?
fix: Use eval_duration for output TPS calculations in Ollama LLM provider #4568
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, refactored to work with streaming and utilizes LLMPerformanceMonitor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR does not address duration timing in measureAsyncFunction and if we are going to fix it, we should do so in both places.
We should also either have duration be an override-able property in the PerformanceMontior or just change it specifically in Ollama's AI provider so its impact is limited.
If we make changes to the entire utility then we cannot be sure what the side-effects are.
Since we are going to override eval_duration it should be a custom property name so that it does not get confused with the actual value from ollama if we ever want to try to use it in another place.
Pull Request Type
Relevant Issues
resolves #4567
What is in this change?
What is in this change?
LLMPerformanceMonitorto support provider duration timing for more accurate output TPS calculationsmeasureAsyncFunctionacceptsdurationfromoutput.usage.durationmeasureStreamto acceptdurationfromreportedUsage.durationif provided by the LLM providereval_durationfor more accurate TPS calculationThis is a generic enhancement that any provider can leverage to supply more accurate timing information, while maintaining backward compatibility with providers that don't supply duration metrics.
Developer Validations
yarn lintfrom the root of the repo & committed changes