mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
perf(rust): make mimalloc opt-in behind a cargo feature
pydantic-core shipped mimalloc from Jun 2022 to Aug 2023 and removed it (pydantic-core#900) after: a TLS-linkage fix (pydantic-core#363), manylinux cross-compile breakage (pydantic-core#893), 1GiB of reserved virtual memory at import breaking RLIMIT_AS-limited processes (pydantic#7167), and container memory-footprint complaints (pydantic#6620). litellm wheels land in exactly those memory-limited container deployments, so the allocator override must be an explicit build-time choice, not a default imposed on every wheel. The feature stays available for self-built deployments that want it; wheels build without it.
This commit is contained in:
parent
17bcc04800
commit
b7453a25d7
2 changed files with 3 additions and 1 deletions
|
|
@ -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"] }
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue