litellm/litellm/proxy
2025-10-09 16:36:39 -07:00
..
_experimental test(test_mcp_server_manager.py): add unit testing 2025-10-09 14:52:46 -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 refactor: reduce function size below 50 LOC 2025-10-09 15:48:10 -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
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 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
hooks fix: fix linting errors 2025-10-04 14:47:13 -07:00
image_endpoints
management_endpoints feat(_types.py): support setting allowed passthrough routes on keys + teams 2025-10-09 16:14:59 -07:00
management_helpers [MCP Gateway] Litellm mcp fixes team control (#15304) 2025-10-07 16:48:00 -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 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
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 fix(route_checks.py): handle route prefixes 2025-10-09 15:16:10 -07:00
_super_secret_config.yaml
_types.py feat(proxy/_types.py): make setting allowed passthrough routes a premium field on key/team 2025-10-09 16:36:39 -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 fix(litellm_pre_call_utils.py): fix return statement 2025-10-04 15:43:56 -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 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
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
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