4 ms·
Great! Vercel edge functions are my preferred deployment for OpenAI calls now.
by yding 3y ago
Great! Vercel edge functions are my preferred deployment for OpenAI calls now.
- apineda 3y agoDo you have an example of this? Is authorization a part of vercel?
- cramforce 3y agoThere are a bunch of examples here https://vercel.com/templates/ai https://vercel.com/templates/ai
- yding 3y agoYes, although we haven't added authorization yet. This is the simplest I could get it: still uses the OpenAI npm package and doesn't need streaming: https://github.com/yisding/gpt-edge-test https://github.com/yisding/gpt-edge-test If you want to try streaming you can take a look at the readpanda repo.
- yding 3y agoOK technically not Vercel, but https://next-auth.js.org/ https://next-auth.js.org/
- BoorishBears 3y agoIs there any other (realistic) option? Afaik if you don't make them edge calls, you'll get charged more money by Vercel for compute than OpenAI will charge you for the actual request.
- yding 3y agoYup! Not just Vercel. The entire industry is on the GB-s billing model, which doesn't make sense if you're just waiting for requests to come back and forth.