litellm/litellm/proxy
2026-03-09 20:40:38 -07:00
..
_experimental CircleCI test stability (#23055) 2026-03-07 15:19:39 -08:00
agent_endpoints fix: missing closing paren in agent_endpoints get_agents Query() 2026-03-07 23:13:42 -08:00
analytics_endpoints fix(sql): Optimize SpendLogs queries to use timestamp filtering for index usage (#17504) 2025-12-04 21:52:57 -08:00
anthropic_endpoints fix(count_tokens): include system and tools in token counting API requests 2026-02-27 15:39:35 -03:00
auth feat: allow JWT and OAuth2 auth to coexist on the same instance (#23153) 2026-03-09 08:41:27 -07:00
batches_endpoints Merge pull request #23194 from BerriAI/litellm_/recursing-blackburn 2026-03-09 15:28:59 -07:00
client fix: prompt registry 2026-02-18 00:34:54 +05:30
common_utils Merge pull request #20688 from BerriAI/litellm_budget_tier_enforcement_for_keys 2026-03-06 20:44:58 -08:00
config_management_endpoints
container_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
credential_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
custom_hooks perf: use cached _safe_get_request_headers instead of dict(request.headers) 2026-02-17 16:11:50 -08:00
db Revert "feat(proxy): add Prisma DB pool and engine health metrics to Promethe…" 2026-03-09 14:55:11 -07:00
discovery_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
example_config_yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
fine_tuning_endpoints
google_endpoints fix: Metadata / Trace ID Missing in S3 Streaming Callbacks 2026-02-25 14:16:21 +05:30
guardrails Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849) 2026-03-07 19:12:42 -08:00
health_check_utils feat(proxy): limit concurrent health checks with health_check_concurrency (#20584) 2026-02-24 08:16:59 -08:00
health_endpoints Prisma DB Failure Detection and Self-Healing (#21059) 2026-03-05 13:44:49 -08:00
hooks Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849) 2026-03-07 19:12:42 -08:00
image_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
management_endpoints merge: sync with main, resolve model_prices_and_context_window_backup.json conflict 2026-03-09 20:40:38 -07:00
management_helpers
middleware Fix inflight mypy 2026-03-02 19:41:32 +05:30
ocr_endpoints Enable local file support for OCR (#22133) 2026-02-27 10:50:02 -08:00
openai_evals_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
openai_files_endpoints Merge pull request #22728 from BerriAI/litellm_batch_expiry_validation_followup 2026-03-04 10:16:02 -08:00
pass_through_endpoints fix(pass_through): inject cost into Anthropic streaming chunks + fix SSE parsing in tests (#23078) 2026-03-07 17:27:51 -08:00
policy_engine Guardrail Policy Versioning (#21862) 2026-02-21 20:14:31 -08:00
prompts fix: prompt registry 2026-02-18 00:34:54 +05:30
public_endpoints Development environment setup (#22432) 2026-02-28 14:50:06 -08:00
rag_endpoints tests and route permissions (#21508) 2026-02-18 16:58:38 -08:00
rerank_endpoints
response_api_endpoints feat(proxy): add WebSocket endpoint for responses API and route_llm_request support 2026-03-02 17:22:44 +05:30
response_polling fix: prompt registry 2026-02-18 00:34:54 +05:30
search_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
spend_tracking feat(spend-logs): add truncation note when error logs are truncated for DB storage (#22936) 2026-03-05 16:58:46 -08:00
swagger
test_prompts
types_utils
ui_crud_endpoints fix: add 10-minute TTL to UI settings cache and refresh on GET 2026-03-07 16:25:52 -08:00
vector_store_endpoints [Feature] RBAC for Vector Stores and Agents 2026-03-04 20:13:14 -08:00
vector_store_files_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
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 Revert "Litellm staging 01 15 2026" 2026-01-17 06:31:34 +09:00
.gitignore
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -08:00
_super_secret_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
_types.py Merge remote-tracking branch 'origin' into litellm_org_admin_add_user_e2e 2026-03-07 22:58:57 -08:00
cached_logo.jpg fix: prompt registry 2026-02-18 00:34:54 +05:30
caching_routes.py
common_request_processing.py Merge pull request #22559 from BerriAI/litellm_responses_websocket 2026-03-04 17:57:34 +05:30
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 chore: remove debug print statements from custom_sso.py 2026-03-07 12:27:16 +02:00
custom_validate.py
dd_span_tagger.py feat(proxy): add key_alias, key_hash, requested_model DD APM span tags (#22710) 2026-03-03 20:22:59 -08:00
enterprise
health_check.py add docs and formatting 2026-02-28 14:08:09 +05:30
lambda.py
litellm_pre_call_utils.py Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849) 2026-03-07 19:12:42 -08:00
llamaguard_prompt.txt
logo.jpg
mcp_registry.json fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_tools.py
model_config.yaml
openapi.json
openapi_registry.json fix: address greptile review - fix registry spec URLs, remove redundant dep, add error handling 2026-03-09 20:06:22 -07:00
post_call_rules.py
prisma_migration.py Revert "Fix/prisma schema permission (#19391)" 2026-01-21 17:19:32 +05:30
prometheus_cleanup.py Add Prometheus child_exit cleanup for gunicorn workers 2026-02-27 16:11:15 -08:00
proxy_cli.py Add Prometheus child_exit cleanup for gunicorn workers 2026-02-27 16:11:15 -08:00
proxy_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
proxy_server.py Remove duplicate jwt_key_mapping_router import 2026-03-09 13:58:04 -07:00
README.md
route_llm_request.py feat(proxy): add WebSocket endpoint for responses API and route_llm_request support 2026-03-02 17:22:44 +05:30
schema.prisma Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849) 2026-03-07 19:12:42 -08:00
start.sh
utils.py Revert "feat(proxy): add Prisma DB pool and engine health metrics to Promethe…" 2026-03-09 14:55:11 -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