mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-14 09:03:16 +00:00
feat(model-catalog): read output_cost_per_video in the rust registry check (#51433)
* feat(model-catalog): read output_cost_per_video in the rust registry check Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(model-catalog): keep FLAT_KEY_PATTERN and the parser in agreement on output_cost_per_video Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
40debbb9c0
commit
41fa625322
3 changed files with 9 additions and 1 deletions
|
|
@ -50,6 +50,7 @@ pub enum OutputUnit {
|
|||
Pixel,
|
||||
Second(Option<Resolution>),
|
||||
VideoSecond,
|
||||
Video,
|
||||
BillableUnit,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ struct RegistryDocument {
|
|||
pub(crate) const FLAT_KEY_PATTERN: &str = concat!(
|
||||
r"^(",
|
||||
r"input_cost_per_((audio_|image_|video_)?token|character|image|pixel|query|request|second|text_message|audio_per_second|video_per_second(_above_\d+s_interval)?)",
|
||||
r"|output_cost_per_((audio_|image_|video_|reasoning_)?token|character|image(_\d+(\.\d+)?K?)?|pixel|second(_\d+[pk])?|video_per_second|billable_unit)",
|
||||
r"|output_cost_per_((audio_|image_|video_|reasoning_)?token|character|image(_\d+(\.\d+)?K?)?|pixel|second(_\d+[pk])?|video|video_per_second|billable_unit)",
|
||||
r"|cache_read_input_(audio_|image_|video_)?token_cost",
|
||||
r"|explicit_cache_read_input_token_cost",
|
||||
r"|cache_creation_input_(audio_|image_|video_)?token_cost(_above_1hr|_above_12hr)?",
|
||||
|
|
@ -204,6 +204,8 @@ mod tests {
|
|||
#[case::explicit_cache_read("explicit_cache_read_input_token_cost")]
|
||||
#[case::billable_unit("output_cost_per_billable_unit")]
|
||||
#[case::billable_unit_is_output_only("input_cost_per_billable_unit")]
|
||||
#[case::video("output_cost_per_video")]
|
||||
#[case::video_is_output_only("input_cost_per_video")]
|
||||
#[case::wall_clock("cost_per_second")]
|
||||
#[case::unused_meter("cost_per_token")]
|
||||
#[case::other_currency("input_dbu_cost_per_token")]
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ fn output_unit(unit: &str) -> Option<OutputUnit> {
|
|||
"pixel" => Some(OutputUnit::Pixel),
|
||||
"second" => Some(OutputUnit::Second(None)),
|
||||
"video_per_second" => Some(OutputUnit::VideoSecond),
|
||||
"video" => Some(OutputUnit::Video),
|
||||
"billable_unit" => Some(OutputUnit::BillableUnit),
|
||||
_ => None,
|
||||
}
|
||||
|
|
@ -314,6 +315,10 @@ mod tests {
|
|||
Some(TierSuffix::Batches)
|
||||
)
|
||||
)]
|
||||
#[case::video(
|
||||
"output_cost_per_video",
|
||||
key(Meter::Output(OutputUnit::Video), Band::Base, None)
|
||||
)]
|
||||
#[case::wall_clock("cost_per_second", key(Meter::WallClockSecond, Band::Base, None))]
|
||||
#[case::browser_open(
|
||||
"browser_open_cost_per_request",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue