litellm/litellm/proxy
ryan-crabbe-berri 72273ea88b refactor(proxy): compose the /user/list search predicate without mutating the where dict
Greptile flagged the new search branch in get_users for extending the endpoint's indexed-assignment pattern. The search predicate now comes from a small pure helper and is merged in the one-shot comprehension that already strips unset Query params, so the where clause Prisma receives is unchanged

Claude-Session: https://claude.ai/code/session_018yW93iDaEMhoQUXcYjus7D
2026-09-03 12:13:12 -07:00
..
_experimental fix(mcp): scope allow-all servers to virtual keys (#39531) 2026-09-03 10:32:03 -07:00
a2a chore(lint): clear grandfathered over-limit lint drift and ratchet budgets down 2026-08-05 12:18:13 -07:00
agent_endpoints style: drop explanatory comments from the agent publish fix 2026-09-03 04:27:43 -07:00
analytics_endpoints feat(ui): add error-code drilldown for failed requests on caching page 2026-08-24 15:45:45 -07:00
anthropic_endpoints fix(proxy): handle CRLF and CR SSE frame terminators and flush held tail in anthropic stream restamper 2026-09-01 12:16:27 -07:00
auth fix(proxy): mark session/SSO/SAML cookies Secure behind a TLS-terminating reverse proxy (#39391) 2026-09-02 16:42:29 -07:00
batches_endpoints Merge pull request #37198 from BerriAI/litellm_lit5660_batches_limit_400 2026-08-17 15:53:46 -07:00
client feat(cli): enable Claude Code gateway model discovery by default in lite claude (#39445) 2026-09-03 08:38:25 -07:00
common_utils fix: keep litellm importable on Python 3.10 and guard 3.11-only typing imports in CI (#39448) 2026-09-02 18:27:19 -07:00
config_management_endpoints feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
config_resolvers feat(alerting): add native Microsoft Teams alerting destination (#38367) 2026-08-27 16:19:22 -07:00
container_endpoints fix(proxy): route container create and list through model_list deployments 2026-09-01 23:26:23 +00:00
credential_endpoints Merge branch 'litellm_internal_staging' into fix-credential-endpoints-raise-not-return 2026-09-03 05:36:50 -07:00
custom_hooks feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
db fix(proxy/db): translate libpq sslrootcert and verify-* into Prisma's strict TLS params (#39563) 2026-09-03 10:27:46 -07:00
discovery_endpoints feat(auth): enforce configurable password policy and SSO-only login (#39381) 2026-09-02 14:28:13 -07:00
enterprise_billing chore(lint): clear grandfathered over-limit lint drift and ratchet budgets down 2026-08-05 12:18:13 -07:00
example_config_yaml fix(search): harden bing_grounding auth, result cap, status, and cost 2026-08-24 12:26:07 -07:00
fine_tuning_endpoints fix(proxy): authenticate managed ids before routing 2026-08-08 02:42:34 -07:00
google_endpoints feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
guardrails fix(guardrail): hide-secrets playground redaction and guardrail telemetry (#39398) 2026-09-03 00:01:03 -07:00
health_check_utils fix(proxy): derive auto-router health from its underlying models (#38174) 2026-08-26 16:41:54 -07:00
health_endpoints fix(health): honor allow_requests_on_db_unavailable in readiness probe (#37640) 2026-08-29 10:17:12 -07:00
hooks fix(proxy): share per-model budget counters across replicas through the spend counter cache (#39375) 2026-09-02 12:40:59 -07:00
image_endpoints fix(videos): forward uploaded source file on /v1/videos/edits to the provider 2026-08-24 15:34:21 -07:00
list_api feat(proxy): add paginated GET /public/v1/model_hub (#38636) 2026-08-28 10:02:59 -07:00
logging_endpoints feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
management_endpoints refactor(proxy): compose the /user/list search predicate without mutating the where dict 2026-09-03 12:13:12 -07:00
management_helpers fix: 1.99.0-rc2 UI bug batch (empty org on key create, session pagination, access group rename/delete) (#39436) 2026-09-03 08:58:48 -07:00
memory fix(memory): return 404 when the memory row vanishes before delete 2026-08-25 16:20:17 -07:00
middleware feat(proxy): add Amazon Comprehend Medical passthrough provider 2026-08-17 15:44:06 -07:00
ocr_endpoints fix(ocr): reject invalid req_format values as 400 on the SDK path 2026-08-17 15:49:18 -07:00
openai_evals_endpoints feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
openai_files_endpoints fix: keep litellm importable on Python 3.10 and guard 3.11-only typing imports in CI (#39448) 2026-09-02 18:27:19 -07:00
pass_through_endpoints Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_techdebt_20260901 2026-09-02 07:44:53 +00:00
policy_engine fix(policy_engine): restore request guardrails list after pipeline allow 2026-08-31 16:38:44 -07:00
prompts merge(litellm_internal_staging): resolve typing sweep overlap, keep best-of-both types 2026-08-29 06:48:36 -07:00
public_endpoints feat(ui): add 1M context auto-router preset (#39490) 2026-09-02 22:33:14 -07:00
rag_endpoints Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_vector_store_request_embedding_resolution 2026-09-02 15:24:21 -07:00
realtime_endpoints chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
rerank_endpoints fix(rerank): emit latency and cost headers on /rerank (#35419) 2026-08-25 15:54:25 -07:00
response_api_endpoints refactor(types): replace Any with precise types across 73 modules 2026-09-01 11:05:02 +00:00
response_polling Merge branch 'litellm_internal_staging' of https://github.com/BerriAI/litellm into litellm_decrease_anys_opus5_r2 2026-08-31 16:12:29 -07:00
search_endpoints Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_decrease_anys_opus5 2026-08-29 06:03:33 -07:00
shutdown feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
spend_tracking feat(ui): keyset-paginate request logs by session trace (#38794) 2026-09-03 17:27:05 +00:00
swagger
test_prompts
types_utils chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
ui_crud_endpoints feat(mcp): semantic tool search for the native MCP Gateway (#39404) 2026-09-02 15:09:44 -07:00
vector_store_endpoints Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_vector_store_request_embedding_resolution 2026-09-02 15:24:21 -07:00
vector_store_files_endpoints feat(proxy): enforce vector-store upload security controls on /v1/rag/ingest 2026-08-24 12:41:15 -07:00
vertex_ai_endpoints chore(lint): strip inert type: ignore comments and zero LIT009, LIT010, LIT011 headroom 2026-08-05 02:37:24 -07:00
video_endpoints refactor(types): replace Any with precise types across 73 modules 2026-09-01 11:05:02 +00:00
workflows
.gitignore
__init__.py
_lazy_features.py feat(mcp_gateway): add RFC 7662 introspection for gateway session tokens (#38726) 2026-08-29 12:56:04 -07:00
_lazy_openapi_snapshot.json feat(scim): add placeholder listing and merge so a shadowed account can be healed (#39231) 2026-09-02 01:04:53 +00:00
_lazy_openapi_snapshot.py chore(techdebt): type new signatures and drop slop comments from the last 24h 2026-08-28 07:59:32 +00:00
_logging.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
_new_new_secret_config.yaml
_new_secret_config.yaml
_super_secret_config.yaml
_types.py Merge pull request #39571 from BerriAI/codex/team-id-empty-field 2026-09-03 10:35:01 -07:00
cached_logo.jpg
caching_routes.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
common_request_processing.py fix(proxy): stop leaking internal exception details to clients (#39380) 2026-09-02 17:32:00 -07:00
compliance_checks.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
custom_auth_auto.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
custom_prompt_management.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
custom_sso.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
custom_validate.py
dd_span_tagger.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
dev_config.yaml Revert "chore(ci): sync litellm_internal_staging into daily OSS branch (#33337)" (#33339) 2026-07-14 19:32:25 -07:00
enterprise
health_check.py feat(health): opt-in model-group allowlist for background health checks and health-check routing (#38539) 2026-08-27 12:25:56 -07:00
lambda.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
litellm_pre_call_utils.py fix(proxy): keep SpendLogs and callback session ids in sync when the request has none (#39450) 2026-09-02 18:28:06 -07:00
llamaguard_prompt.txt
logo.jpg
logo_dark.png feat(ui): serve a dark-mode variant of the LiteLLM logo (#37656) 2026-08-20 11:26:10 -07:00
mcp_registry.json fix(mcp): use official Google Drive streamable HTTP MCP server (#34322) 2026-07-22 23:41:51 +00:00
mcp_tools.py refactor(lint): apply every safe ruff autofix and zero 28 strict-rule budgets 2026-08-01 15:43:29 -07:00
model_config.yaml
openapi.json
openapi_registry.json fix(mcp): add Google Sheets, Drive, Calendar, and Docs to the OpenAPI registry 2026-07-20 19:02:00 -07:00
plugin_routes.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
post_call_rules.py
prisma_migration.py fix(proxy): keep a failed prisma generate from failing the migration entrypoint (#37947) 2026-08-22 11:45:19 -07:00
prometheus_cleanup.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
proxy_cli.py fix(proxy/db): translate libpq sslrootcert and verify-* into Prisma's strict TLS params (#39563) 2026-09-03 10:27:46 -07:00
proxy_config.yaml
proxy_server.py fix(proxy): mark session/SSO/SAML cookies Secure behind a TLS-terminating reverse proxy (#39391) 2026-09-02 16:42:29 -07:00
read_model_list.py fix(proxy): initialize the secret manager before resolving os.environ config references (#37544) 2026-08-19 17:00:26 -07:00
README.md
route_llm_request.py refactor(types): replace Any with precise types across 73 modules 2026-09-01 11:05:02 +00:00
schema.prisma feat(shadow_eval): compare several auto-routers on one job's sampled traffic (#39028) 2026-08-31 21:31:08 -07:00
start.sh
utils.py fix(spend): keep every-deployment scope on gateway cache-injection marks 2026-09-01 17:44:29 -07: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