litellm/litellm/proxy
2026-09-11 20:00:53 -07:00
..
_experimental fix(mcp): write failure spend log for guardrail-blocked /mcp-rest/tools/call (#40555) 2026-09-11 12:54:03 -07:00
a2a refactor(typing): replace Any with proven types in 65 backend files 2026-09-02 09:11:36 +00:00
agent_endpoints fix(a2a): forward caller identity headers on message/send and message/stream (#40305) 2026-09-08 15:56:52 -07:00
analytics_endpoints
anthropic_endpoints feat(proxy): granular key/team access control for Claude Code marketplace plugins (#40518) 2026-09-10 14:26:09 -07:00
auth Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_user_budget_webhook_alerts 2026-09-11 09:49:16 +08:00
batches_endpoints fix(batches): register ownership for every batch create path (#39810) 2026-09-04 23:59:51 -07:00
client feat(auto-router): show routed model and savings in Claude Code and Codex (#40330) 2026-09-11 12:52:42 -07:00
common_utils fix(proxy): give user-key objects their own in-memory cache partition (#40713) 2026-09-11 09:52:09 -07:00
config_management_endpoints
config_resolvers
container_endpoints chore: merge origin/litellm_internal_staging into litellm_decrease_anys_opus5_r4 2026-09-04 18:59:35 -07: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
db fix(db): carry DATABASE_SSLMODE/DATABASE_SSLROOTCERT into the assembled writer and reader URLs (#40815) 2026-09-12 02:14:39 +00:00
discovery_endpoints feat(auth): enforce configurable password policy and SSO-only login (#39381) 2026-09-02 14:28:13 -07:00
enterprise_billing
example_config_yaml
fine_tuning_endpoints
google_endpoints
guardrails feat(ocr): drive native calls through shared Rust lifecycle 2026-09-11 20:00:53 -07:00
health_check_utils refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
health_endpoints Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_health_check_db_storm 2026-09-10 18:14:25 +00:00
hooks fix(proxy): keep call_type and request start time on failed-request spend logs (#40558) 2026-09-11 12:22:18 -07:00
image_endpoints Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_openai_error_payload_non_llm_routes 2026-09-08 11:09:54 -07:00
list_api feat: page the public model hub table off /public/v1/model_hub, keeping every filter (#39691) 2026-09-03 22:36:16 -07:00
logging_endpoints fix(usage): recover aliases for v1.99 double-hashed spend keys 2026-09-03 14:21:25 +00:00
management_endpoints feat(auto-router): show routed model and savings in Claude Code and Codex (#40330) 2026-09-11 12:52:42 -07:00
management_helpers fix(proxy): reject ambiguous name or alias keys in mcp_tool_permissions on write (#39947) 2026-09-05 14:22:26 -07:00
memory feat(proxy): add a search param to key, memory, audit, and spend log listings 2026-09-03 15:20:13 -07:00
middleware feat(proxy): resolve root_path per request from a configured prefix list (SERVER_ROOT_PATHS) (#35935) 2026-09-07 11:54:59 -07:00
ocr_endpoints
openai_evals_endpoints refactor(typing): replace Any with proven types in 65 backend files 2026-09-02 09:11:36 +00:00
openai_files_endpoints Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_openai_error_payload_non_llm_routes 2026-09-08 11:09:54 -07:00
pass_through_endpoints perf(proxy): lazy-load provider passthrough routes (#40691) 2026-09-11 09:48:53 -07:00
policy_engine fix(policy_engine): run global policy pipelines before scoped ones (#39697) 2026-09-11 14:20:10 -07:00
prompts Merge pull request #38440 from BerriAI/litellm_prompt_registry_env 2026-09-03 14:09:26 -07:00
public_endpoints feat(auto-router): refresh family reasoning presets (#40341) 2026-09-08 18:28:46 -07:00
rag_endpoints fix(proxy): emit SSE keepalives on queue, rag, azure passthrough, usage chat and policy enrich streams (#39273) 2026-09-03 18:23:37 -07:00
realtime_endpoints Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_openai_error_payload_non_llm_routes 2026-09-08 11:09:54 -07:00
rerank_endpoints fix(proxy): stop shipping the literal string "None" as error type and param 2026-09-03 02:49:49 -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 fix(responses): keep background polling alive after the client disconnects 2026-09-07 11:51:35 +00: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
spend_tracking feat(rust): count tiktoken cl100k_base admission tokens in Rust (#40777) 2026-09-11 23:47:05 +00:00
swagger
test_prompts
types_utils
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 fix(proxy): let authorized internal users open vector store details (#40150) 2026-09-07 13:10:09 -07:00
vector_store_files_endpoints
vertex_ai_endpoints
video_endpoints refactor(types): replace Any with precise types across 73 modules 2026-09-01 11:05:02 +00:00
workflows
.gitignore
__init__.py Revert "perf: lazy-load SDK symbols so import litellm stays under 60 MB RSS (…" 2026-09-05 16:07:09 -07:00
_lazy_features.py perf(proxy): register liveness and core inference routes first (#40687) 2026-09-11 17:10:38 +00:00
_lazy_openapi_snapshot.json perf(proxy): lazy-load provider passthrough routes (#40691) 2026-09-11 09:48:53 -07:00
_lazy_openapi_snapshot.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml
_super_secret_config.yaml
_types.py feat(auto-router): show routed model and savings in Claude Code and Codex (#40330) 2026-09-11 12:52:42 -07:00
cached_logo.jpg
caching_routes.py refactor(typing): replace Any with proven types in 89 more backend files 2026-09-02 23:08:42 +00:00
collector.py feat(proxy): offload spend tracking to a pod-local collector sidecar (#40545) 2026-09-10 17:14:13 -07:00
common_request_processing.py feat(ocr): drive native calls through shared Rust lifecycle 2026-09-11 20:00:53 -07:00
compliance_checks.py
custom_auth_auto.py
custom_prompt_management.py
custom_sso.py
custom_validate.py
dd_span_tagger.py
dev_config.yaml
enterprise
health_check.py
lambda.py
litellm_pre_call_utils.py feat(ocr): add Azure Mistral adapter with native authentication (#40502) 2026-09-11 16:22:55 -07:00
llamaguard_prompt.txt
logo.jpg
logo_dark.png
mcp_registry.json
mcp_tools.py
model_config.yaml
openapi.json
openapi_registry.json
plugin_routes.py
post_call_rules.py
prisma_migration.py
prometheus_cleanup.py feat(deploy): metrics sidecar and separate metrics port in Helm and Terraform (#40163) 2026-09-08 13:31:07 -07:00
prometheus_metrics_server.py feat(deploy): metrics sidecar and separate metrics port in Helm and Terraform (#40163) 2026-09-08 13:31:07 -07:00
proxy_cli.py feat(proxy): let the in-container pgbouncer follow rotating RDS IAM and Azure Entra tokens (#40623) 2026-09-10 16:18:00 -07:00
proxy_config.yaml
proxy_server.py Merge pull request #40572 from dclarksymmetry/fix/spend-counter-reseed-double-count 2026-09-11 18:14:04 -07:00
read_model_list.py
README.md
route_llm_request.py refactor(types): replace Any with precise types across 73 modules 2026-09-01 11:05:02 +00:00
route_priority.py perf(proxy): register liveness and core inference routes first (#40687) 2026-09-11 17:10:38 +00:00
schema.prisma feat(auto-router): show routed model and savings in Claude Code and Codex (#40330) 2026-09-11 12:52:42 -07:00
start.sh
utils.py fix(db): carry DATABASE_SSLMODE/DATABASE_SSLROOTCERT into the assembled writer and reader URLs (#40815) 2026-09-12 02:14:39 +00: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