Skip to content

Add api_kwargs, flexible rate limits, and tokencost#59

Merged
Eric-Fithian merged 1 commit into
mainfrom
feature/api-kwargs-rate-limit-tokencost
Feb 24, 2026
Merged

Add api_kwargs, flexible rate limits, and tokencost#59
Eric-Fithian merged 1 commit into
mainfrom
feature/api-kwargs-rate-limit-tokencost

Conversation

@Eric-Fithian

Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • 34 new unit tests covering api_kwargs, rate limiter, and model price database
  • All existing tests pass

Made with Cursor

…t integration

- api_kwargs: pass arbitrary kwargs through to the instructor API call (closes #47)
- rate_limit_tokens/rate_limit_requests/rate_limit_period_seconds: replace
  tokens_per_minute/requests_per_minute with configurable time window (closes #58)
- tokencost: replace internal model pricing DB with tokencost package (closes #57)
- Handle oversized requests that exceed bucket capacity (negative bucket balance)
- Add floating-point epsilon guard in rate limiter comparisons
- Update all relevant docs
- Add unit tests for all three features (34 new tests)

Co-authored-by: Cursor <cursoragent@cursor.com>
@Eric-Fithian Eric-Fithian merged commit 829a44c into main Feb 24, 2026
2 checks passed
@Eric-Fithian Eric-Fithian deleted the feature/api-kwargs-rate-limit-tokencost branch February 24, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant