Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

refactor(rust): promote anthropic messages out of experimental_pass_through (#43269)

devin-ai-integration[bot]2ef3250ec3bd
diff --git a/litellm-rust/crates/core/src/messages/common_utils.rs b/litellm-rust/crates/core/src/messages/common_utils.rs
index d27b79bdc04..95142e87519 100644
--- a/litellm-rust/crates/core/src/messages/common_utils.rs
+++ b/litellm-rust/crates/core/src/messages/common_utils.rs
@@ -1,7 +1,7 @@
use litellm_http::request::string_headers as shared_string_headers;
pub(super) use litellm_http::request::truncate_error_body;
use litellm_llms::{
- anthropic::experimental_pass_through::messages::transformation::ANTHROPIC_MESSAGES_CONFIG,
+ anthropic::messages::transformation::ANTHROPIC_MESSAGES_CONFIG,
azure_ai::anthropic::messages_transformation::AZURE_ANTHROPIC_MESSAGES_CONFIG,
base_llm::anthropic_messages::transformation::BaseAnthropicMessagesConfig,
};
diff --git a/litellm-rust/crates/core/src/messages/prepare.rs b/litellm-rust/crates/core/src/messages/prepare.rs
index dc4b3562e3f..84884ab279e 100644
--- a/litellm-rust/crates/core/src/messages/prepare.rs
+++ b/litellm-rust/crates/core/src/messages/prepare.rs
@@ -5,7 +5,7 @@ use litellm_core_utils::{
settings::Lookup,
};
use litellm_llms::{
- anthropic::experimental_pass_through::messages::handler::shape_anthropic_messages_request,
+ anthropic::messages::handler::shape_anthropic_messages_request,
base_llm::anthropic_messages::transformation::{
BaseAnthropicMessagesConfig, MessagesTransformContext,
},
diff --git a/litellm-rust/crates/llms/src/anthropic/batches/transformation.rs b/litellm-rust/crates/llms/src/anthropic/batches/transformation.rs
index 94e4dc7838a..1c26684901a 100644
--- a/litellm-rust/crates/llms/src/anthropic/batches/transformation.rs
+++ b/litellm-rust/crates/llms/src/anthropic/batches/transformation.rs
@@ -5,7 +5,7 @@ use time::OffsetDateTime;
use url::Url;
use crate::{
- anthropic::experimental_pass_through::messages::transformation::resolve_anthropic_api_base,
+ anthropic::messages::transformation::resolve_anthropic_api_base,
base_llm::chat::transformation::Error,
};
diff --git a/litellm-rust/crates/llms/src/anthropic/chat/handler.rs b/litellm-rust/crates/llms/src/anthropic/chat/handler.rs
index a80cfbf28bd..9160cdf28ee 100644
--- a/litellm-rust/crates/llms/src/anthropic/chat/handler.rs
+++ b/litellm-rust/crates/llms/src/anthropic/chat/handler.rs
@@ -7,7 +7,7 @@ use litellm_types::{
use serde_json::Value;
use crate::{
- anthropic::experimental_pass_through::messages::streaming_iterator::{
+ anthropic::messages::streaming_iterator::{
AnthropicContentBlock, AnthropicContentBlockDelta, AnthropicMessagesStreamEvent,
AnthropicStreamUsage,
},
diff --git a/litellm-rust/crates/llms/src/anthropic/chat/transformation.rs b/litellm-rust/crates/llms/src/anthropic/chat/transformation.rs
index fd86c5ca25a..07ed6ba6ed1 100644
--- a/litellm-rust/crates/llms/src/anthropic/chat/transformation.rs
+++ b/litellm-rust/crates/llms/src/anthropic/chat/transformation.rs
@@ -11,9 +11,7 @@ use serde_json::{Map, Value, json};
use crate::{
anthropic::{
ANTHROPIC_OAUTH_TOKEN_PREFIX,
- experimental_pass_through::messages::transformation::{
- complete_anthropic_url, resolve_anthropic_api_key,
- },
+ messages::transformation::{complete_anthropic_url, resolve_anthropic_api_key},
},
base_llm::chat::transformation::{
BaseConfig, Error, ProviderChatRequestData, ProviderChatResponseData, RequestAuth,
diff --git a/litellm-rust/crates/llms/src/anthropic/experimental_pass_through/mod.rs b/litellm-rust/crates/llms/src/anthropic/experimental_pass_through/mod.rs
deleted file mode 100644
index ba63992f3cb..00000000000
--- a/litellm-rust/crates/llms/src/anthropic/experimental_pass_through/mod.rs
+++ /dev/null
@@ -1 +0,0 @@
-pub mod messages;
diff --git a/litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/handler.rs b/litellm-rust/crates/llms/src/anthropic/messages/handler.rs
similarity index 100%
rename from litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/handler.rs
rename to litellm-rust/crates/llms/src/anthropic/messages/handler.rs
diff --git a/litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/headers.rs b/litellm-rust/crates/llms/src/anthropic/messages/headers.rs
similarity index 100%
rename from litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/headers.rs
rename to litellm-rust/crates/llms/src/anthropic/messages/headers.rs
diff --git a/litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/mod.rs b/litellm-rust/crates/llms/src/anthropic/messages/mod.rs
similarity index 100%
rename from litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/mod.rs
rename to litellm-rust/crates/llms/src/anthropic/messages/mod.rs
diff --git a/litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/streaming_iterator.rs b/litellm-rust/crates/llms/src/anthropic/messages/streaming_iterator.rs
similarity index 100%
rename from litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/streaming_iterator.rs
rename to litellm-rust/crates/llms/src/anthropic/messages/streaming_iterator.rs
diff --git a/litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/thinking.rs b/litellm-rust/crates/llms/src/anthropic/messages/thinking.rs
similarity index 100%
rename from litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/thinking.rs
rename to litellm-rust/crates/llms/src/anthropic/messages/thinking.rs
diff --git a/litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/transformation.rs b/litellm-rust/crates/llms/src/anthropic/messages/transformation.rs
similarity index 100%
rename from litellm-rust/crates/llms/src/anthropic/experimental_pass_through/messages/transformation.rs
rename to litellm-rust/crates/llms/src/anthropic/messages/transformation.rs
diff --git a/litellm-rust/crates/llms/src/anthropic/mod.rs b/litellm-rust/crates/llms/src/anthropic/mod.rs
index 755bc7d1907..a884c146dca 100644
--- a/litellm-rust/crates/llms/src/anthropic/mod.rs
+++ b/litellm-rust/crates/llms/src/anthropic/mod.rs
@@ -1,7 +1,8 @@
+pub mod common_utils;
+
pub mod batches;
pub mod chat;
-pub mod common_utils;
pub mod count_tokens;
-pub mod experimental_pass_through;
+pub mod messages;
pub const ANTHROPIC_OAUTH_TOKEN_PREFIX: &str = "sk-ant-oat";
diff --git a/litellm-rust/crates/llms/src/azure_ai/anthropic/messages_transformation.rs b/litellm-rust/crates/llms/src/azure_ai/anthropic/messages_transformation.rs
index c409f7f687e..137239bbeaf 100644
--- a/litellm-rust/crates/llms/src/azure_ai/anthropic/messages_transformation.rs
+++ b/litellm-rust/crates/llms/src/azure_ai/anthropic/messages_transformation.rs
@@ -6,7 +6,7 @@ use litellm_types::llms::anthropic_messages::{
};
use crate::{
- anthropic::experimental_pass_through::messages::transformation::{
+ anthropic::messages::transformation::{
ANTHROPIC_MESSAGES_CONFIG, AnthropicMessagesConfig, non_empty,
},
base_llm::{
diff --git a/litellm-rust/crates/llms/src/base_llm/anthropic_messages/transformation.rs b/litellm-rust/crates/llms/src/base_llm/anthropic_messages/transformation.rs
index 8db14687214..eff1dd1cf0b 100644
--- a/litellm-rust/crates/llms/src/base_llm/anthropic_messages/transformation.rs
+++ b/litellm-rust/crates/llms/src/base_llm/anthropic_messages/transformation.rs
@@ -4,8 +4,7 @@ use litellm_types::llms::anthropic_messages::{
};
use crate::{
- anthropic::experimental_pass_through::messages::thinking::ThinkingContext,
- base_llm::chat::transformation::Error,
+ anthropic::messages::thinking::ThinkingContext, base_llm::chat::transformation::Error,
};
pub type Headers = Vec<(String, String)>;