From 12c02ddb0475a1299543d602df15b5f44d3194fd Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Sun, 6 Sep 2026 07:30:57 -0700 Subject: [PATCH] fix(rust): update gateway message adapter --- .../ai-gateway/src/routes/messages/service.rs | 19 ++++++++++--------- type-discipline-budget.json | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/litellm-rust/crates/ai-gateway/src/routes/messages/service.rs b/litellm-rust/crates/ai-gateway/src/routes/messages/service.rs index b9dfe8dc4f8..6935fd49787 100644 --- a/litellm-rust/crates/ai-gateway/src/routes/messages/service.rs +++ b/litellm-rust/crates/ai-gateway/src/routes/messages/service.rs @@ -51,22 +51,22 @@ pub async fn run( Value::String(upstream_model.to_string()), ); + let options = RequestOptions { + api_key: (deployment.litellm_params.api_key.as_deref()).map(|value| value.to_string()), + api_base: (deployment.litellm_params.api_base.as_deref()).map(|value| value.to_string()), + custom_llm_provider: (custom_llm_provider).map(|value| value.to_string()), + extra_headers, + timeout: None, + ..Default::default() + }; let request = MessagesRequest { model: provider_model, body, - options: RequestOptions { - api_key: (deployment.litellm_params.api_key.as_deref()).map(|value| value.to_string()), - api_base: (deployment.litellm_params.api_base.as_deref()) - .map(|value| value.to_string()), - custom_llm_provider: (custom_llm_provider).map(|value| value.to_string()), - extra_headers, - timeout: None, - ..Default::default() - }, }; if request.body.get("stream").and_then(Value::as_bool) == Some(true) { return messages_stream( request, + &options, &LiteLlmRequestContext { ..Default::default() }, @@ -77,6 +77,7 @@ pub async fn run( let response = messages( request, + &options, &LiteLlmRequestContext { ..Default::default() }, diff --git a/type-discipline-budget.json b/type-discipline-budget.json index 5035894f3f9..18cc8a9ce9e 100644 --- a/type-discipline-budget.json +++ b/type-discipline-budget.json @@ -15,7 +15,7 @@ "limit": 0 }, "LIT006": { - "limit": 1027 + "limit": 1022 }, "LIT007": { "limit": 0 @@ -27,10 +27,10 @@ "limit": 0 }, "LIT010": { - "limit": 16426 + "limit": 16419 }, "LIT011": { - "limit": 5506 + "limit": 5497 }, "LIT012": { "limit": 4486