litellm/litellm/proxy
Harshit28j 7a52ae5624 fix(ci): doc quality, security CVE, health check test, env key doc
- Add docs for enforced_batch_output_expires_after and
  enforced_file_expires_after params in new_team/update_team endpoints
- Add GHSA-qffp-2rhf-9h96 (tar hardlink traversal) to security allowlist
- Accept both 'connected' and 'healthy' in proxy health check test
- Add PRISMA_RECONNECT_ESCALATION_THRESHOLD to env settings docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 02:46:32 +05:30
..
_experimental fix(ci): comprehensive CI fixes for release 2026-03-07 01:08:25 +05:30
agent_endpoints fix(ci): comprehensive CI fixes for release 2026-03-07 01:08:25 +05:30
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 fix(ci): comprehensive CI fixes for release 2026-03-07 01:08:25 +05:30
batches_endpoints Merge pull request #22728 from BerriAI/litellm_batch_expiry_validation_followup 2026-03-04 10:16:02 -08:00
client fix: prompt registry 2026-02-18 00:34:54 +05:30
common_utils Merge pull request #22858 from BerriAI/litellm_rbac_vector_agents 2026-03-05 16:40:38 -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 fix(mypy): resolve type errors across 9 files 2026-03-05 06:58:20 -03: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 fix(ci): guardrail decorator, security CVEs, UI tests, proxy test 2026-03-07 01:21:52 +05:30
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 Fix: Removed the process-level _encrypted_response_id_cache from __init__ 2026-03-04 12:30:49 +05:30
image_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
management_endpoints fix(ci): doc quality, security CVE, health check test, env key doc 2026-03-07 02:46:32 +05:30
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: catch exceptions in pass-through streaming logging handler (#21636) 2026-03-02 19:21:10 +05:30
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] PATCH /update/ui_settings now merges with existing record instead of overwriting 2026-03-05 15:49:40 -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 feat(mcp): BYOK MCP servers with OAuth 2.1 PKCE authorization flow (#22850) 2026-03-04 21:19:25 -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 fix: prompt registry 2026-02-18 00:34:54 +05:30
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 fix(proxy): do not forward Authorization header to LLM provider when used for LiteLLM proxy auth 2026-03-06 18:20:48 +05:30
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
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 feat(ui): add Chat UI — ChatGPT-like interface with MCP tools and streaming (#22937) 2026-03-05 18:13:04 -08: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 fix(schema): remove duplicate spec_path field in LiteLLM_MCPServerTable 2026-03-05 07:00:11 -03:00
start.sh
utils.py [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -08: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