litellm/litellm/proxy
Krish Dholakia 93e347b3d8
Merge pull request #15106 from plafleur/ISSUE-15105
Guardrails - Don't run post_call guardrail if no text returned from Bedrock
2025-10-01 21:29:14 -07:00
..
_experimental feat(user_api_key_auth_mcp.py): correctly dereference mcp server name from ids 2025-09-29 13:30:37 -07:00
analytics_endpoints
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 fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
common_utils fix: model_group not always present in litellm_params, and metadata reference location (#15108) 2025-10-01 11:39:49 -07:00
config_management_endpoints
credential_endpoints
custom_hooks
db fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
discovery_endpoints
example_config_yaml [Bug Fix] Passthrough API Endpoints - Ensure query params are forwarded from origin url to downstream request (#15087) 2025-09-30 15:01:38 -07:00
fine_tuning_endpoints
google_endpoints fix mypy check issues 2025-09-30 10:37:21 +08:00
guardrails Don't run post_call guardrail if no text returned from bedrock 2025-10-01 11:56:50 -04: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 [Feat] Fixes to dynamic rate limiter v3 - add saturatation detection (#15119) 2025-10-01 18:35:34 -07:00
image_endpoints
management_endpoints fix: fix runtime openid check 2025-09-27 16:48:51 -07:00
management_helpers fix: fix general linting errors 2025-09-27 13:10:48 -07:00
middleware
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 [Fix] Proxy Auth - Ensure LLM_API_KEYs can access pass through routes (#15115) 2025-10-01 14:09:01 -07:00
prompts Gitlab based Prompt manager (#14988) 2025-10-01 18:13:11 -07:00
public_endpoints
rerank_endpoints
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
test_prompts
types_utils
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
vertex_ai_endpoints
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml feat(mcp/): allows admin to prevent llm's from accidentally deleting github repo's even if user is allowed to do this 2025-09-27 19:36:11 -07:00
_super_secret_config.yaml
_types.py Fix: Add /v1/messages/count_tokens to Anthropic routes for non-admin user access (#15034) 2025-09-29 18:16:52 -07:00
.gitignore
cached_logo.jpg
caching_routes.py
common_request_processing.py feat(gemini): Add full support for native Gemini API translation 2025-09-28 21:01:31 +08:00
custom_auth_auto.py
custom_prompt_management.py
custom_sso.py
custom_validate.py
enterprise
health_check.py
lambda.py
litellm_pre_call_utils.py Revert "fix: remove blocking create_task (#14980)" (#14984) 2025-09-27 15:38:06 -07:00
llamaguard_prompt.txt
logo.jpg
mcp_tools.py
model_config.yaml
openapi.json
post_call_rules.py
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 test fix 2025-09-20 16:55:23 -07:00
proxy_config.yaml [Feat] Guardrails - add logging for important status fields (#15090) 2025-09-30 18:38:07 -07:00
proxy_server.py Gitlab based Prompt manager (#14988) 2025-10-01 18:13:11 -07:00
README.md
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 [Feat] UI - Allow scheduling key rotations when creating virtual keys (#14960) 2025-09-26 16:24:40 -07:00
start.sh
utils.py fix: prisma client state retries (#14925) 2025-09-25 21:54:00 -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