litellm/litellm/proxy
Tin Chi Lo 5dd99ca52f feat(mcp): add botocore SigV4 signer body for the v2 aws_sigv4 arm
HttpxSigV4Signer is the real SignerFactory body for the aws_sigv4 arm: it maps the typed
credential source (StaticKeys / AssumeRole / Ambient) onto v1's MCPSigV4Auth, so the signed
headers stay byte-identical to v1 by construction (the signer relocates into the v2 package when
v1 is retired). Credentials resolve eagerly off the event loop (asyncio.to_thread) so an
unassumable role or a missing ambient chain fails closed at build time rather than mid-request;
STS connection errors map to upstream_unavailable, everything else to misconfigured.

This is the seam-agnostic body only. Wiring it into the bridge and grafting it at
_create_mcp_client's aws_auth seam (aws_sigv4 signs per request, so it cannot ride the header
seam the other modes use) is a follow-up.

Tests cover signing a real request (AWS4-HMAC-SHA256 + X-Amz-Date), the session-token path
(X-Amz-Security-Token), region/service in the credential scope, and the error classification.
2026-06-18 16:48:30 -07:00
..
_experimental feat(mcp): add botocore SigV4 signer body for the v2 aws_sigv4 arm 2026-06-18 16:48:30 -07:00
a2a feat(a2a): well-known agent-card discovery + LangGraph Platform mode (#28860) 2026-05-29 20:50:42 -07:00
agent_endpoints chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
analytics_endpoints fix(spend): session-TZ-independent date filtering for spend/error log queries 2026-04-10 17:04:52 -07:00
anthropic_endpoints ci(lint): add blanket-noqa, dataclass-default, and unused-noqa Ruff rules (#30516) 2026-06-16 12:07:22 -07:00
auth chore: litellm oss staging160626 (#30527) 2026-06-16 18:23:13 -07:00
batches_endpoints chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
client feat(cli): per-agent lite claude / codex / opencode commands that wrap coding agents through the proxy (#29850) 2026-06-10 13:52:26 -07:00
common_utils fix(proxy): list public team model name in /v1/models (#30588) 2026-06-17 09:17:22 -07:00
config_management_endpoints build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
container_endpoints feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
credential_endpoints feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
custom_hooks style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
db chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
discovery_endpoints ci: drop mypy entirely, standardize type checking on basedpyright (#30648) 2026-06-17 09:42:00 -07:00
example_config_yaml Extend the record/replay proxy to chat, embeddings, moderations, rerank, and Anthropic (#29847) 2026-06-06 14:33:42 -07:00
fine_tuning_endpoints style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
gateway refactor(mcp): model api_key placement as (header_name, value_prefix) 2026-06-18 09:08:24 -07:00
google_endpoints ci: drop mypy entirely, standardize type checking on basedpyright (#30648) 2026-06-17 09:42:00 -07:00
guardrails feat(guardrails): surface OpenAI moderation violation_categories on guardrail traces (#30659) 2026-06-17 09:44:19 -07:00
health_check_utils feat(proxy): skip disable_background_health_check models on GET /health when flag set (#27716) 2026-05-13 09:49:05 -07:00
health_endpoints chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
hooks chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
image_endpoints fix(proxy): extend response headers hook to streaming, TTS, image gen, and pass-through (#24232) 2026-06-09 22:10:23 +02:00
management_endpoints ci: drop mypy entirely, standardize type checking on basedpyright (#30648) 2026-06-17 09:42:00 -07:00
management_helpers feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
memory feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
middleware fix(proxy): point /metrics 401 at the opt-out flag 2026-05-08 18:09:14 -07:00
ocr_endpoints Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
openai_evals_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
openai_files_endpoints fix(proxy): resolve list files credentials from team BYOK deployments (#30495) 2026-06-17 10:32:52 -07:00
pass_through_endpoints chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
policy_engine fix(guardrails): run pre_call hook once for model-level guardrails (#30543) 2026-06-16 11:17:03 -07:00
prompts feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
public_endpoints chore: litellm oss staging160626 (#30527) 2026-06-16 18:23:13 -07:00
rag_endpoints feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
realtime_endpoints feat: litellm oss 110626 (#30202) 2026-06-11 22:30:26 -07:00
rerank_endpoints
response_api_endpoints Litellm websocket improvements (#29563) 2026-06-03 11:48:35 -07:00
response_polling chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
search_endpoints fix(proxy): self-heal startup/reload prisma reads on engine disconnect (#28803) 2026-06-10 20:16:58 +02:00
shutdown feat(proxy): native /health/drain preStop hook for graceful shutdown (#29439) 2026-06-02 16:30:44 -07:00
spend_tracking chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
swagger
test_prompts
types_utils fix(types_utils): drop opt-in env from remote-module runtime gate 2026-05-13 02:52:14 +00:00
ui_crud_endpoints feat(ui): add admin flag to disable in-product UI nudges for everyone (#29796) 2026-06-09 17:45:42 -07:00
vector_store_endpoints feat(litellm): add models and repository layers (#29686) 2026-06-06 20:59:33 -07:00
vector_store_files_endpoints Title: fix(proxy): resolve vector store file list credentials from team deployments (#29739) 2026-06-06 12:36:05 -07:00
vertex_ai_endpoints build(deps-dev): bump black to 26.3.1 and apply formatting (#28525) 2026-05-21 17:24:18 -07:00
video_endpoints [Staging] - Ishaan March 17th (#23903) 2026-03-18 15:09:01 -07:00
workflows feat(proxy): durable agent workflow run tracking via /v1/workflows/runs (#26793) 2026-04-29 17:12:18 -07:00
.gitignore
__init__.py
_lazy_features.py feat(a2a): well-known agent-card discovery + LangGraph Platform mode (#28860) 2026-05-29 20:50:42 -07:00
_lazy_openapi_snapshot.json Litellm oss staging 1 (#28337) 2026-05-20 17:27:03 -07:00
_lazy_openapi_snapshot.py [Fix] Proxy: Repair Stale HTTP_METHODS Reference In Lazy OpenAPI Snapshot 2026-05-01 15:11:56 -07:00
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml Litellm krrish staging 04 20 2026 (#26138) 2026-04-20 16:22:12 -07:00
_super_secret_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
_types.py feat(proxy): add verification_uri_complete to CLI SSO device flow (#30571) 2026-06-16 17:23:37 -07:00
cached_logo.jpg fix: prompt registry 2026-02-18 00:34:54 +05:30
caching_routes.py Litellm oss staging 040626 (#29671) 2026-06-04 11:07:20 -07:00
common_request_processing.py ci: drop mypy entirely, standardize type checking on basedpyright (#30648) 2026-06-17 09:42:00 -07:00
compliance_checks.py Add compliance checker endpoints + UI panel (#21432) 2026-02-17 18:22:26 -08:00
custom_auth_auto.py
custom_prompt_management.py fix: prompt registry 2026-02-18 00:34:54 +05:30
custom_sso.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
custom_validate.py
dd_span_tagger.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
dev_config.yaml feat: add dev and wildcard proxy configs for local testing (#30556) 2026-06-17 06:47:11 -07:00
enterprise
health_check.py fix(health): correct bedrock embedding health checks (#30583) 2026-06-17 14:34:09 -07:00
lambda.py
litellm_pre_call_utils.py chore: litellm oss staging160626 (#30527) 2026-06-16 18:23:13 -07:00
llamaguard_prompt.txt
logo.jpg
mcp_registry.json fix(mcp): default Linear MCP registry entry to streamable HTTP (#30396) 2026-06-13 14:45:47 -07:00
mcp_tools.py
model_config.yaml
openapi.json
openapi_registry.json feat(ui): OpenAPI MCP server support with popular API quick-picker (#23200) 2026-03-10 13:59:52 -07:00
post_call_rules.py ci(lint): add blanket-noqa, dataclass-default, and unused-noqa Ruff rules (#30516) 2026-06-16 12:07:22 -07:00
prisma_migration.py
prometheus_cleanup.py Add Prometheus child_exit cleanup for gunicorn workers 2026-02-27 16:11:15 -08:00
proxy_cli.py feat(mcp): graft the v2 resolver into v1 for none + api_key (flag-gated) 2026-06-18 09:24:45 -07:00
proxy_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
proxy_server.py ci: drop mypy entirely, standardize type checking on basedpyright (#30648) 2026-06-17 09:42:00 -07:00
README.md build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
route_llm_request.py chore(lint): remove PLR0915 too-many-statements ruff rule (#30574) 2026-06-16 16:52:49 -07:00
schema.prisma feat(mcp): per-server env vars with global + per-user scopes (#28917) 2026-06-05 20:15:11 -07:00
start.sh
utils.py fix(proxy): list public team model name in /v1/models (#30588) 2026-06-17 09:17:22 -07:00
wildcard_config.yaml feat: add dev and wildcard proxy configs for local testing (#30556) 2026-06-17 06:47:11 -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