[PR #2078] feat: introduce RPM rate limiting for providers/models pairs #10188

Closed
opened 2026-02-16 18:14:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/2078

State: closed
Merged: No


Summary

Rate limit handing is currently missing. This PR introduces per provider/model pair rate limiting through the config file, adding the rpm field to limit.

Implementation is simple, it sleeps the request that would cause limiting in order to stay in the "message flow" so you don' t have to wait and re-prompt the model after you've hit limits.

"provider": {
    "google": {
      "models": {
        "gemini-2.5-pro":{
          "limit":{
            "rpm": 10
          }
        }
      }
    }
  }

The status bar has also been updated to show the ETA of the next request when being limited

image

Notes

I'm unsure if rpm should be nested under a rate object or not @thdxr ?

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/2078 **State:** closed **Merged:** No --- ## Summary Rate limit handing is currently missing. This PR introduces per provider/model pair rate limiting through the config file, adding the `rpm` field to `limit`. Implementation is simple, it sleeps the request that would cause limiting in order to stay in the "message flow" so you don' t have to wait and re-prompt the model after you've hit limits. ```json "provider": { "google": { "models": { "gemini-2.5-pro":{ "limit":{ "rpm": 10 } } } } } ``` The status bar has also been updated to show the ETA of the next request when being limited <img width="129" height="79" alt="image" src="https://github.com/user-attachments/assets/c610db8c-1e85-48be-a626-986a14d12a2e" /> ### Notes I'm unsure if `rpm` should be nested under a `rate` object or not @thdxr ?
yindo added the pull-request label 2026-02-16 18:14:48 -05:00
yindo closed this issue 2026-02-16 18:14:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10188