litellm/litellm/proxy
shrey kharbanda 663fa5778e feat(mcp): replace MCP auth profiles on server update
PUT /v1/mcp/server takes additional_auth on its own request model. Omitting it keeps the stored profiles, a list replaces them by id and keeps the secrets a profile omits unless its token_url changes, and an empty list removes them. Rows are written for this server only. A profile that changes its kind must resend its secret, a profile left without client_id, client_secret, token_url or its token after the keep rule is refused with 400, and turning a server with profiles into a stdio, BYOK or OpenAPI server is refused with 400
2026-11-20 01:08:38 +00: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 feat(auth): decide key and JWT authentication in a Rust core (#51374) 2026-11-17 14:07:47 +09:00
alerting_endpoints feat(alerts): add email labels, bulk actions and threshold editing (#52139) 2026-11-16 15:32:19 -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(responses): scope cacheable system input to stateless requests (#52694) 2026-11-18 17:24:52 -08:00
auth feat(proxy): add team budget percentage email alerts (#52859) 2026-11-19 16:21:25 -08:00
batches_endpoints fix(proxy): resolve a team wildcard deployment for a wildcard key on files, batches and RAG routes (#49744) 2026-11-18 10:55:44 +00:00
client fix(cli): carry configured service tiers and display names into the lite codex catalog (#49422) 2026-11-18 02:19:48 +00:00
common_utils feat(proxy): add team budget percentage email alerts (#52859) 2026-11-19 16:21:25 -08: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
control_plane feat(control-plane): runtime dataplane and role writes via redis stream and postgres (#51762) 2026-11-16 17:36:25 +00:00
credential_endpoints feat(nvidia_nim): refresh the catalog and discover upstream models (#50439) 2026-11-17 18:39:59 -08:00
custom_hooks refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
db feat(mcp): replace MCP auth profiles on server update 2026-11-20 01:08:38 +00:00
decisions_endpoints fix(decisions): forward OpenAI prompt cache fields (#51457) 2026-11-18 03:25:09 +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(callbacks-parallel-request-limiter): port parallel request limiter v3 to a rust callback (#51537) 2026-11-16 22:56:38 -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 chore: move LiteLLM's configs and e2e tests off gpt-4o and gpt-4.1 before their 2027-01-14 shutdown (#51800) 2026-11-14 10:50:59 -08: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 feat(guardrails): opt-in pre_call scan of tool descriptions as text for PANW and Presidio (#50301) 2026-11-19 14:04:10 -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: clean up fresh tech debt in routing, riva, least-busy, proxy cache and prompt template helpers (#50192) 2026-11-19 09:43:47 +00:00
image_endpoints fix(gemini): return n images for image generations and edits when n > 1 (#52103) 2026-11-16 14:50:13 -08:00
lens refactor(lens): connect LiteLLM to the independent Lens service (#45529) 2026-10-09 16:17:05 -07:00
list_api
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(mcp): replace MCP auth profiles on server update 2026-11-20 01:08:38 +00:00
management_helpers feat(proxy): link app member budgets to shared templates (#52989) 2026-11-19 17:05:05 -08:00
mcp_server feat(mcp): replace MCP auth profiles on server update 2026-11-20 01:08:38 +00:00
memory refactor(typing): clear 1181 basedpyright Any errors across 431 files (#47789) 2026-10-24 11:31:09 -07:00
middleware feat(proxy): let operators omit x-litellm-* response headers (#52949) 2026-11-19 15:27:34 -08: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(proxy): org admin spend log scope and gemini file id parsing (#52943) 2026-11-19 22:08:27 +00:00
pass_through_endpoints feat(anthropic): price Claude subscription OAuth allowance usage at $0, overage at API rates (#52901) 2026-11-19 15:08:39 -08:00
policy_engine fix(guardrails): mask reasoning text on /v1/responses output (#52504) 2026-11-19 01:25:06 -08: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 feat(providers): add Sarvam Token Factory v2 models (#49792) 2026-11-18 13:19:05 +00:00
rag_endpoints feat(vector_stores): add YAML-configured unified search fallbacks (#52093) 2026-11-18 08:41:02 -08:00
realtime_endpoints feat(realtime)!: support latest OpenAI audio models (#35600) 2026-11-03 07:27:52 +00:00
rerank_endpoints fix(proxy): honor cancel_on_disconnect on the rerank endpoints (#51252) 2026-11-14 03:59:22 -05:00
response_api_endpoints fix(responses): send an HTTP status on websocket guardrail block frames (#52942) 2026-11-19 14:22:22 -08:00
response_polling fix(responses): stop the background stream when a polling response is cancelled (#49384) 2026-11-18 14:33:39 +00:00
roi_calculator perf(types): defer pydantic schema builds via shared LiteLLMBaseModel (#44720) 2026-10-05 22:10:08 -07:00
rust_forward feat(gateway): serve one native app in both modes, answering a master key caller's /v1/messages with it in front of Python (#52229) 2026-11-19 12:06:49 +09:00
search_endpoints feat(fips): encrypt stored secrets with the FIPS provider's AES-256-GCM in fips_mode (#51429) 2026-11-18 03:22:53 +00:00
shutdown feat(proxy): configure the request header buffer size (#49883) 2026-11-03 16:11:46 -08:00
spend_tracking feat(proxy): emit budget alerts for app customer scopes (#52955) 2026-11-19 16:21:09 -08:00
swagger
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(auth): read projects, tags, access groups and object permissions through rust repositories (#52178) 2026-11-18 22:32:06 +00:00
vector_store_endpoints feat(vector_stores): add YAML-configured unified search fallbacks (#52093) 2026-11-18 08:41:02 -08:00
vector_store_files_endpoints fix(proxy): resolve a team wildcard deployment for a wildcard key on files, batches and RAG routes (#49744) 2026-11-18 10:55:44 +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
.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): support Cursor CLI subscriptions (#52205) 2026-11-16 21:49:12 -08:00
_lazy_openapi_snapshot.json feat(mcp): replace MCP auth profiles on server update 2026-11-20 01:08:38 +00: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 chore: move LiteLLM's configs and e2e tests off gpt-4o and gpt-4.1 before their 2027-01-14 shutdown (#51800) 2026-11-14 10:50:59 -08: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 chore: move LiteLLM's configs and e2e tests off gpt-4o and gpt-4.1 before their 2027-01-14 shutdown (#51800) 2026-11-14 10:50:59 -08:00
_types.py feat(mcp): replace MCP auth profiles on server update 2026-11-20 01:08:38 +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 fix(proxy): release request bodies of failed calls without waiting for a full GC (#52600) 2026-11-19 00:50:33 +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 chore: move LiteLLM's configs and e2e tests off gpt-4o and gpt-4.1 before their 2027-01-14 shutdown (#51800) 2026-11-14 10:50:59 -08: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(anthropic): price Claude subscription OAuth allowance usage at $0, overage at API rates (#52901) 2026-11-19 15:08:39 -08:00
llamaguard_prompt.txt
logo.png
logo_dark.png
logo_monogram.png
logo_monogram_dark.png
mcp_registry.json feat(mcp): add Parallel to the MCP discovery registry (#52141) 2026-11-16 16:30:58 -08: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 chore: move LiteLLM's configs and e2e tests off gpt-4o and gpt-4.1 before their 2027-01-14 shutdown (#51800) 2026-11-14 10:50:59 -08:00
model_insights_tasks.json
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
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
pricing_currency.py feat(proxy): accept request token prices in a declared currency (#51971) 2026-11-16 15:16:24 -08:00
prisma_migration.py fix(proxy): skip prisma generate in the migration job when the prisma package is not writable (#52460) 2026-11-19 01:12:10 +00: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(gateway): serve one native app in both modes, answering a master key caller's /v1/messages with it in front of Python (#52229) 2026-11-19 12:06:49 +09:00
proxy_config.yaml chore: move LiteLLM's configs and e2e tests off gpt-4o and gpt-4.1 before their 2027-01-14 shutdown (#51800) 2026-11-14 10:50:59 -08:00
proxy_server.py feat(proxy): emit budget alerts for app customer scopes (#52955) 2026-11-19 16:21:09 -08: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
request_auth_context.py feat(model_capacity): replace the python dynamic rate limiter v3 with a rust callback (#51540) 2026-11-17 22:20:54 +00:00
route_llm_request.py feat(anthropic): price Claude subscription OAuth allowance usage at $0, overage at API rates (#52901) 2026-11-19 15:08:39 -08: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 feat(mcp): store additional auth profiles on MCP servers 2026-11-20 01:08:13 +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(proxy): add team budget percentage email alerts (#52859) 2026-11-19 16:21:25 -08:00
v2_proxy_fields.py refactor: reuse the shared session id reader and drop fresh restating comments (#52250) 2026-11-17 00:23:38 -08:00
wildcard_config.yaml

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