How do I use @cloudflare/ai package with AI Gateway?
There's no docs for the package so I check the source code, but don't quite understand. The docs for AI Gateway only have http examples, no examples using this package.
4 Replies
It's for Workers AI: https://developers.cloudflare.com/workers-ai/
Workers AI · Cloudflare Workers AI docs
Workers AI allows you to run machine learning models, on the Cloudflare network, from your own code – whether that be from Workers, Pages, or anywhere …
If you wanted to use AI Gateway with Workers AI, my understanding is you can only do it via the http endpoint
https://developers.cloudflare.com/ai-gateway/providers/workersai/
they're working on some better integration with the binding: https://discord.com/channels/595317990191398933/1154819662161395742/1184158876837367859
thank you Chaika!