-
-
Notifications
You must be signed in to change notification settings - Fork 311
Use Converse API for Bedrock provider #377
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: main
Are you sure you want to change the base?
Conversation
crmne
left a comment
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.
Adding Converse API is a great idea but this PR has significant issues:
- No tests!
- Code complexity
- It doesn't follow the lead of the other providers in terms of method names, modules, etc.
- Overcommit was not installed
|
@crmne Several changes made per your comments. Well tested and ready for review. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #377 +/- ##
=======================================
Coverage 84.57% 84.57%
=======================================
Files 37 37
Lines 1932 1932
Branches 499 499
=======================================
Hits 1634 1634
Misses 298 298 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
crmne
left a comment
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 is a big patch @richet so thank you for the effort but there are still significant changes needed:
I still see that the organization of the code, especially in chat.rb, doesn't respect the organization of the other providers. There are a ton of methods there that belong in other modules in a provider implementation. Check the OpenAI provider for an example of what belongs where. I'll resume reviewing it when that's done.
Thank you again for the monumental effort.
|
@crmne Thanks for the review and pushing me to clean this up a bit more. I renamed and cleaned up a lot of the methods to a point where I think its close to what you have in OpenAI. |
|
@crmne The VCR cassettes seem to conflict when your main branch is updated so I have fixed them again and hopefully this one could be reviewed again soon 🤞 |
| RSpec.describe RubyLLM::Chat do | ||
| include_context 'with configured RubyLLM' | ||
|
|
||
| # Helper to mitigate Bedrock rate limits in CI by retrying with backoff |
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.
We only need this and the test delays when recording VCRs right? Would be nice to isolate it somehow. Bedrock is a bit of a pain isn't it?
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.
Yes thats correct. This PR also keeps getting merge conflicts due to the cassettes also.
I've been running this fork in prod for about a month now using Haiku 3.5 and Sonnet 4 in the AWS APAC region. |
I use those models on Bedrock with RubyLLM without these changes. Isn't this for other non-Anthropic models? |
|
I havent looked at the source for the last month but unless something has changed it is currently pinned to the US region models. In my case we have to use APAC. We also found that our rate limits using the Converse endpoint are larger than Invoke which are the main changes this PR makes. The ability to use all of the other models due to the Converse endpoint usage is a bonus. |
|
FYI and for others, #338 did get merged. |
|
I'm a longtime lurker in this thread 😁
I'd like to use the Amazon Nova models. I'm already using them directly via AWS SDk / Converse and they're good enough my uses (summarization, translation, vision model) for how inexpensive they are. |
|
Awesome. Considering bringing this into my fork soon and just trying to gauge interest. |
We are also primarily looking to use the Anthropic models, so we can also access them via the current invoke implementation. As context for my original question - we’d like to build on top of Ruby LLM, and there are a couple of features we were hoping to contribute back. Before we start that work, we want to make sure we’re targeting the right baseline. Since this PR is a significant change for the Bedrock provider, it'd be ideal if this was merged in first. After researching a bit more though, I'm realizing the features that are most pressing for us may actually be accessible via the current We would still love to help move the bedrock provider forward though -- regardless of which API endpoint makes the most sense for RubyLLM's broader goals -- and will keep following along. Thanks! |
What this does
Type of change
Scope check
Quality check
overcommit --installand all hooks passmodels.json,aliases.json)API changes
Related issues