Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2111dda
fix(ui): widen Y-axis gutter on Usage charts so large token/request l…
Bytechoreographer May 8, 2026
8ed4938
Update ui/litellm-dashboard/src/components/UsagePage/utils/value_form…
Bytechoreographer May 8, 2026
15462f7
fix: correct context window tokens for GPT-5 Pro and GPT-5.4 Mini/Nano
AJH763 Jun 22, 2026
3d0e686
fix: also correct max_output_tokens for gpt-5-pro (272000→128000)
AJH763 Jun 22, 2026
63741e9
fix(cost): price gpt-image generated output tokens as image tokens (#…
kimsehwan96 Jun 24, 2026
6893df1
fix(bedrock): route application-inference-profile ARNs to converse (#…
kingdoooo Jun 24, 2026
e71d6ef
fix(moonshot): stop mutating caller messages on tool_choice='required…
Wassbdr Jun 24, 2026
00725de
fix(transcription): accept fractional usage.seconds in diarized_json …
neimaravila Jun 24, 2026
04c6492
fix(deepseek): drop non-function tools before chat completions call (…
Jerry-Scintilla Jun 24, 2026
d720591
feat(catalog): add zai/glm-5.1, zai/glm-4.7-flash, openrouter/z-ai/gl…
AlexBGoode Jun 24, 2026
6bffdeb
feat(ui): surface team budget on key overview when key has no own bud…
cboloz-1 Jun 24, 2026
4b22aa1
fix(anthropic): emit replayable streaming thinking blocks (#31022)
jesco-absolut Jun 24, 2026
7ee492f
feat(proxy): read cold-storage prompts back in the logs detail view (…
Bytechoreographer Jun 24, 2026
1eb6bdd
fix(mavvrik): advance metricsMarker after upload; fix scheduler start…
pghuge-cloudwiz Jun 24, 2026
e1187c0
feat: pass through optional `instruction` field in the rerank API (vL…
jhsmith409 Jun 24, 2026
b302c42
fix(github_copilot): synthesize empty choices at the provider seam (#…
davidkarlsen Jun 24, 2026
2f6fd18
fix(router): stop fallback lookups from mutating the router fallbacks…
Vedant-Agarwal Jun 24, 2026
af7b0af
fix(sambanova): update pricing, deprecate retired models, and add mis…
bhumikadangayach Jun 24, 2026
6bf3b9b
fix(utils): preserve arbitrary above-threshold tiered pricing keys in…
Ewertonslv Jun 24, 2026
84505e5
Merge pull request #30938 from xbrxr03/fix/gpt5-context-window-tokens
Sameerlite Jun 24, 2026
7d89450
fix: resolve UP045 lint violations (Optional[X] -> X | None)
Sameerlite Jun 24, 2026
0647d5b
fix: resolve UP045 lint violations (Optional[X] -> X | None)
Sameerlite Jun 24, 2026
5a8b048
Merge pull request #27464 from Bytechoreographer/fix/hidden_sidebar_d…
Sameerlite Jun 24, 2026
ec91088
fix: run black formatting on UP045-fixed files
Sameerlite Jun 24, 2026
851ff30
fix: remove unused Optional imports after UP045 migration
Sameerlite Jun 24, 2026
a11ca85
fix: black format cold_storage_handler.py
Sameerlite Jun 24, 2026
3908ce8
fix(ci): correct OSS staging branch name in guard-main-branch errors
Sameerlite Jun 24, 2026
acc983f
fix: strip trailing zeros from M/B spend formatter
Sameerlite Jun 24, 2026
ef5775e
fix: address focus and streaming edge cases
cursoragent Jun 24, 2026
b0e2508
feat: add LAR-1 semantic routing strategy
carlsonchik Jun 25, 2026
b4a3deb
Merge pull request #31295 from carlsonchik/litellm_lar1-routing
Sameerlite Jun 25, 2026
80fae72
fix(mavvrik): advance metricsMarker on empty-content deliver
Sameerlite Jun 25, 2026
f7296c2
style: black format mavvrik_destination
Sameerlite Jun 25, 2026
61d5c67
feat(elevenlabs): diarized_json transcription and multi-channel speakers
neimaravila Jun 25, 2026
450db7c
fix(elevenlabs): guard missing channel_index and preserve ValueError …
neimaravila Jun 25, 2026
8571b9a
style(elevenlabs): use builtin generics to stay within UP006 budget
neimaravila Jun 25, 2026
45008cc
feat(elevenlabs): auto-select diarization mechanism by audio channel …
neimaravila Jun 25, 2026
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
4 changes: 2 additions & 2 deletions .github/workflows/guard-main-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
echo "PR head repo: $HEAD_REPO"
echo "PR head branch: $HEAD_REF"
if [ "$HEAD_REPO" != "$BASE_REPO" ]; then
echo "::error::PRs to main must originate from the canonical repository ($BASE_REPO), not a fork ($HEAD_REPO). External contributors should open PRs against the 'litellm_oss_branch' branch instead."
echo "::error::PRs to main must originate from the canonical repository ($BASE_REPO), not a fork ($HEAD_REPO). External contributors should open PRs against the 'litellm_oss_staging' branch instead."
exit 1
fi
if [ "$HEAD_REF" = "litellm_internal_staging" ] || [[ "$HEAD_REF" == litellm_hotfix_?* ]]; then
echo "Allowed source branch."
exit 0
fi
echo "::error::PRs to main must originate from 'litellm_internal_staging' or a 'litellm_hotfix_*' branch. Got: '$HEAD_REF'. If this is a contribution, retarget the PR against 'litellm_oss_branch' instead."
echo "::error::PRs to main must originate from 'litellm_internal_staging' or a 'litellm_hotfix_*' branch. Got: '$HEAD_REF'. If this is a contribution, retarget the PR against 'litellm_oss_staging' instead."
exit 1
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you ever make public-facing PR descriptions, comments, issues, commit message
- don't use "—". Instead, reach for ";", ".", etc.
- don't use the pattern "It's not X, it's Y", "You're not X, you're Y", etc.
- don't use bulleted or numbered lists unless it would be nonsensical not to. Instead, prefer prose
- don't add a trailing "." at the end of paragraphs (just like this file)
- don't add a trailing "." at the end of paragraphs (just like this file). That means every paragraph, not just the last one (of the markdown file, PR description, GitHub comment, etc.). Rule of thumb: unless there's a sentence immediately after, don't add a "."
- don't use →. Instead, prefer not to use arrows, and if need be, use -> instead

Don't hesitate to use values in .env to get needed API keys and other secrets, as long as you never add them to conversation history, commit them, or include them in GitHub issues / PRs
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Base image for building
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:31da6565f35af6401031c1d7aa91dc84ac76c5c48edd17fb90f0ed9e3173c7a9
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370

# Runtime image
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:31da6565f35af6401031c1d7aa91dc84ac76c5c48edd17fb90f0ed9e3173c7a9
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370
ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a

FROM $UV_IMAGE AS uvbin
Expand Down
4 changes: 2 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:31da6565f35af6401031c1d7aa91dc84ac76c5c48edd17fb90f0ed9e3173c7a9
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:31da6565f35af6401031c1d7aa91dc84ac76c5c48edd17fb90f0ed9e3173c7a9
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370
ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a

FROM $UV_IMAGE AS uvbin
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.database
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Base image for building
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370

# Runtime image
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370
ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a

FROM $UV_IMAGE AS uvbin
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.non_root
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Base images
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:3258be472764337fd13095bcbb3182da170243b5819fd67ad4c0754590588b31
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370
ARG PROXY_EXTRAS_SOURCE=published
ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a

Expand Down
45 changes: 45 additions & 0 deletions examples/lar1_ollama_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
model_list:
- model_name: agent-router
litellm_params:
model: ollama/qwen3.5:9b
api_base: http://127.0.0.1:11434
model_info:
id: cloud-smart
type: cloud-smart

- model_name: agent-router
litellm_params:
model: ollama/phi4-mini:latest
api_base: http://127.0.0.1:11434
model_info:
id: cloud-fast
type: cloud-fast

- model_name: agent-router
litellm_params:
model: ollama/llama3.2:3b
api_base: http://127.0.0.1:11434
model_info:
id: local
type: local

- model_name: agent-router
litellm_params:
model: ollama/lfm2.5-thinking:latest
api_base: http://127.0.0.1:11434
model_info:
id: deep
type: deep

router_settings:
routing_strategy: lar1
routing_strategy_args:
confidence_threshold_low: 0.3
confidence_threshold_medium: 0.5
confidence_threshold_high: 0.7

general_settings:
master_key: sk-lar1-demo

litellm_settings:
set_verbose: true
4 changes: 2 additions & 2 deletions gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:31da6565f35af6401031c1d7aa91dc84ac76c5c48edd17fb90f0ed9e3173c7a9
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:31da6565f35af6401031c1d7aa91dc84ac76c5c48edd17fb90f0ed9e3173c7a9
ARG LITELLM_BUILD_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370
ARG LITELLM_RUNTIME_IMAGE=cgr.dev/chainguard/wolfi-base@sha256:c61ac6919b811ea53c4782d69f1fe05218ba3c25d53f01b6ab7892e621bd4370
ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.11.7@sha256:240fb85ab0f263ef12f492d8476aa3a2e4e1e333f7d67fbdd923d00a506a516a

FROM $UV_IMAGE AS uvbin
Expand Down
118 changes: 118 additions & 0 deletions litellm-rust/Cargo.lock

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

4 changes: 4 additions & 0 deletions litellm-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ members = [
"crates/core",
"crates/providers",
"crates/python-bridge",
"crates/ai-gateway",
]
resolver = "2"

Expand All @@ -14,10 +15,13 @@ repository = "https://github.com/BerriAI/litellm"
[workspace.dependencies]
litellm-core = { path = "crates/core" }
litellm-providers = { path = "crates/providers" }
axum = "0.7"
pyo3 = "0.23.5"
rand = "0.8"
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
subtle = "2"
thiserror = "2.0"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
tokio-tungstenite = { version = "0.24", default-features = false, features = ["connect", "rustls-tls-native-roots"] }
Expand Down
50 changes: 50 additions & 0 deletions litellm-rust/crates/ai-gateway/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# ai-gateway — folder architecture

The Axum server that fronts the Rust gateway. It owns transport + config + auth
only; deployment selection lives in `core::router`, transforms in `core`/`providers`.

```
src/
main.rs # entrypoint: build AppState (router + master key), bind, serve
state.rs # AppState — shared Arc<Router> + master_key
gil.rs # GIL-activity tracker (records Python acquisitions)
auth/ # authentication as an axum extractor — added to handler args
mod.rs # RequireMasterKey: FromRequestParts, single master key (LITELLM_MASTER_KEY)
routes/ # one module per route, all matching the same template
AGENTS.md # ← the route template (read this before adding a route)
mod.rs # app(): merges every module's router()
health.rs # simple route (one file): router() + liveness/readiness
gil.rs # simple route (one file): router() + GET /health/gil
realtime/ # route with logic → axum surface + a no-axum service:
mod.rs # router() + handler + WS<->events adapter (the axum surface)
service.rs # business logic (select deployment, call provider) — no axum, testable
python/ # Python interop (feature: python-config) — load-time only
mod.rs, config.rs, AGENTS.md
```

## Rules

- **Routes follow one template.** Each route module exposes
`pub fn router() -> Router<AppState>`; `routes/mod.rs` only merges them. Simple
routes are one file; non-trivial routes are a folder (`handler`/`service`/
`transport`). See `routes/AGENTS.md`.
- **Auth is an extractor.** Add `crate::auth::RequireMasterKey` to a handler's
args; it runs during extraction. Never re-implement the check per route.
- **Handlers are thin.** A handler validates and delegates to its `service`. No
business logic, no provider calls, no transforms in handlers.
- **State is shared and cheap to clone.** Long-lived handles live behind `Arc` in
`state.rs`; read env/config only in `main.rs` when building state.

## Auth (interim)

A single **master key** (`LITELLM_MASTER_KEY`), enforced by the
`auth::RequireMasterKey` extractor: any caller presenting it as
`Authorization: Bearer <key>` may invoke the gateway. Fails closed (500) when
unset; constant-time compare. The server binds `127.0.0.1` by default (`HOST` to
override). Full per-key auth + budgets/rate-limits are delegated to the Python
proxy in a later phase. Health routes don't add the extractor (unauthenticated).

## Python interop

Anything that calls into Python lives in `python/` and is **load-time only** — see
`python/AGENTS.md`. The realtime data path never takes the GIL.
Loading
Loading