Skip to content
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

🛠️ #46 inited the least latency routing #70

Merged
merged 25 commits into from
Jan 14, 2024

Conversation

roma-glushko
Copy link
Member

@roma-glushko roma-glushko commented Jan 11, 2024

Adding a new routing strategy to pick the least latency model. Adding simple coverage for some config building logic.

@roma-glushko roma-glushko marked this pull request as draft January 13, 2024 18:58
Copy link

codecov bot commented Jan 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2957360) 63.87% compared to head (c694cb2) 71.74%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #70      +/-   ##
===========================================
+ Coverage    63.87%   71.74%   +7.86%     
===========================================
  Files           27       30       +3     
  Lines         1182     1313     +131     
===========================================
+ Hits           755      942     +187     
+ Misses         381      317      -64     
- Partials        46       54       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@roma-glushko roma-glushko changed the title #46 inited the least latency routing 🛠️ #46 inited the least latency routing Jan 14, 2024
@roma-glushko roma-glushko marked this pull request as ready for review January 14, 2024 18:25
s.expireAt = time.Now().Add(*s.model.LatencyUpdateInterval())
}

// LeastLatencyRouting routes requests to the model that responses the fastest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how we can normalize this to the token count of the response because that seems to be the bottleneck is token generation takes a long time. Might be as simple as counting the generated tokens in the response and dividing it by the response time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are basically two options I see:

  • use the time to fist byte metric (needs to instrument clients to get that info)
  • or use the approach you described, then we are essentially calculating token generation velocity of each model.

I need to play with OpenAI API, for example, to see which approach makes sense here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a ticket not to forget about this: #78

@roma-glushko roma-glushko merged commit 6aec59f into develop Jan 14, 2024
7 checks passed
@roma-glushko roma-glushko deleted the 46-routing-least-latency-strategy branch January 14, 2024 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Least Latency Load Balancing
2 participants