litellm/litellm/proxy
mateo-berri d30ce18faf fix(openai)!: refuse OpenAI batch create on a workload identity token
OpenAI runs a batch with the token that created it and never refreshes
it, and a workload identity token expires within an hour, so every
request in a batch OpenAI starts later fails with 401 token_expired.
Batch create on a deployment or OpenAI pass-through that would use a
workload identity token now answers 400 and names the project API key
setup that works. Other batch and file calls keep using federation.
2026-11-13 21:14:13 -08:00
..
_experimental chore(proxy): use neutral example names for baggage tag mappings (#50011) 2026-11-04 14:49:55 +00:00
a2a fix(agents): show non-admin callers the proxy URL in agent cards (#49483) 2026-10-31 16:17:11 -07:00
agent_endpoints refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
alerting_endpoints feat(alerts): add management controls and opt-in daily summaries (#51418) 2026-11-12 10:06:07 -08:00
analytics_endpoints fix(proxy): cancel the Admin UI's raw spend-log reads in Postgres after 30s (#49965) 2026-11-03 16:07:00 -08:00
anthropic_endpoints fix(proxy): count tokens with the thinking, effort, and tool_choice that inference sends (#51079) 2026-11-14 02:29:16 +00:00
auth fix(proxy): preserve caller metadata on auth failures (#51745) 2026-11-13 16:13:50 -08:00
batches_endpoints fix(proxy)!: reject client-supplied Vertex location and project unless the admin opts in (#47028) 2026-11-10 20:50:17 +00:00
client fix(cli): let Claude Code renew a --pkce login's key through lite's apiKeyHelper (#51319) 2026-11-14 04:04:38 +00:00
common_utils fix(proxy): keep carried end-user spend when a budget reset is retried (#51143) 2026-11-14 01:03:19 +00:00
config_management_endpoints
config_resolvers feat: email affected owners before model deprecations (#50172) 2026-11-05 16:14:12 +08:00
container_endpoints refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
credential_endpoints fix(proxy): hold DB_RECONCILE_LOCK around credential create, update and delete (#50551) 2026-11-07 16:02:44 -08:00
custom_hooks refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
db fix(proxy): retain unwritten rollups after database disconnects (#51706) 2026-11-13 13:36:12 -08:00
decisions_endpoints fix(decisions): remove the System One question count cap (#47985) 2026-10-23 18:11:40 +00:00
deps feat(alerts): enable monitoring by default with a five-alert free allowance (#51123) 2026-11-11 18:23:03 -08:00
discovery_endpoints feat(skills): let authors edit and withdraw pending submissions (#51312) 2026-11-12 08:30:10 -08:00
enterprise_billing feat(proxy): authenticate billing metrics with a cognito bearer token (#49852) 2026-11-04 14:08:40 -08:00
example_config_yaml refactor(types): replace Any with proven types in 21 files (#48921) 2026-10-29 18:43:24 -07:00
fine_tuning_endpoints refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
google_endpoints fix(interactions): route Vertex lifecycle calls through the selected deployment (#51511) 2026-11-13 00:02:43 -08:00
guardrails fix(proxy): reject unknown guardrail names on key, user, team and project writes (#51080) 2026-11-11 19:28:45 -08:00
health_check_utils refactor(router): route the router family through RoutingContext and close the outside surface (#49118) 2026-10-30 19:18:54 -07:00
health_endpoints fix(health): log Test Connection spend with the mode's call type and model id (#50987) 2026-11-11 16:07:33 -08:00
hooks refactor(mcp): let the semantic filter take its MCP tool loader as a parameter (#50483) 2026-11-13 16:34:00 -08:00
image_endpoints fix(proxy): log each endpoint's own call type on failed audio, moderation, image, and rerank spend rows (#49684) 2026-11-02 23:57:11 +00:00
lens refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
list_api fix(proxy): keep the submitted body out of 422 validation errors (#43231) 2026-09-25 17:05:53 -07:00
logging_endpoints refactor(types): replace Any with proven types in 157 files (#44798) 2026-10-06 15:31:54 +00:00
management fix(ui): take the dashboard's user role and identity from the server (#47025) 2026-10-17 14:39:33 -07:00
management_endpoints feat(custom-logger-v2): add types, dispatcher and route callback call sites (step 0) (#51214) 2026-11-13 22:08:05 +00:00
management_helpers fix(proxy): delete a customer team's override budget when the team has no overall budget (#51703) 2026-11-13 13:05:19 -08:00
mcp_server feat(custom-logger-v2): add the contract for rust callbacks and bind the proxy request scope (#51526) 2026-11-14 02:33:27 +00:00
memory refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
middleware refactor(redis): delete the Python RedisBatch now that every request op is native (#51383) 2026-11-13 03:22:28 +00:00
ocr_endpoints fix(proxy)!: return provider-matching 4xx for the LIT-8062 status code follow-ups (#45537) 2026-10-13 11:42:39 -07:00
openai_evals_endpoints refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
openai_files_endpoints fix(files): match every spelling of a provider file id in the ownership check (#51498) 2026-11-13 05:43:43 +00:00
pass_through_endpoints fix(openai)!: refuse OpenAI batch create on a workload identity token 2026-11-13 21:14:13 -08:00
policy_engine feat(custom-logger-v2): add types, dispatcher and route callback call sites (step 0) (#51214) 2026-11-13 22:08:05 +00:00
prompts fix(proxy)!: reject client-supplied Vertex location and project unless the admin opts in (#47028) 2026-11-10 20:50:17 +00:00
public_endpoints chore(cost-map): add Soniox v6 and date Soniox, Bedrock Claude and Azure Whisper retirements (#51620) 2026-11-13 12:37:12 -08:00
rag_endpoints feat(opensearch): map vector store search filters to k-NN filters and add hybrid search (#51131) 2026-11-14 03:30:55 +00:00
realtime_endpoints feat(realtime)!: support latest OpenAI audio models (#35600) 2026-11-03 07:27:52 +00:00
rerank_endpoints refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
response_api_endpoints fix(proxy): preserve team aliases in Responses WebSockets (#51380) 2026-11-13 08:42:38 +00:00
response_polling refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
roi_calculator perf(types): defer pydantic schema builds via shared LiteLLMBaseModel (#44720) 2026-10-05 22:10:08 -07:00
rust_forward ci(integration): install the Rust gateway and fail forwarded_proxy when Rust is not in front (#51307) 2026-11-12 04:07:07 +00:00
search_endpoints refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
shutdown feat(proxy): configure the request header buffer size (#49883) 2026-11-03 16:11:46 -08:00
spend_tracking fix(spend-logs): make token redaction opt-in (#51729) 2026-11-13 14:41:12 -08:00
swagger feat(ui): adopt the new LiteLLM logo and monogram (#43913) 2026-09-30 14:51:06 -07:00
telemetry refactor: clean up fresh tech debt in per-user Copilot auth, Ternary FOCUS export and telemetry (#45769) 2026-10-15 04:29:27 +00:00
test_prompts
types_utils refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
ui_crud_endpoints feat(ui): let admins control Aria access for internal users (#51641) 2026-11-13 16:17:12 -05:00
vector_store_endpoints feat(opensearch): map vector store search filters to k-NN filters and add hybrid search (#51131) 2026-11-14 03:30:55 +00:00
vector_store_files_endpoints fix(proxy)!: return managed file ids from rag ingest and use team credentials on vector store file routes (#50459) 2026-11-10 05:44:28 +00:00
vertex_ai_endpoints refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
video_endpoints refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
workflows docs: stop advertising sk-1234 as the master key in shipped configs and examples 2026-09-19 12:59:48 -07:00
.gitignore
__init__.py refactor(logging): load enterprise alerting loggers lazily so import litellm skips proxy types (#44762) 2026-10-05 22:06:53 -07:00
_lazy_features.py feat(proxy): add OpenSearch index pass-through with per-key read/write grants (#50573) 2026-11-09 18:54:20 +00:00
_lazy_openapi_snapshot.json fix(mcp): give the MCP client exactly the servers left on in the connect page (#50973) 2026-11-13 16:36:49 -08:00
_lazy_openapi_snapshot.py chore: move ui and vscode-extension under litellm and delete docs (#50992) 2026-11-12 04:19:57 +00:00
_new_new_secret_config.yaml
_new_secret_config.yaml docs: stop advertising sk-1234 as the master key in shipped configs and examples 2026-09-19 12:59:48 -07:00
_router_host.py refactor(router): move router callers onto the entry points and invert the proxy imports (#48847) 2026-10-29 17:26:33 +00:00
_super_secret_config.yaml
_types.py fix(proxy): count tokens with the thinking, effort, and tool_choice that inference sends (#51079) 2026-11-14 02:29:16 +00:00
admin_mcp.py refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
AGENTS.md feat(proxy): supervise the opt-in Rust forwarding server (#49606) 2026-11-11 19:40:00 +00:00
bug_report_config.py refactor(router): route the router family through RoutingContext and close the outside surface (#49118) 2026-10-30 19:18:54 -07:00
cached_logo.jpg
caching_routes.py refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
collector.py
common_request_processing.py feat(custom-logger-v2): add the contract for rust callbacks and bind the proxy request scope (#51526) 2026-11-14 02:33:27 +00:00
compliance_checks.py
custom_auth_auto.py
custom_prompt_management.py
custom_sso.py
custom_validate.py
dd_span_tagger.py feat: forward-port dd user_email span tag and model hub description from internal staging (#42749) 2026-10-10 16:48:49 -07:00
dev_config.yaml Merge pull request #42071 from BerriAI/litellm_remove_dead_telemetry_flag 2026-09-19 21:48:02 -07:00
dev_reload.py refactor(proxy): let the gunicorn server take a private listener (#50871) 2026-11-11 19:40:00 +00:00
enterprise chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
health_check.py fix(health): log Test Connection spend with the mode's call type and model id (#50987) 2026-11-11 16:07:33 -08:00
lambda.py
litellm_pre_call_utils.py feat(custom-logger-v2): add the contract for rust callbacks and bind the proxy request scope (#51526) 2026-11-14 02:33:27 +00:00
llamaguard_prompt.txt
logo.png feat(ui): adopt the new LiteLLM logo and monogram (#43913) 2026-09-30 14:51:06 -07:00
logo_dark.png feat(ui): adopt the new LiteLLM logo and monogram (#43913) 2026-09-30 14:51:06 -07:00
logo_monogram.png feat(ui): adopt the new LiteLLM logo and monogram (#43913) 2026-09-30 14:51:06 -07:00
logo_monogram_dark.png feat(ui): adopt the new LiteLLM logo and monogram (#43913) 2026-09-30 14:51:06 -07:00
mcp_registry.json feat(mcp): add Microsoft 365 (Graph) server to the MCP catalog (#43099) 2026-10-02 02:50:29 +00:00
mcp_tools.py chore(typing): clear 670 basedpyright Any errors by validating provider payloads at the boundary (#45388) 2026-10-13 15:35:23 -07:00
model_config.yaml
model_insights_tasks.json feat: add model leaderboard page (#43649) 2026-09-28 19:40:04 -07:00
moyai_endpoints.py refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
native_compaction.py feat(router): native compact-to-fit across conversation APIs (#42074) 2026-09-21 22:52:29 -07:00
openapi.json
openapi_registry.json
plugin_routes.py fix(proxy): build plugin session claims from FIPS provider services in fips_mode (#50544) 2026-11-09 11:07:57 -08:00
post_call_rules.py
prisma_migration.py fix(proxy): always exit when database setup fails at boot (#44141) 2026-10-01 21:51:06 -07:00
prometheus_cleanup.py feat(prometheus): cap series per metric for every labeled metric (#44420) 2026-10-06 01:28:44 +00:00
prometheus_metrics_server.py perf(types): defer pydantic schema builds via shared LiteLLMBaseModel (#44720) 2026-10-05 22:10:08 -07:00
proxy_cli.py feat(proxy): supervise the opt-in Rust forwarding server (#49606) 2026-11-11 19:40:00 +00:00
proxy_config.yaml docs: stop advertising sk-1234 as the master key in shipped configs and examples 2026-09-19 12:59:48 -07:00
proxy_server.py fix(proxy): count tokens with the thinking, effort, and tool_choice that inference sends (#51079) 2026-11-14 02:29:16 +00:00
read_model_list.py chore(typing): clear 670 basedpyright Any errors by validating provider payloads at the boundary (#45388) 2026-10-13 15:35:23 -07:00
README.md
route_llm_request.py feat(bedrock): search knowledge bases by image and return image hits (#51063) 2026-11-12 00:19:34 +00:00
route_priority.py fix(proxy): let configured pass-through endpoints outrank built-in provider prefix routes (#44133) 2026-10-10 12:26:17 -07:00
schema.prisma fix(proxy): keep carried end-user spend when a budget reset is retried (#51143) 2026-11-14 01:03:19 +00:00
server_listener.py refactor(proxy): let the gunicorn server take a private listener (#50871) 2026-11-11 19:40:00 +00:00
tracing_endpoints.py refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
tracing_runtime.py fix(proxy): cooldown errors carry 429, Sentry starts at boot without request bodies, tracing failures log at ERROR, exporter counters exported (#46344) 2026-10-16 00:53:52 +00:00
utils.py feat(custom-logger-v2): add the contract for rust callbacks and bind the proxy request scope (#51526) 2026-11-14 02:33:27 +00:00
v2_proxy_fields.py feat(custom-logger-v2): add the contract for rust callbacks and bind the proxy request scope (#51526) 2026-11-14 02:33:27 +00:00
wildcard_config.yaml Merge pull request #42071 from BerriAI/litellm_remove_dead_telemetry_flag 2026-09-19 21:48:02 -07:00

litellm-proxy

A local, fast, and lightweight OpenAI-compatible server to call 100+ LLM APIs.

usage

$ uv tool install litellm
$ litellm --model ollama/codellama 

#INFO: Ollama running on http://0.0.0.0:8000

replace openai base

import openai # openai v1.0.0+
client = openai.OpenAI(api_key="anything",base_url="http://0.0.0.0:8000") # set proxy to base_url
# request sent to model set on litellm proxy, `litellm --model`
response = client.chat.completions.create(model="gpt-3.5-turbo", messages = [
    {
        "role": "user",
        "content": "this is a test request, write a short poem"
    }
])

print(response)

See how to call Huggingface,Bedrock,TogetherAI,Anthropic, etc.


Folder Structure

Routes

  • proxy_server.py - all openai-compatible routes - /v1/chat/completion, /v1/embedding + model info routes - /v1/models, /v1/model/info, /v1/model_group_info routes.
  • health_endpoints/ - /health, /health/liveliness, /health/readiness
  • management_endpoints/key_management_endpoints.py - all /key/* routes
  • management_endpoints/team_endpoints.py - all /team/* routes
  • management_endpoints/internal_user_endpoints.py - all /user/* routes
  • management_endpoints/ui_sso.py - all /sso/* routes