litellm/litellm/proxy
2025-10-08 19:57:33 -07:00
..
_experimental UI new build 2025-10-08 19:57:33 -07:00
analytics_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
anthropic_endpoints fix: remove router inefficiencies (from O(M*N) to O(1)) - 62.5% faster P99 latency (#15046) 2025-09-29 15:49:46 -07:00
auth [Fix] Proxy Auth - Ensure LLM_API_KEYs can access pass through routes (#15115) 2025-10-01 14:09:01 -07:00
batches_endpoints fix lint error 2025-09-28 18:21:18 +09:00
client [Feat] Proxy CLI - dont store existing key in the URL, store it in the state param (#15290) 2025-10-07 12:36:17 -07:00
common_utils Merge pull request #15154 from BerriAI/litellm_dev_10_02_2025_p2 2025-10-04 15:23:11 -07:00
config_management_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
credential_endpoints added support to credential delete to support slashes in the curl (#10987) 2025-05-20 19:08:48 -07:00
custom_hooks [Feat] SSO - Allow users to run a custom sso login handler (#12465) 2025-07-09 16:36:30 -07:00
db fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
discovery_endpoints fix code qa check 2025-07-11 22:35:27 -07:00
example_config_yaml fix: azure passthrough test 2025-10-04 11:06:36 -07:00
fine_tuning_endpoints Litellm managed file updates combined (#11040) 2025-05-22 17:20:41 -07:00
google_endpoints fix gemini cli by actually streaming the response (#15264) 2025-10-07 11:26:39 -07:00
guardrails test bedrock guardrails 2025-10-04 09:18:26 -07:00
health_endpoints fix(_health_endpoints.py): protect /health/test_connection - only allow users who are allowed to create models, to call this endpoint 2025-09-17 18:00:59 -07:00
hooks fix: fix linting errors 2025-10-04 14:47:13 -07:00
image_endpoints Feat: add add azure endpoint for image endpoints (#11482) 2025-06-06 10:38:37 -07:00
management_endpoints feat(ui_sso.py): support mapping app roles from azure entra id to litellm user roles 2025-10-08 18:45:13 -07:00
management_helpers [MCP Gateway] Litellm mcp fixes team control (#15304) 2025-10-07 16:48:00 -07:00
middleware PrometheusAuthMiddleware 2025-04-04 20:37:53 -07:00
openai_files_endpoints fix(files): use extra_query for GET/DELETE in Files endpoints 2025-09-29 14:07:18 +02:00
pass_through_endpoints feat(llm_passthrough_endpoints.py): working streaming on azure passthrough via router 2025-10-06 13:56:30 -07:00
prompts Gitlab based Prompt manager (#14988) 2025-10-01 18:13:11 -07:00
public_endpoints build(ui/): UI - Public Model Hub v2 (#12532) 2025-07-11 22:24:31 -07:00
rerank_endpoints use correct get custom headers 2025-03-12 17:16:51 -07:00
response_api_endpoints [Feat]Add cancel endpoint support for openai and azure (#14561) 2025-09-15 07:08:56 -07:00
spend_tracking fix: fix linting errors 2025-09-27 14:02:27 -07:00
swagger Swagger - bump DOMPurify version + add back Support local swagger bundle (good for airgapped environments) + support local swagger on custom root paths (#12911) 2025-07-23 11:22:56 -07:00
test_prompts Prompt Management (2/2) - New /prompt/list endpoint + key-based access to prompt templates (#13218) 2025-08-02 10:36:38 -07:00
types_utils [Feat] Allow reading custom logger python scripts from s3 (#12623) 2025-07-16 15:07:01 -07:00
ui_crud_endpoints fix: make /get/ui_theme_settings public for all users to access custom branding 2025-09-30 09:23:23 -05:00
vector_store_endpoints [Feat] LLM API Endpoint - Expose OpenAI Compatible /vector_stores/{vector_store_id}/search endpoint (#12749) 2025-07-18 18:18:53 -07:00
vertex_ai_endpoints build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
.gitignore fix(gitmodules): remapping to new proxy 2023-10-12 21:23:53 -07:00
__init__.py refactor: add black formatting 2023-12-25 14:11:20 +05:30
_logging.py fix(_logging.py): fix timestamp format for json logs 2024-06-20 15:20:21 -07:00
_new_new_secret_config.yaml Ollama ssl verify = False + Spend Logs reliability fixes (#7931) 2025-01-23 23:05:41 -08:00
_new_secret_config.yaml docs(mcp.md): document new allow/disallow tool parameters functionality 2025-10-08 17:39:42 -07:00
_super_secret_config.yaml docs(enterprise.md): cleanup docs 2024-07-15 14:52:08 -07:00
_types.py [MCP Gateway] Fine-grained Database Object Storage Control (#15255) 2025-10-06 19:31:44 -07:00
cached_logo.jpg Litellm dev 01 23 2025 p2 (#7962) 2025-01-23 21:02:15 -08:00
caching_routes.py fix install on python 2025-06-14 15:42:06 -07:00
common_request_processing.py fix ServerToolUse mypy lint error 2025-10-04 08:59:15 -07:00
custom_auth_auto.py Custom Auth - bubble up custom exceptions (#13093) 2025-07-29 16:28:25 -07:00
custom_prompt_management.py Litellm dev 07 03 2025 p2 (#12301) 2025-07-03 22:40:21 -07:00
custom_sso.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
custom_validate.py build: merge commit 1b15568af7 2025-02-17 21:56:00 -08:00
enterprise feat(llama_guard.py): add llama guard support for content moderation + new async_moderation_hook endpoint 2024-02-17 19:13:04 -08:00
health_check.py feat: add a health_check_voice param 2025-05-19 13:02:06 +02:00
lambda.py Add mangum. 2023-11-23 00:04:47 -05:00
litellm_pre_call_utils.py fix(litellm_pre_call_utils.py): fix return statement 2025-10-04 15:43:56 -07:00
llamaguard_prompt.txt feat(llama_guard.py): allow user to define custom unsafe content categories 2024-02-17 17:42:47 -08:00
logo.jpg (feat) admin ui custom branding 2024-02-21 17:34:42 -08:00
mcp_tools.py example mcp tools 2025-03-20 17:53:20 -07:00
model_config.yaml Revert "Revert "(feat) Allow using include to include external YAML files in a config.yaml (#6922)"" 2024-11-27 16:08:59 -08:00
openapi.json (feat) add swagger.json for litellm proxy 2023-10-13 20:41:04 -07:00
post_call_rules.py (docs) add example post call rules to proxy 2024-01-15 20:58:50 -08:00
prisma_migration.py LiteLLM SDK <-> Proxy: support user param + Prisma - remove use_prisma_migrate flag - redundant as this is now default (#13555) 2025-08-12 22:03:39 -07:00
proxy_cli.py feature/add max requests env var 2025-09-28 19:18:56 +01:00
proxy_config.yaml doc fix 2025-10-07 18:51:27 -07:00
proxy_server.py feat(mcp/): initial commit raising correct oauth error 2025-10-08 17:33:11 -07:00
README.md [Feat-Proxy] Allow using custom sso handler (#5809) 2024-09-20 19:14:33 -07:00
route_llm_request.py fix: remove router inefficiencies (from O(M*N) to O(1)) - 62.5% faster P99 latency (#15046) 2025-09-29 15:49:46 -07:00
schema.prisma [MCP Gateway] Backend - Allow storing allowed tools by team/key (#15243) 2025-10-06 18:49:32 -07:00
start.sh fix(factory.py): fixing llama-2 non-chat models prompt templating 2023-11-07 21:33:54 -08:00
utils.py feat(llm_passthrough_endpoints.py): add router model support on azure passthrough 2025-10-06 12:51:41 -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