Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

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

Marshall Bowerscf0d1e4229ea
diff --git a/crates/collab/migrations_llm/20250404141155_add_granular_token_limits_to_models.sql b/crates/collab/migrations_llm/20250404141155_add_granular_token_limits_to_models.sql
new file mode 100644
index 00000000000..e5c50d83857
--- /dev/null
+++ b/crates/collab/migrations_llm/20250404141155_add_granular_token_limits_to_models.sql
@@ -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;
diff --git a/crates/collab/src/llm/db/tables/model.rs b/crates/collab/src/llm/db/tables/model.rs
index 6c521841854..3453c34726b 100644
--- a/crates/collab/src/llm/db/tables/model.rs
+++ b/crates/collab/src/llm/db/tables/model.rs
@@ -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,