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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
refactor(rust): remove core provider reexports
Yujong Lee6ce78b85a532
diff --git a/litellm-rust/crates/core/src/audio_transcription/handler.rs b/litellm-rust/crates/core/src/audio_transcription/handler.rsindex 4c48b6b5ede..ae547f10f15 100644--- a/litellm-rust/crates/core/src/audio_transcription/handler.rs+++ b/litellm-rust/crates/core/src/audio_transcription/handler.rs@@ -47,8 +47,8 @@ async fn signed_headers(use std::collections::BTreeMap;use std::time::SystemTime;- use crate::llms::base_llm::audio_transcription::transformation::AudioTranscriptionAuth;use litellm_auth_aws::{aws_auth_config, resolve_credentials, sign_bedrock_post};+ use litellm_providers::base_llm::audio_transcription::transformation::AudioTranscriptionAuth;let AudioTranscriptionAuth::AwsSigV4 { region, .. } = &request.auth else {return Ok(request.upstream_headers.clone());diff --git a/litellm-rust/crates/core/src/audio_transcription/prepare.rs b/litellm-rust/crates/core/src/audio_transcription/prepare.rsindex 26e705408e0..4dc3ffae191 100644--- a/litellm-rust/crates/core/src/audio_transcription/prepare.rs+++ b/litellm-rust/crates/core/src/audio_transcription/prepare.rs@@ -4,10 +4,10 @@ use crate::http_utils::{has_header, string_headers};use crate::litellm_core_utils::get_llm_provider_logic::{CustomLlmProvider, get_custom_llm_provider,};-use crate::llms::base_llm::audio_transcription::transformation::{+use litellm_providers::base_llm::audio_transcription::transformation::{AudioTranscriptionAuth, BaseAudioTranscriptionConfig,};-use crate::llms::bedrock::audio_transcription::BEDROCK_AUDIO_TRANSCRIPTION_CONFIG;+use litellm_providers::bedrock::audio_transcription::BEDROCK_AUDIO_TRANSCRIPTION_CONFIG;fn provider_config(provider: &str) -> Option<&'static dyn BaseAudioTranscriptionConfig> {if provider == "bedrock" {diff --git a/litellm-rust/crates/core/src/chat_completions/common_utils.rs b/litellm-rust/crates/core/src/chat_completions/common_utils.rsindex 8b966c7a173..63fc899e6f4 100644--- a/litellm-rust/crates/core/src/chat_completions/common_utils.rs+++ b/litellm-rust/crates/core/src/chat_completions/common_utils.rs@@ -2,8 +2,8 @@ use serde_json::{Map, Value};use super::Error;use crate::http_utils::string_headers as shared_string_headers;-use crate::llms::anthropic::chat::transformation::ANTHROPIC_CHAT_COMPLETIONS_CONFIG;-use crate::llms::base_llm::chat::transformation::BaseConfig;+use litellm_providers::anthropic::chat::transformation::ANTHROPIC_CHAT_COMPLETIONS_CONFIG;+use litellm_providers::base_llm::chat::transformation::BaseConfig;const HEADER_CONTEXT: &str = "chat completions";@@ -11,7 +11,7 @@ pub(super) fn chat_completions_provider_config(provider: &str) -> Option<&'statimatch provider {"anthropic" => Some(&ANTHROPIC_CHAT_COMPLETIONS_CONFIG),"bedrock" => Some(- &crate::llms::bedrock::chat::converse_transformation::BEDROCK_CHAT_COMPLETIONS_CONFIG,+ &litellm_providers::bedrock::chat::converse_transformation::BEDROCK_CHAT_COMPLETIONS_CONFIG,),_ => None,}diff --git a/litellm-rust/crates/core/src/chat_completions/handler.rs b/litellm-rust/crates/core/src/chat_completions/handler.rsindex 2dc44e3bb26..ac9f58cda22 100644--- a/litellm-rust/crates/core/src/chat_completions/handler.rs+++ b/litellm-rust/crates/core/src/chat_completions/handler.rs@@ -8,7 +8,7 @@ use super::types::{ResolvedChatCompletionsRequest,};use crate::http_utils::{http_request, truncate_error_body};-use crate::llms::base_llm::chat::transformation::ChatCompletionsAuth;+use litellm_providers::base_llm::chat::transformation::ChatCompletionsAuth;pub(super) async fn execute_chat_completions_provider_call(request: ResolvedChatCompletionsRequest<'_>,diff --git a/litellm-rust/crates/core/src/chat_completions/prepare.rs b/litellm-rust/crates/core/src/chat_completions/prepare.rsindex 983fbdf4f1d..3f3f97d6191 100644--- a/litellm-rust/crates/core/src/chat_completions/prepare.rs+++ b/litellm-rust/crates/core/src/chat_completions/prepare.rs@@ -10,7 +10,7 @@ use crate::http_utils::has_header;use crate::litellm_core_utils::get_llm_provider_logic::{CustomLlmProvider, get_custom_llm_provider,};-use crate::llms::base_llm::chat::transformation::{BaseConfig, ChatCompletionsAuth};+use litellm_providers::base_llm::chat::transformation::{BaseConfig, ChatCompletionsAuth};pub(super) fn resolve_provider_config<'a>(model: &'a str,diff --git a/litellm-rust/crates/core/src/chat_completions/tests.rs b/litellm-rust/crates/core/src/chat_completions/tests.rsindex 86ac6c6ca35..40298cf5c2e 100644--- a/litellm-rust/crates/core/src/chat_completions/tests.rs+++ b/litellm-rust/crates/core/src/chat_completions/tests.rs@@ -3,7 +3,7 @@ use serde_json::{Map, Value, json};use super::Error;use super::prepare::{prepare_provider_request, resolve_request};use super::types::{ChatCompletionsRequest, ProviderChatCompletionsRequest};-use crate::llms::base_llm::chat::transformation::ChatCompletionsAuth;+use litellm_providers::base_llm::chat::transformation::ChatCompletionsAuth;fn prepare_chat_completions_call(request: ChatCompletionsRequest<'_>,diff --git a/litellm-rust/crates/core/src/llms/anthropic/chat/mod.rs b/litellm-rust/crates/core/src/llms/anthropic/chat/mod.rsindex d80931444d9..7bf4fc46291 100644--- a/litellm-rust/crates/core/src/llms/anthropic/chat/mod.rs+++ b/litellm-rust/crates/core/src/llms/anthropic/chat/mod.rs@@ -1,2 +1 @@pub mod streaming;-pub use litellm_providers::anthropic::chat::transformation;diff --git a/litellm-rust/crates/core/src/llms/anthropic/chat/streaming.rs b/litellm-rust/crates/core/src/llms/anthropic/chat/streaming.rsindex ec44f2c5808..427c57633d3 100644--- a/litellm-rust/crates/core/src/llms/anthropic/chat/streaming.rs+++ b/litellm-rust/crates/core/src/llms/anthropic/chat/streaming.rs@@ -2,16 +2,16 @@ use std::collections::HashMap;use serde_json::Value;+use super::super::experimental_pass_through::messages::streaming::{+ AnthropicContentBlock, AnthropicContentBlockDelta, AnthropicMessagesStreamEvent,+ AnthropicStreamUsage,+};use crate::chat_completions::Error;use crate::chat_completions::streaming::StreamTransformer;use crate::chat_completions::types::{ChatCompletionChunk, ChatCompletionThinkingBlock, ChatCompletionToolCallChunk,ChatCompletionsUsage,};-use crate::llms::anthropic::experimental_pass_through::messages::streaming::{- AnthropicContentBlock, AnthropicContentBlockDelta, AnthropicMessagesStreamEvent,- AnthropicStreamUsage,-};#[derive(Clone, Copy, Debug, Eq, PartialEq)]pub enum AnthropicJsonChunkType {diff --git a/litellm-rust/crates/core/src/llms/anthropic/experimental_pass_through/messages/batches.rs b/litellm-rust/crates/core/src/llms/anthropic/experimental_pass_through/messages/batches.rsindex 762e699acba..16b4e2a59ad 100644--- a/litellm-rust/crates/core/src/llms/anthropic/experimental_pass_through/messages/batches.rs+++ b/litellm-rust/crates/core/src/llms/anthropic/experimental_pass_through/messages/batches.rs@@ -3,9 +3,9 @@ use serde_json::Value;use time::OffsetDateTime;use url::Url;-use crate::llms::anthropic::experimental_pass_through::messages::transformation::resolve_anthropic_api_base;use crate::messages::Error;use crate::messages::types::AnthropicMessagesResponse;+use litellm_providers::anthropic::experimental_pass_through::messages::transformation::resolve_anthropic_api_base;const BATCHES_PATH_SUFFIX: &str = "/v1/messages/batches";diff --git a/litellm-rust/crates/core/src/llms/anthropic/experimental_pass_through/messages/mod.rs b/litellm-rust/crates/core/src/llms/anthropic/experimental_pass_through/messages/mod.rsindex 3029d60823e..42d4fcdde0f 100644--- a/litellm-rust/crates/core/src/llms/anthropic/experimental_pass_through/messages/mod.rs+++ b/litellm-rust/crates/core/src/llms/anthropic/experimental_pass_through/messages/mod.rs@@ -1,4 +1,3 @@pub mod batches;pub mod count_tokens;pub mod streaming;-pub use litellm_providers::anthropic::experimental_pass_through::messages::transformation;diff --git a/litellm-rust/crates/core/src/llms/azure_ai/anthropic/mod.rs b/litellm-rust/crates/core/src/llms/azure_ai/anthropic/mod.rsdeleted file mode 100644index 9c380f98f9f..00000000000--- a/litellm-rust/crates/core/src/llms/azure_ai/anthropic/mod.rs+++ /dev/null@@ -1 +0,0 @@-pub use litellm_providers::azure_ai::anthropic::messages_transformation;diff --git a/litellm-rust/crates/core/src/llms/azure_ai/mod.rs b/litellm-rust/crates/core/src/llms/azure_ai/mod.rsindex 8a52bda45be..079e0c41eae 100644--- a/litellm-rust/crates/core/src/llms/azure_ai/mod.rs+++ b/litellm-rust/crates/core/src/llms/azure_ai/mod.rs@@ -1,2 +1 @@-pub mod anthropic;pub(crate) mod ocr;diff --git a/litellm-rust/crates/core/src/llms/base_llm/anthropic_messages/mod.rs b/litellm-rust/crates/core/src/llms/base_llm/anthropic_messages/mod.rsdeleted file mode 100644index f239b6921fa..00000000000--- a/litellm-rust/crates/core/src/llms/base_llm/anthropic_messages/mod.rs+++ /dev/null@@ -1 +0,0 @@-pub mod transformation;diff --git a/litellm-rust/crates/core/src/llms/base_llm/audio_transcription/mod.rs b/litellm-rust/crates/core/src/llms/base_llm/audio_transcription/mod.rsdeleted file mode 100644index f239b6921fa..00000000000--- a/litellm-rust/crates/core/src/llms/base_llm/audio_transcription/mod.rs+++ /dev/null@@ -1 +0,0 @@-pub mod transformation;diff --git a/litellm-rust/crates/core/src/llms/base_llm/chat/mod.rs b/litellm-rust/crates/core/src/llms/base_llm/chat/mod.rsdeleted file mode 100644index f239b6921fa..00000000000--- a/litellm-rust/crates/core/src/llms/base_llm/chat/mod.rs+++ /dev/null@@ -1 +0,0 @@-pub mod transformation;diff --git a/litellm-rust/crates/core/src/llms/base_llm/mod.rs b/litellm-rust/crates/core/src/llms/base_llm/mod.rsindex 5fa2ab21564..079e0c41eae 100644--- a/litellm-rust/crates/core/src/llms/base_llm/mod.rs+++ b/litellm-rust/crates/core/src/llms/base_llm/mod.rs@@ -1,2 +1 @@-pub use litellm_providers::base_llm::{anthropic_messages, audio_transcription, chat};pub(crate) mod ocr;diff --git a/litellm-rust/crates/core/src/llms/bedrock/chat/mod.rs b/litellm-rust/crates/core/src/llms/bedrock/chat/mod.rsdeleted file mode 100644index d5668e0d03b..00000000000--- a/litellm-rust/crates/core/src/llms/bedrock/chat/mod.rs+++ /dev/null@@ -1 +0,0 @@-pub use litellm_providers::bedrock::chat::converse_transformation;diff --git a/litellm-rust/crates/core/src/llms/bedrock/mod.rs b/litellm-rust/crates/core/src/llms/bedrock/mod.rsdeleted file mode 100644index fa281e5c50d..00000000000--- a/litellm-rust/crates/core/src/llms/bedrock/mod.rs+++ /dev/null@@ -1,2 +0,0 @@-pub use litellm_providers::bedrock::audio_transcription;-pub mod chat;diff --git a/litellm-rust/crates/core/src/llms/mod.rs b/litellm-rust/crates/core/src/llms/mod.rsindex 635d381561c..4b93a5f971c 100644--- a/litellm-rust/crates/core/src/llms/mod.rs+++ b/litellm-rust/crates/core/src/llms/mod.rs@@ -1,7 +1,6 @@pub mod anthropic;pub mod azure_ai;pub mod base_llm;-pub mod bedrock;pub(crate) mod cohere;pub(crate) mod mistral;pub mod openai;diff --git a/litellm-rust/crates/core/src/messages/common_utils.rs b/litellm-rust/crates/core/src/messages/common_utils.rsindex a0a120c34a9..c58e9122cad 100644--- a/litellm-rust/crates/core/src/messages/common_utils.rs+++ b/litellm-rust/crates/core/src/messages/common_utils.rs@@ -3,9 +3,9 @@ use serde_json::{Map, Value};use super::Error;use crate::http_utils::string_headers as shared_string_headers;pub(super) use crate::http_utils::{has_bearer_auth, has_header, truncate_error_body};-use crate::llms::anthropic::experimental_pass_through::messages::transformation::ANTHROPIC_MESSAGES_CONFIG;-use crate::llms::azure_ai::anthropic::messages_transformation::AZURE_ANTHROPIC_MESSAGES_CONFIG;-use crate::llms::base_llm::anthropic_messages::transformation::BaseAnthropicMessagesConfig;+use litellm_providers::anthropic::experimental_pass_through::messages::transformation::ANTHROPIC_MESSAGES_CONFIG;+use litellm_providers::azure_ai::anthropic::messages_transformation::AZURE_ANTHROPIC_MESSAGES_CONFIG;+use litellm_providers::base_llm::anthropic_messages::transformation::BaseAnthropicMessagesConfig;const HEADER_CONTEXT: &str = "messages";diff --git a/litellm-rust/crates/core/src/messages/prepare.rs b/litellm-rust/crates/core/src/messages/prepare.rsindex a3c93746d3e..f3735ff1700 100644--- a/litellm-rust/crates/core/src/messages/prepare.rs+++ b/litellm-rust/crates/core/src/messages/prepare.rs@@ -6,7 +6,7 @@ use super::types::{MessagesRequest, ProviderMessagesRequest};use crate::litellm_core_utils::get_llm_provider_logic::{CustomLlmProvider, get_custom_llm_provider,};-use crate::llms::base_llm::anthropic_messages::transformation::{+use litellm_providers::base_llm::anthropic_messages::transformation::{BaseAnthropicMessagesConfig, MessagesAuthStrategy,};