collab: Add granular tokens per minute columns to models table (#28090)

This PR adds new granular tokens per minute columns to the `models`
table in preparation for more fine-grained rate limits.

The following columns have been added:

- `max_input_tokens_per_minute`
- `max_output_tokens_per_minute`

These mirror the "Maximum input tokens per minute (ITPM)" and "Maximum
output tokens per minute (OTPM)" [rate limits from
Anthropic](https://docs.anthropic.com/en/api/rate-limits#rate-limits).

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-04-04 10:33:15 -04:00 committed by GitHub
parent 2f5a4f7e80
commit cf0d1e4229
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1,3 @@
alter table models
add column max_input_tokens_per_minute bigint not null default 0,
add column max_output_tokens_per_minute bigint not null default 0;

View file

@ -12,6 +12,8 @@ pub struct Model {
pub name: String,
pub max_requests_per_minute: i64,
pub max_tokens_per_minute: i64,
pub max_input_tokens_per_minute: i64,
pub max_output_tokens_per_minute: i64,
pub max_tokens_per_day: i64,
pub price_per_million_input_tokens: i32,
pub price_per_million_cache_creation_input_tokens: i32,