litellm/litellm/proxy
2025-10-04 12:48:07 -07:00
..
_experimental [Feat] MCP Gateway Fine-grained Tools Addition (#15153) 2025-10-03 10:16:29 -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 Revert "fix: model_group not always present in litellm_params, and metadata reference location (#15108)" 2025-10-04 12:48:07 -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 fix: azure passthrough test 2025-10-04 11:06:36 -07:00
fine_tuning_endpoints
google_endpoints fix mypy check issues 2025-09-30 10:37:21 +08:00
guardrails test bedrock guardrails 2025-10-04 09:18:26 -07:00
health_endpoints
hooks Revert "fix: model_group not always present in litellm_params, and metadata reference location (#15108)" 2025-10-04 12:48:07 -07:00
image_endpoints
management_endpoints [Feat] MCP Gateway Fine-grained Tools Addition (#15153) 2025-10-03 10:16:29 -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 Add streamGenerateContent cost tracking in passthrough (#15199) 2025-10-04 12:31:25 -07:00
prompts Gitlab based Prompt manager (#14988) 2025-10-01 18:13:11 -07:00
public_endpoints
rerank_endpoints
response_api_endpoints
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 [Feat] MCP Gateway Fine-grained Tools Addition (#15153) 2025-10-03 10:16:29 -07:00
.gitignore
cached_logo.jpg
caching_routes.py
common_request_processing.py fix ServerToolUse mypy lint error 2025-10-04 08:59:15 -07: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
proxy_cli.py feature/add max requests env var 2025-09-28 19:18:56 +01: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] MCP Gateway Fine-grained Tools Addition (#15153) 2025-10-03 10:16:29 -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