ZIm/crates/collab/migrations_llm/20240806182921_create_providers_and_models.sql
Max Brunsfeld 06625bfe94
Apply rate limits in LLM service (#15997)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-08 15:46:33 -07:00

19 lines
650 B
SQL

create table if not exists providers (
id serial primary key,
name text not null
);
create unique index uix_providers_on_name on providers (name);
create table if not exists models (
id serial primary key,
provider_id integer not null references providers (id) on delete cascade,
name text not null,
max_requests_per_minute integer not null,
max_tokens_per_minute integer not null,
max_tokens_per_day integer not null
);
create unique index uix_models_on_provider_id_name on models (provider_id, name);
create index ix_models_on_provider_id on models (provider_id);
create index ix_models_on_name on models (name);