litellm/litellm/proxy
ishaan-berri 2c0d20b327
Merge pull request #25441 from csoni-cweave/per-user-mcp-oauth-token
feat(mcp): add per-user OAuth token storage for interactive MCP flows
2026-04-09 19:03:59 -07:00
..
_experimental feat(mcp): add per-user OAuth token storage for interactive MCP flows 2026-04-09 12:42:42 -07:00
agent_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
analytics_endpoints
anthropic_endpoints Litellm ishaan march 20 (#24303) 2026-03-21 12:40:11 -07:00
auth fix(auth): support selective jwt override oauth2 routing (#25252) 2026-04-07 13:52:47 -07:00
batches_endpoints Merge pull request #23957 from Sameerlite/litellm_vertex-cancel-batch 2026-03-20 23:32:50 +05:30
client Merge remote-tracking branch 'origin' into litellm_internal_dev_03_12_2026 2026-03-13 15:11:49 -07:00
common_utils Litellm ishaan april4 2 (#25150) 2026-04-04 23:09:42 +00:00
config_management_endpoints
container_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
credential_endpoints style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03:00
custom_hooks style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
db cherry-pick: tag query fix + MCP metadata support (#25145) 2026-04-04 16:44:02 -07:00
discovery_endpoints feat: add control plane for multi-proxy worker management 2026-03-19 22:50:19 -07:00
example_config_yaml Litellm fix update bedrock models (#24947) 2026-04-01 19:22:54 -07:00
fine_tuning_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
google_endpoints fix: Metadata / Trace ID Missing in S3 Streaming Callbacks 2026-02-25 14:16:21 +05:30
guardrails Merge remote-tracking branch 'origin/main' into litellm_feat-add-guardrail 2026-04-04 16:17:38 -07:00
health_check_utils Litellm ishaan april4 2 (#25150) 2026-04-04 23:09:42 +00:00
health_endpoints Litellm ishaan april4 2 (#25150) 2026-04-04 23:09:42 +00:00
hooks Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
image_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
management_endpoints [Refactor] Align /v2/key/info response handling with v1 2026-04-07 15:21:42 -07:00
management_helpers Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
middleware Fix inflight mypy 2026-03-02 19:41:32 +05:30
ocr_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
openai_evals_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
openai_files_endpoints fix(router): pass custom_llm_provider to get_llm_provider for unprefixed model names (#25334) 2026-04-08 21:27:13 -07:00
pass_through_endpoints feat(proxy): add project_alias tracking through callback metadata pipeline 2026-03-23 10:44:17 -07:00
policy_engine Litellm ishaan april4 2 (#25150) 2026-04-04 23:09:42 +00:00
prompts Litellm ishaan april1 try2 (#25110) 2026-04-03 14:57:44 -07:00
public_endpoints feat(ui): expose Azure Entra ID credential fields in provider form 2026-04-04 11:19:45 -07:00
rag_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
realtime_endpoints [Fix] Use type:ignore instead of Union return type for realtime endpoint 2026-03-13 11:42:26 -07:00
rerank_endpoints
response_api_endpoints fix: address Greptile review comments 2026-03-19 14:10:58 +05:30
response_polling feat(polling): check rate limits before creating polling ID 2026-03-19 13:59:59 +05:30
search_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
spend_tracking Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
swagger
test_prompts
types_utils style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
ui_crud_endpoints [Fix] Remove "API" from custom key description text 2026-03-16 22:35:44 -07:00
vector_store_endpoints fix(mypy): sync route_type Literals, fix BFL params and signatures 2026-03-12 23:51:35 +00:00
vector_store_files_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
vertex_ai_endpoints fix: add .copy() to create_request_copy and tests for header caching 2026-02-18 09:44:35 -08:00
video_endpoints [Staging] - Ishaan March 17th (#23903) 2026-03-18 15:09:01 -07:00
.gitignore
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml fix: fix responses cost calc 2026-03-18 19:52:59 -07:00
_super_secret_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
_types.py Litellm oss staging 04 02 2026 p1 (#25055) 2026-04-08 21:37:10 -07:00
cached_logo.jpg fix: prompt registry 2026-02-18 00:34:54 +05:30
caching_routes.py
common_request_processing.py fix(guardrails): return HTTP 400 instead of 500 for Model Armor streaming blocks (#24693) 2026-04-02 21:28:52 -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
enterprise
health_check.py Litellm ishaan april4 2 (#25150) 2026-04-04 23:09:42 +00:00
lambda.py
litellm_pre_call_utils.py feat(proxy): add credential overrides per team/project via model_config metadata (#24438) 2026-04-09 07:22:27 -07:00
llamaguard_prompt.txt
logo.jpg
mcp_registry.json feat(ui): group MCP tools by CRUD risk category in allowlist panels (#23403) 2026-03-11 21:15:25 -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
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(proxy): use AZURE_DEFAULT_API_VERSION for proxy --api_version default 2026-03-19 15:57:03 +05:30
proxy_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
proxy_server.py Litellm oss staging 04 02 2026 p1 (#25055) 2026-04-08 21:37:10 -07:00
README.md
route_llm_request.py style: apply black formatting to fix CI lint check 2026-03-17 18:52:57 +00:00
schema.prisma Litellm ishaan march23 - MCP Toolsets + GCP Caching fix (#25146) (#25155) 2026-04-04 16:23:21 -07:00
start.sh
utils.py Litellm oss staging 04 02 2026 p1 (#25055) 2026-04-08 21:37:10 -07:00

litellm-proxy

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

usage

$ pip 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