Every model provider rate-limits you, and the good ones use a token bucket rather than a fixed window: because real traffic is bursty and a fixed window punishes a burst that the system could easily have absorbed.
Write token_bucket(timestamps, costs, rate, capacity) returning a list of booleans, one per request.
The bucket starts full at capacity. Between consecutive requests it refills continuously at rate tokens per second, never above capacity. A request costs costs[i] tokens: if that many are available it is allowed and they are deducted, otherwise it is rejected and nothing is deducted.
timestamps are seconds, non-decreasing. This is why cost is a parameter rather than always 1: a 4,000-token completion should not cost the same as a 20-token one.
Build the architecture on a canvas: place the components, configure them, connect them into a data flow, and write a short reason for each one. The AI reviewer grades your design against a rubric written specifically for this problem.
Minimum 5 components · needs a wide desktop screen