litellm/litellm/proxy
2026-03-13 05:01:50 +01:00
..
_experimental Merge pull request #23482 from BerriAI/litellm_fix_ruff_mcp_rest_endpoints 2026-03-12 14:16:33 -07:00
agent_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03: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 style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
auth Merge branch 'main' into litellm_oss_staging_03_11_2026 2026-03-12 16:21:28 -03:00
batches_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
client style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
common_utils style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
config_management_endpoints
container_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
credential_endpoints style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03:00
custom_hooks style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
db style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
discovery_endpoints Support auto_redirect_ui_login_to_sso in config.yaml general_settings 2026-03-11 11:34:17 -07:00
example_config_yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
fine_tuning_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
google_endpoints fix: Metadata / Trace ID Missing in S3 Streaming Callbacks 2026-02-25 14:16:21 +05:30
guardrails style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03: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 style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
hooks style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
image_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
management_endpoints [Fix] Ruff PLR0915 too-many-statements in ui_sso.py 2026-03-12 15:08:40 -07:00
management_helpers style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03:00
middleware Fix inflight mypy 2026-03-02 19:41:32 +05:30
ocr_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
openai_evals_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
openai_files_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
pass_through_endpoints address greptile review: move early return before pre_call, trim comments 2026-03-13 04:53:50 +01:00
policy_engine style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
prompts fix: prompt registry 2026-02-18 00:34:54 +05:30
public_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
rag_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
realtime_endpoints fix(ci): fix ruff lint errors and 9 failing unit tests on main 2026-03-12 19:58:43 +00:00
rerank_endpoints
response_api_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
response_polling style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
search_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
spend_tracking merge: resolve conflicts with upstream staging (bedrock + mcp tests) 2026-03-12 13:40:16 -03:00
swagger Change favicon (#16837) 2025-11-19 20:38:22 -08:00
test_prompts
types_utils style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
ui_crud_endpoints Merge branch 'main' into litellm_oss_staging_03_11_2026 2026-03-12 10:43:08 -03:00
vector_store_endpoints style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03:00
vector_store_files_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
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 style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
.gitignore
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml Bug Fix: auto-inject prompt caching support for Gemini models (#21881) 2026-03-03 20:25:35 -08:00
_super_secret_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
_types.py style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03:00
cached_logo.jpg fix: prompt registry 2026-02-18 00:34:54 +05:30
caching_routes.py
common_request_processing.py style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03: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 add docs and formatting 2026-02-28 14:08:09 +05:30
lambda.py
litellm_pre_call_utils.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03: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 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 style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03:00
proxy_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
proxy_server.py fix(sso): direct PKCE token exchange + Redis wiring for multi-instance SSO (#22923) 2026-03-12 12:41:39 -07:00
README.md
route_llm_request.py Merge branch 'main' into litellm_oss_staging_03_11_2026 2026-03-12 13:53:14 -03:00
schema.prisma merge: resolve conflicts between main and litellm_oss_staging_03_11_2026 2026-03-12 09:38:31 -03:00
start.sh
utils.py pop litellm_logging_obj from request_data before callback loop 2026-03-13 05:01:50 +01: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