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

feat: Add Cloudflare AI Provider #817

Merged
merged 10 commits into from
May 30, 2024
Merged

Conversation

jacobdr
Copy link
Contributor

@jacobdr jacobdr commented May 25, 2024

Closes #647

Cloudflare Workers AI provider implementation

===

This is a work in progress I wanted to put up for initial feedback. I still need to test it a bunch more locally and update the docs as well.

@jacobdr
Copy link
Contributor Author

jacobdr commented May 25, 2024

@typpo Anything else major besides docs that you think might be missing, assuming a correct implementation on my part of the CF API calls?

@jacobdr jacobdr changed the title WIP: Initial cloudflare provider implementation WIP: feat: Add Cloudflare AI Provider May 25, 2024
@jacobdr
Copy link
Contributor Author

jacobdr commented May 25, 2024

Note to self, look at https://github.com/promptfoo/promptfoo/pull/711/files for inspiration on examples + docs

@jacobdr
Copy link
Contributor Author

jacobdr commented May 25, 2024

@typpo the line changes related to formatting are due to VS code auto-format. I tried to remove then by running npm run format but that command generated a MASSIVE diff so I think you might want to consider enforcing the styling in CI in a separate effort

@typpo
Copy link
Collaborator

typpo commented May 25, 2024

Nice change! This looks pretty much ready to go. Hopefully @CamdenClark can find the time to verify this weekend, otherwise I'll figure out how to get myself set up on Cloudflare AI :)

@CamdenClark
Copy link
Contributor

Nice change! This looks pretty much ready to go. Hopefully @CamdenClark can find the time to verify this weekend, otherwise I'll figure out how to get myself set up on Cloudflare AI :)

I got to it! It works on my machine!

Thanks for taking this up, I got super distracted and forgot to do it 😓

In the future it would be cool to get LoRA support but that's not necessary to merge in my opinion.

Feel free to tag me on a non-draft PR if you want another review.

@CamdenClark
Copy link
Contributor

CamdenClark commented May 25, 2024

one other thing you might want to know -- I had to build promptfoo on a new machine with node 22 and I got some weird C++ errors with better-sqlite. Might want to put a note recommending node 20. (Unrelated to this PR specifically)

@jacobdr
Copy link
Contributor Author

jacobdr commented May 29, 2024

@CamdenClark thanks for testing for me....

@typpo im working now on the docco after fixing the failing tests today. Would you mind please re-triggering the CI test workflow so that I can verify that worked? Assuming thats green, and once I push one more commit for the docs and a few more examples, then this should be good to go (though I'll do a final rebase against master before un-drafting it)

@jacobdr jacobdr changed the title WIP: feat: Add Cloudflare AI Provider feat: Add Cloudflare AI Provider May 29, 2024
@jacobdr jacobdr marked this pull request as ready for review May 29, 2024 19:41
@jacobdr
Copy link
Contributor Author

jacobdr commented May 29, 2024

@typpo this is now done and awaiting final review + green CI

Copy link
Collaborator

@typpo typpo left a comment

Choose a reason for hiding this comment

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

This change looks excellent! Nice work! Just waiting for green CI and will land it ✨

@typpo typpo merged commit dad977d into promptfoo:main May 30, 2024
9 checks passed
@typpo
Copy link
Collaborator

typpo commented May 30, 2024

🎉 Amazing work @jacobdr and thanks @CamdenClark for helping too!

@jacobdr jacobdr deleted the add-cloudflare-provider branch May 30, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Cloudflare Workers AI
3 participants