Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Adds token and request-based rate limiting with an example #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hanrelan
Copy link
Collaborator

The rate limits on OpenAI seem a little wonky. Not sure if that's only true for Codex or for all the models but I was definitely getting rate limited even when using less than half the requests per minute.

But it's better than nothing (maybe?)

@vercel
Copy link

vercel bot commented Feb 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
docs-promptable ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 17, 2023 at 6:32AM (UTC)

@mathisobadia
Copy link
Contributor

I think this is useful but limited. The issue is that in a serverless environment (like nextjs api functions) every api call is made in a different lambda function that has no knowledge of the other lambdas so this will rate limit individual lambda functions but we can still have like 100 lambda functions doing api calls at the same time and getting rate limited. To account for that the only solution is some kind of retry with exponential back off.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants