litellm/litellm/proxy
mateo 0881dc7c5b revert: undo teamless all-team-models denial from #32022 and #29746 (#32032)
Backport of #32032 to stable/1.89.x.
Cherry-picked from 5ece78fb5f (litellm_internal_staging).
Scoped to the teamless all-team-models regression fix; can_key_call_resolved_model
does not exist on this line, and staging-only test coverage that depends on code
paths not present here was omitted.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-07-07 20:50:34 +00:00
..
_experimental chore: update Next.js build artifacts (2026-06-24 03:48 UTC, node v20.20.2) 2026-06-23 20:48:48 -07:00
a2a feat(a2a): well-known agent-card discovery + LangGraph Platform mode (#28860) 2026-05-29 20:50:42 -07:00
agent_endpoints Support OAuth M2M for Databricks Apps A2A agents (#29586) 2026-06-04 23:03:37 -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 feat(context_management): compact_20260112 polyfill for non-Anthropic providers (#28868) 2026-05-30 09:20:05 -07:00
auth revert: undo teamless all-team-models denial from #32022 and #29746 (#32032) 2026-07-07 20:50:34 +00:00
batches_endpoints Title: Fix managed batch cancel credential resolution (#29734) 2026-06-06 12:35:18 -07:00
client fix(proxy/client): redact api key from key/info client error messages (#31342) 2026-06-29 17:45:32 -07:00
common_utils fix(guardrails): run pre_call hook once for model-level guardrails (#30543) 2026-06-20 11:49:30 -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 fix(containers): record ownership for service-account keys + fix Prisma Json serialization (#28990) 2026-05-27 21:00:07 -07:00
credential_endpoints style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
custom_hooks style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
db fix(proxy): return 5xx on DB infra errors during auth; reserve 401 for genuine auth failures (#29986) 2026-06-15 18:22:38 -07:00
discovery_endpoints feat: add control plane for multi-proxy worker management 2026-03-19 22:50:19 -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
google_endpoints fix(proxy): omit OpenAI [DONE] on google-genai streamGenerateContent (#29426) 2026-06-01 14:38:19 -07:00
guardrails fix(guardrails): return 400 not 500 when AIM blocks a request (#30573) 2026-06-20 11:58:38 -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 feat(proxy): native /health/drain preStop hook for graceful shutdown (#29439) 2026-06-02 16:30:44 -07:00
hooks fix(vertex/files): stream OpenAI->Vertex batch JSONL uploads (#31036) 2026-06-24 18:10:04 -07:00
image_endpoints fix: tighten file input handling in image edit endpoints 2026-04-22 18:04:39 -07:00
management_endpoints Merge pull request #29528 from aanchal22/litellm_byok-alias-merge 2026-06-15 18:32:16 -07:00
management_helpers feat(mcp): scope a key to zero MCP servers with no-mcp-servers sentinel (#31029) 2026-06-23 20:00:04 -07:00
memory Litellm memory improvements v2 (#26541) 2026-04-25 19:03:43 -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(vertex/files): stream OpenAI->Vertex batch JSONL uploads (#31036) 2026-06-24 18:10:04 -07:00
pass_through_endpoints fix(passthrough,streaming): recover cost on interrupted and agentic Anthropic streams (#31035) 2026-06-24 17:45:20 -07:00
policy_engine fix(guardrails): run pre_call hook once for model-level guardrails (#30543) 2026-06-20 11:49:30 -07:00
prompts fix: harden /key/update authorization checks (#27878) 2026-05-14 04:16:04 +00:00
public_endpoints Litellm oss staging 050626 (#29774) 2026-06-05 13:51:51 -07:00
rag_endpoints fix: harden /key/update authorization checks (#27878) 2026-05-14 04:16:04 +00: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 Litellm websocket improvements (#29563) 2026-06-03 11:48:35 -07:00
response_polling style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
search_endpoints fix(auth): let internal users view search tools (#29542) 2026-06-03 01:36:14 +00:00
shutdown feat(proxy): native /health/drain preStop hook for graceful shutdown (#29439) 2026-06-02 16:30:44 -07:00
spend_tracking fix(proxy): record partial spend on the failure row for interrupted streams (#30788) 2026-06-24 17:41:54 -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 chore(ci): merge dev branch (#28657) 2026-05-25 13:48:47 -07:00
vector_store_endpoints fix(proxy): restrict vector store index create/delete to proxy admins (#29202) 2026-05-30 15:10:21 -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(mcp): scope a key to zero MCP servers with no-mcp-servers sentinel (#31029) 2026-06-23 20:00:04 -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 fix(guardrails): return 400 not 500 when AIM blocks a request (#30573) 2026-06-20 11:58:38 -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 agent oss staging 05 11 2026 (#27733) 2026-05-13 14:09:12 -07:00
lambda.py
litellm_pre_call_utils.py fix(guardrails): run pre_call hook once for model-level guardrails (#30543) 2026-06-20 11:49:30 -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): add option to disable server-side prepared statements for DB lookups (#29984) 2026-06-15 18:22:23 -07:00
proxy_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
proxy_server.py fix(proxy): list public team model name in /v1/models (#30588) 2026-06-17 18:34:07 -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 Gemini managed agents support (#28270) 2026-05-19 16:02:03 -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): record partial spend on the failure row for interrupted streams (#30788) 2026-06-24 17:41:54 -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