Get the latest tech news

Modelling API rate limits as diophantine inequalities


viveknathani - blog

But before we dive into the scheduling logic, let’s take a short detour into something older and surprisingly relevant: Diophantine equations. This way, we keep track of the range of requests that fall within any given window as we move through the sorted list. We shift the window forward as needed, reusing previous work and avoiding redundant scans.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of API

API

Photo of API rate limits

API rate limits

Related news:

News photo

OpenAI’s API lead explains how enterprises are already succeeding with its Agents SDK and Responses API

News photo

The time is right for a DOM templating API

News photo

Dynamic YAML with Python computed properties for fusing API workflows and SQL