diff --git a/litellm-rust/crates/python-bridge/Cargo.toml b/litellm-rust/crates/python-bridge/Cargo.toml index c4be72ab8f5..ccefd910396 100644 --- a/litellm-rust/crates/python-bridge/Cargo.toml +++ b/litellm-rust/crates/python-bridge/Cargo.toml @@ -13,11 +13,12 @@ crate-type = ["cdylib"] default = ["abi3"] abi3 = ["pyo3/abi3-py310"] extension-module = ["pyo3/extension-module"] +mimalloc = ["dep:mimalloc"] panic-test = [] [dependencies] futures-util.workspace = true -mimalloc.workspace = true +mimalloc = { workspace = true, optional = true } tracing.workspace = true tracing-subscriber.workspace = true litellm-core = { workspace = true, features = ["bedrock-auth"] } diff --git a/litellm-rust/crates/python-bridge/src/lib.rs b/litellm-rust/crates/python-bridge/src/lib.rs index 7e160a4c7bf..cab860a91d1 100644 --- a/litellm-rust/crates/python-bridge/src/lib.rs +++ b/litellm-rust/crates/python-bridge/src/lib.rs @@ -11,6 +11,7 @@ use pyo3::prelude::*; use pyo3::types::PyAny; use serde_json::Value; +#[cfg(feature = "mimalloc")] #[global_allocator] static ALLOCATOR: mimalloc::MiMalloc = mimalloc::MiMalloc;