litellm-mirror/litellm/proxy
2025-04-23 07:32:46 -07:00
..
_experimental Add global filtering to Users tab (#10195) 2025-04-22 13:59:43 -07:00
analytics_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
anthropic_endpoints get_custom_headers 2025-03-12 18:57:41 -07:00
auth fix(common_daily_activity.py): support empty entity id field (#10175) 2025-04-19 22:20:28 -07:00
batches_endpoints use correct get custom headers 2025-03-12 17:16:51 -07:00
common_utils fix(internal_user_endpoints.py): increase default page size for /user/daily/activity 2025-04-09 17:50:13 -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 fix: fix linting error 2025-03-14 14:17:28 -07:00
db Add aggregate spend by tag (#10071) 2025-04-16 12:26:21 -07:00
example_config_yaml add spend tracking config.yaml 2025-03-31 19:42:00 -07:00
fine_tuning_endpoints use correct get custom headers 2025-03-12 17:16:51 -07:00
guardrails Add litellm call id passing to Aim guardrails on pre and post-hooks calls (#10021) 2025-04-16 07:41:28 -07:00
health_endpoints allow proxy to startup on DB unavailable 2025-03-26 19:50:57 -07:00
hooks fix(triton/completion/transformation.py): remove bad_words / stop wor… (#10163) 2025-04-19 11:23:37 -07:00
management_endpoints fix(internal_user_endpoints.py): add check on sortby value 2025-04-22 21:41:13 -07:00
management_helpers [Team Member permissions] - Fixes (#9945) 2025-04-12 11:17:51 -07:00
middleware PrometheusAuthMiddleware 2025-04-04 20:37:53 -07:00
openai_files_endpoints Litellm add managed files db (#9930) 2025-04-12 08:24:46 -07:00
pass_through_endpoints [Feat] Pass through endpoints - ensure PassthroughStandardLoggingPayload is logged and contains method, url, request/response body (#10194) 2025-04-21 19:46:22 -07:00
rerank_endpoints use correct get custom headers 2025-03-12 17:16:51 -07:00
response_api_endpoints add GET, DELETE responses API endpoints 2025-04-23 07:32:46 -07:00
spend_tracking Fix: Potential SQLi in spend_management_endpoints.py (#9878) 2025-04-21 14:29:38 -07:00
swagger feat: add offline swagger docs (#7653) 2025-04-06 13:55:06 -07:00
types_utils test fix post call rules (#9826) 2025-04-08 13:55:37 -07:00
ui_crud_endpoints [Feat - UI] - Allow setting Default Team setting when LiteLLM SSO auto creates teams (#9918) 2025-04-11 14:07:10 -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
__init__.py
_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 Litellm dev 04 22 2025 p1 (#10206) 2025-04-22 23:58:43 -07:00
_super_secret_config.yaml docs(enterprise.md): cleanup docs 2024-07-15 14:52:08 -07:00
_types.py Add global filtering to Users tab (#10195) 2025-04-22 13:59:43 -07:00
cached_logo.jpg Litellm dev 01 23 2025 p2 (#7962) 2025-01-23 21:02:15 -08:00
caching_routes.py fix(cost_calculator.py): handle custom pricing at deployment level fo… (#9855) 2025-04-09 22:13:10 -07:00
common_request_processing.py add GET, DELETE responses API endpoints 2025-04-23 07:32:46 -07:00
custom_prompt_management.py [UI] Allow setting prompt cache_control_injection_points (#10000) 2025-04-14 21:17:42 -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
health_check.py fix endpoint_data 2025-03-14 17:21:01 -07:00
lambda.py
litellm_pre_call_utils.py Litellm dev 04 18 2025 p2 (#10157) 2025-04-19 07:32:23 -07:00
llamaguard_prompt.txt
logo.jpg
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
post_call_rules.py
prisma_migration.py build(pyproject.toml): add new dev dependencies - for type checking (#9631) 2025-03-29 11:02:13 -07:00
proxy_cli.py install prisma migration files - connects litellm proxy to litellm's prisma migration files (#9637) 2025-03-29 15:27:09 -07:00
proxy_config.yaml [Feat] Add Responses API - Routing Affinity logic for sessions (#10193) 2025-04-21 20:00:27 -07:00
proxy_server.py Litellm dev 04 22 2025 p1 (#10206) 2025-04-22 23:58:43 -07:00
README.md [Feat-Proxy] Allow using custom sso handler (#5809) 2024-09-20 19:14:33 -07:00
route_llm_request.py add GET, DELETE responses API endpoints 2025-04-23 07:32:46 -07:00
schema.prisma [Feat SSO] Add LiteLLM SCIM Integration for Team and User management (#10072) 2025-04-16 19:21:47 -07:00
start.sh
utils.py Add aggregate spend by tag (#10071) 2025-04-16 12:26:21 -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