From 77efb01bd8fdd04db68238ca47e3f402fc55d3d6 Mon Sep 17 00:00:00 2001 From: roasted-penguin <43606521+roasted-penguin@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:58:33 +0900 Subject: [PATCH] fix(model-catalog): declare the cache_storage_cost_per_token_per_hour key The Rust model catalog files any key it does not know under problems, so the cost map entries that carry the Vertex/Gemini context cache storage rate fail the bundled registry check. Declare the key as a UnitPrice attribute, the same way thinking_on_by_default was declared. --- litellm-rust/crates/model-catalog/src/wire/attributes.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litellm-rust/crates/model-catalog/src/wire/attributes.rs b/litellm-rust/crates/model-catalog/src/wire/attributes.rs index 401634f8c62..195d5bc9c0f 100644 --- a/litellm-rust/crates/model-catalog/src/wire/attributes.rs +++ b/litellm-rust/crates/model-catalog/src/wire/attributes.rs @@ -53,6 +53,8 @@ attributes! { bedrock_converse_supports_strict_tools: bool, /// Highest reasoning effort the Bedrock output_config accepts for this model. bedrock_output_config_effort_ceiling: EffortLevel, + /// USD per token per hour to keep an explicitly created context cache stored. + cache_storage_cost_per_token_per_hour: UnitPrice, comment: String, /// Reasoning effort the provider applies when the request omits reasoning_effort. Gates whether a non-default temperature or the top_p/logprobs sampling params are accepted, which hold only when the effort resolves to 'none'. default_reasoning_effort: EffortLevel, @@ -313,6 +315,8 @@ mod tests { #[case::deprecation_source_not_a_url_string("deprecation_source", json!(7), false)] #[case::thinking_on_by_default("thinking_on_by_default", json!(true), true)] #[case::thinking_on_by_default_not_a_flag("thinking_on_by_default", json!("yes"), false)] + #[case::cache_storage_rate("cache_storage_cost_per_token_per_hour", json!(4.5e-6), true)] + #[case::negative_cache_storage_rate("cache_storage_cost_per_token_per_hour", json!(-1), false)] #[case::reasoning_contexts("reasoning_contexts", json!(["reasoning", "non_reasoning"]), true)] #[case::reasoning_modes("reasoning_modes", json!(["none", "adaptive"]), true)] #[case::reasoning_context_not_a_list("reasoning_contexts", json!("reasoning"), false)]