Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/test-python-314.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: "Python 3.14 Support"

on:
pull_request:
branches:
- main
- litellm_internal_staging
- litellm_oss_branch
- "litellm_**"

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
python-314-support:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.14"
allow-prereleases: true

- name: Set up uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
version: "0.10.9"

- name: Check lockfile
run: uv lock --check

- name: Install dependencies
run: uv sync --frozen --all-groups --all-extras

- name: Import smoke
run: |
uv run --no-sync python - <<'PY'
import importlib

modules = (
"litellm",
"fastuuid",
"redisvl",
"semantic_router",
"aurelio_sdk",
"pypdf",
"openapi_core",
)

for module in modules:
importlib.import_module(module)
PY

- name: Datadog tracing smoke
run: |
DD_TRACE_ENABLED=false USE_DDTRACE=true uv run --no-sync python - <<'PY'
from litellm.litellm_core_utils import dd_tracing

with dd_tracing.tracer.trace("litellm.python314.smoke") as span:
assert span is not None
span.set_tag("litellm.python", "3.14")
assert dd_tracing.get_active_span() is not None

@dd_tracing.tracer.wrap(name="litellm.python314.wrap_smoke")
def wrapped():
return "ok"

assert wrapped() == "ok"
PY

- name: Run targeted regression tests
run: |
uv run --no-sync pytest \
tests/test_litellm/test_uuid_helper.py \
tests/test_litellm/caching/test_s3_cache.py \
--tb=short -vv
94 changes: 16 additions & 78 deletions litellm-rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions litellm-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ repository = "https://github.com/BerriAI/litellm"
litellm-core = { path = "crates/core" }
litellm-ai-gateway = { path = "crates/ai-gateway", default-features = false }
axum = "0.7"
pyo3 = "0.23.5"
pyo3-async-runtimes = { version = "0.23.0", features = ["tokio-runtime"] }
pyo3 = "0.29.0"
pyo3-async-runtimes = { version = "0.29.0", features = ["tokio-runtime"] }
rand = "0.8"
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls", "http2", "stream"] }
serde = { version = "1.0", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion litellm-rust/crates/ai-gateway/src/python/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::gil;
/// Load the router's `model_list` from `config_path` via the Python reader.
pub fn load_router_from_config(config_path: &str) -> CoreResult<Router> {
gil::record_acquisition();
Python::with_gil(|py| {
Python::attach(|py| {
let model_list = py
.import("litellm.proxy.read_model_list")
.and_then(|module| module.getattr("read_model_list"))
Expand Down
2 changes: 1 addition & 1 deletion litellm-rust/crates/python-bridge/src/gil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ where
T: Send,
{
GIL_RELEASES.fetch_add(1, Ordering::Relaxed);
py.allow_threads(f)
py.detach(f)
}

/// Total GIL releases performed by the bridge so far.
Expand Down
2 changes: 1 addition & 1 deletion litellm-rust/crates/python-bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fn aocr(
.await
.map_err(core_error_to_pyerr)?;

Python::with_gil(|py| json_to_py(py, value))
Python::attach(|py| json_to_py(py, value))
})
}

Expand Down
15 changes: 8 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "litellm"
version = "1.93.0"
description = "Library to easily interface with LLM API providers"
readme = "README.md"
requires-python = ">=3.10, <3.14"
requires-python = ">=3.10, <3.15"
license = "MIT"
license-files = ["LICENSE"]
authors = [
Expand Down Expand Up @@ -89,7 +89,7 @@ extra_proxy = [
"google-cloud-iam>=2.19.1,<3.0",
# Not in PyPI proxy extra.
"resend>=2.23.0,<3.0",
"redisvl>=0.4.1,<1.0; python_version < '3.14'",
"redisvl>=0.4.1,<1.0",
"a2a-sdk>=1.1.0,<2.0",
]
utils = [
Expand All @@ -98,8 +98,8 @@ utils = [
]
caching = ["diskcache>=5.6.3,<6.0"]
semantic-router = [
"semantic-router>=0.1.15,<1.0; python_version < '3.14'",
"aurelio-sdk>=0.0.19,<1.0; python_version < '3.14'",
"semantic-router>=0.1.15,<1.0",
"aurelio-sdk>=0.0.19,<1.0",
]
mlflow = ["mlflow>=3.11.1,<4.0"]
grpc = [
Expand Down Expand Up @@ -129,12 +129,13 @@ proxy-runtime = [
"opentelemetry-sdk==1.28.0",
"opentelemetry-exporter-otlp==1.28.0",
"opentelemetry-instrumentation-fastapi==0.49b0",
"ddtrace>=2.19.0,<3.0",
"ddtrace>=2.19.0,<3.0; python_version < '3.14'",
"ddtrace>=3.19.7,<4.0; python_version >= '3.14'",
Comment thread
Technolog796 marked this conversation as resolved.
"sentry-sdk>=2.21.0,<3.0",
"mangum>=0.17.0,<1.0",
"azure-ai-contentsafety>=1.0.0,<2.0",
"azure-storage-file-datalake>=12.20.0,<13.0",
"pypdf>=6.12.0,<7.0; python_version < '3.14'",
"pypdf>=6.13.3,<7.0",
"llm-sandbox>=0.3.39,<1.0",
"detect-secrets>=1.5.0,<2.0",
]
Expand Down Expand Up @@ -179,7 +180,7 @@ dev = [
"pytest-rerunfailures==15.1",
"pytest-cov==5.0.0",
"parameterized==0.9.0",
"openapi-core==0.22.0; python_version < '3.14'",
"openapi-core==0.22.0",
"pytest-timeout==2.4.0",
"vcrpy==8.2.1",
"pytest-recording==0.13.4",
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fi
# ── install ────────────────────────────────────────────────────────────────
# --python-preference system: reuse a compatible system Python when present,
# otherwise download a managed one. Either way uv honours litellm's requires-python,
# so a too-old (3.9) or too-new (3.14+) system Python is skipped, not forced.
# so an unsupported system Python is skipped, not forced.
echo ""
header "Installing litellm[cli]…"
echo ""
Expand Down
Loading
Loading