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): rename litellm-framing crate to litellm-framer (#44683)
devin-ai-integration[bot]74ad633e539e
diff --git a/litellm-rust/Cargo.lock b/litellm-rust/Cargo.lockindex 934a1f0bb6b..a1f25cde57b 100644--- a/litellm-rust/Cargo.lock+++ b/litellm-rust/Cargo.lock@@ -3711,7 +3711,7 @@ dependencies = ["litellm-cache-memory","litellm-cache-response","litellm-core-utils",- "litellm-framing",+ "litellm-framer","litellm-host","litellm-host-native","litellm-http",@@ -3796,7 +3796,7 @@ dependencies = [][[package]]-name = "litellm-framing"+name = "litellm-framer"version = "0.1.0"dependencies = ["aws-smithy-eventstream",@@ -4053,7 +4053,7 @@ dependencies = ["litellm-auth-azure","litellm-auth-gcp","litellm-core-utils",- "litellm-framing",+ "litellm-framer","litellm-host","litellm-http","litellm-llms-types",diff --git a/litellm-rust/Cargo.toml b/litellm-rust/Cargo.tomlindex 6ef90c59d2f..18724ca5c5f 100644--- a/litellm-rust/Cargo.toml+++ b/litellm-rust/Cargo.toml@@ -28,7 +28,7 @@ litellm-host = { path = "crates/host" }litellm-host-http = { path = "crates/host-http" }litellm-host-native = { path = "crates/host-native" }litellm-callbacks-legacy-python = { path = "crates/callbacks-legacy-python" }-litellm-framing = { path = "crates/framer" }+litellm-framer = { path = "crates/framer" }litellm-auth = { path = "crates/auth" }litellm-auth-types = { path = "crates/auth-types" }litellm-auth-aws = { path = "crates/auth-aws" }diff --git a/litellm-rust/crates/core/AGENTS.md b/litellm-rust/crates/core/AGENTS.mdindex 6cb07e6dbfc..c6beef859f7 100644--- a/litellm-rust/crates/core/AGENTS.md+++ b/litellm-rust/crates/core/AGENTS.md@@ -28,7 +28,7 @@ The workspace `Error definitions` rules shape each crate's error; this section dA failure is declared once, by the lowest crate that raises it. Every crate above nests that error unchanged (`#[error(transparent)] Auth(#[from] litellm_auth::Error)`) or maps it once at its boundary, as `src/error.rs` does for `litellm_llms::Error`. `RouteError` collects route failures and never re-declares a variant a lower crate raises-Scope follows the concept, not the first caller. An error type under `litellm-llms`'s `<provider>/` is private to that provider: no other provider and nothing in `base_llm` may import it. A failure two providers or two routes can hit, such as wire framing, stream event decoding, or a malformed provider response, belongs to the crate that owns the concept: `litellm-framing` for framing, `litellm_llms::Error` for the transformation layer+Scope follows the concept, not the first caller. An error type under `litellm-llms`'s `<provider>/` is private to that provider: no other provider and nothing in `base_llm` may import it. A failure two providers or two routes can hit, such as wire framing, stream event decoding, or a malformed provider response, belongs to the crate that owns the concept: `litellm-framer` for framing, `litellm_llms::Error` for the transformation layer`litellm_llms::Error` (`crates/llms/src/error.rs`) is the one transformation error for every provider and API. `base_llm/ocr/error.rs` is the recorded exception until OCR folds into itdiff --git a/litellm-rust/crates/core/Cargo.toml b/litellm-rust/crates/core/Cargo.tomlindex 85362fd90d2..707297d7161 100644--- a/litellm-rust/crates/core/Cargo.toml+++ b/litellm-rust/crates/core/Cargo.toml@@ -8,7 +8,7 @@ repository.workspace = true[dependencies]litellm-cache.workspace = truelitellm-cache-response.workspace = true-litellm-framing.workspace = true+litellm-framer.workspace = truetokio-util = { version = "0.7", features = ["codec"] }litellm-secrets.workspace = truelitellm-llms-types.workspace = truediff --git a/litellm-rust/crates/core/src/caching.rs b/litellm-rust/crates/core/src/caching.rsindex 980e0e6d34e..99e21f81f2a 100644--- a/litellm-rust/crates/core/src/caching.rs+++ b/litellm-rust/crates/core/src/caching.rs@@ -341,7 +341,7 @@ fn now() -> Duration {fn successful_stream(text: &str, terminal: &str) -> bool {let mut pending = BytesMut::from(text.as_bytes());- let mut codec = litellm_framing::sse::SseCodec::default();+ let mut codec = litellm_framer::sse::SseCodec::default();let mut complete = false;loop {let event = match codec.decode(&mut pending) {diff --git a/litellm-rust/crates/framer/Cargo.toml b/litellm-rust/crates/framer/Cargo.tomlindex e11f2c02a97..99384206099 100644--- a/litellm-rust/crates/framer/Cargo.toml+++ b/litellm-rust/crates/framer/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "litellm-framing"+name = "litellm-framer"version = "0.1.0"edition.workspace = truelicense.workspace = truediff --git a/litellm-rust/crates/framer/tests/aws_event_stream.rs b/litellm-rust/crates/framer/tests/aws_event_stream.rsindex d16caa39948..ef5b9ed83d6 100644--- a/litellm-rust/crates/framer/tests/aws_event_stream.rs+++ b/litellm-rust/crates/framer/tests/aws_event_stream.rs@@ -6,7 +6,7 @@ use std::io;use bytes::Bytes;use futures_util::{StreamExt, TryStreamExt, stream};-use litellm_framing::{+use litellm_framer::{EventStreamError,aws_event_stream::{AwsEventStreamCodec, Header, HeaderValue, Message},frames,diff --git a/litellm-rust/crates/framer/tests/chaining.rs b/litellm-rust/crates/framer/tests/chaining.rsindex 81884d58ba1..0f327598067 100644--- a/litellm-rust/crates/framer/tests/chaining.rs+++ b/litellm-rust/crates/framer/tests/chaining.rs@@ -4,7 +4,7 @@ mod support;use bytes::Bytes;use futures_util::{StreamExt, TryStreamExt};-use litellm_framing::{+use litellm_framer::{EventStreamError, SseError,aws_event_stream::{AwsEventStreamCodec, Message},frames,diff --git a/litellm-rust/crates/framer/tests/sse.rs b/litellm-rust/crates/framer/tests/sse.rsindex 2fa064653a6..bf7a56525cf 100644--- a/litellm-rust/crates/framer/tests/sse.rs+++ b/litellm-rust/crates/framer/tests/sse.rs@@ -6,7 +6,7 @@ use std::io;use bytes::Bytes;use futures_util::{StreamExt, TryStreamExt, stream};-use litellm_framing::{+use litellm_framer::{SseError, frames,sse::{SseCodec, SseEvent},};diff --git a/litellm-rust/crates/llms/Cargo.toml b/litellm-rust/crates/llms/Cargo.tomlindex cac52454108..ab9c8bc5646 100644--- a/litellm-rust/crates/llms/Cargo.toml+++ b/litellm-rust/crates/llms/Cargo.toml@@ -16,7 +16,7 @@ litellm-auth-aws.workspace = truelitellm-auth-azure.workspace = truelitellm-auth-gcp.workspace = truelitellm-host.workspace = true-litellm-framing.workspace = true+litellm-framer.workspace = truelitellm-http.workspace = truelitellm-secrets.workspace = truelitellm-python-compat.workspace = truediff --git a/litellm-rust/crates/llms/src/base_llm/messages/streaming.rs b/litellm-rust/crates/llms/src/base_llm/messages/streaming.rsindex 0989d297d42..07ccb2fb911 100644--- a/litellm-rust/crates/llms/src/base_llm/messages/streaming.rs+++ b/litellm-rust/crates/llms/src/base_llm/messages/streaming.rs@@ -1,6 +1,6 @@use bytes::Bytes;use futures_util::{StreamExt, stream::BoxStream};-use litellm_framing::{frames, sse::SseCodec};+use litellm_framer::{frames, sse::SseCodec};use litellm_llms_types::formats::messages::streaming::MessagesStreamEvent;use crate::Error;diff --git a/litellm-rust/crates/llms/src/bedrock/chat/invoke_handler.rs b/litellm-rust/crates/llms/src/bedrock/chat/invoke_handler.rsindex f5bdfb7fe30..ad7025ab6af 100644--- a/litellm-rust/crates/llms/src/bedrock/chat/invoke_handler.rs+++ b/litellm-rust/crates/llms/src/bedrock/chat/invoke_handler.rs@@ -1,7 +1,7 @@use base64::Engine;use bytes::Buf;use futures_util::{Stream, StreamExt};-use litellm_framing::{+use litellm_framer::{aws_event_stream::{AwsEventStreamCodec, Message},frames,};