Skip to content
This repository was 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
hanrelan wants to merge 1 commit intomainfrom
rohan/ratelimiting
Open

Adds token and request-based rate limiting with an example#29
hanrelan wants to merge 1 commit intomainfrom
rohan/ratelimiting

Conversation

@hanrelan
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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