-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
collab: Track cache writes/reads in LLM usage (#18834)
This PR extends the LLM usage tracking to support tracking usage for cache writes and reads for Anthropic models. Release Notes: - N/A --------- Co-authored-by: Antonio Scandurra <[email protected]> Co-authored-by: Antonio <[email protected]>
- Loading branch information
1 parent
c5d252b
commit d55f025
Showing
9 changed files
with
241 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
crates/collab/migrations_llm/20241007173634_add_cache_token_counts.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
alter table models | ||
add column price_per_million_cache_creation_input_tokens integer not null default 0, | ||
add column price_per_million_cache_read_input_tokens integer not null default 0; | ||
|
||
alter table usages | ||
add column cache_creation_input_tokens_this_month bigint not null default 0, | ||
add column cache_read_input_tokens_this_month bigint not null default 0; | ||
|
||
alter table lifetime_usages | ||
add column cache_creation_input_tokens bigint not null default 0, | ||
add column cache_read_input_tokens bigint not null default 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.