zed/crates/collab/migrations_llm
Marshall Bowers f861479890
collab: Update billing code for LLM usage billing (#18879)
This PR reworks our existing billing code in preparation for charging
based on LLM usage.

We aren't yet exercising the new billing-related code outside of
development.

There are some noteworthy changes for our existing LLM usage tracking:

- A new `monthly_usages` table has been added for tracking usage
per-user, per-model, per-month
- The per-month usage measures have been removed, in favor of the
`monthly_usages` table
- All of the per-month metrics in the Clickhouse rows have been changed
from a rolling 30-day window to a calendar month

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Max <max@zed.dev>
2024-10-08 18:29:38 -04:00
..
20240806182921_create_providers_and_models.sql
20240806213401_create_usages.sql
20240809130000_change_rate_limit_columns_to_bigint.sql
20240809160000_add_pricing_columns_to_models.sql
20240812184444_add_is_staff_to_usages.sql
20240812225346_create_lifetime_usages.sql
20240813002237_add_revoked_access_tokens_table.sql collab: Add ability to revoke LLM service access tokens (#16143) 2024-08-12 21:47:05 -04:00
20241007173634_add_cache_token_counts.sql collab: Track cache writes/reads in LLM usage (#18834) 2024-10-07 17:32:49 -04:00
20241007220716_drop_incorrect_usages_columns.sql collab: Drop mistakenly-added columns from the usages table (#18835) 2024-10-07 18:21:48 -04:00
20241008155620_create_monthly_usages.sql collab: Update billing code for LLM usage billing (#18879) 2024-10-08 18:29:38 -04:00