Hacker News new | ask | show | jobs
by yding 1165 days ago
Great! Vercel edge functions are my preferred deployment for OpenAI calls now.
2 comments

Is 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.
Yup! 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.
Do you have an example of this? Is authorization a part of vercel?
Yes, 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

If you want to try streaming you can take a look at the readpanda repo.

OK technically not Vercel, but https://next-auth.js.org/
There are a bunch of examples here https://vercel.com/templates/ai