litellm/litellm/proxy
Yuneng Jiang f08d281641
[Fix] Resolve mypy type errors across 3 files
Add missing `user_api_key_project_alias` key to SpendLogsMetadata and
PagerDutyInternalEvent constructors, and cast `reasoning_items` to list
for safe iteration in responses transformation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:56:54 -07:00
..
_experimental Saving uncommitted changes before archiving 2026-03-27 20:38:37 +05:30
agent_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
analytics_endpoints
anthropic_endpoints Litellm ishaan march 20 (#24303) 2026-03-21 12:40:11 -07:00
auth Merge pull request #24718 from BerriAI/litellm_ryan-march-26 2026-03-28 09:01:11 -07:00
batches_endpoints Merge pull request #23957 from Sameerlite/litellm_vertex-cancel-batch 2026-03-20 23:32:50 +05:30
client Merge remote-tracking branch 'origin' into litellm_internal_dev_03_12_2026 2026-03-13 15:11:49 -07:00
common_utils fix(proxy): enforce budget limits across multi-pod deployments via Redis-backed spend counters 2026-03-27 20:39:52 +01:00
config_management_endpoints
container_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
credential_endpoints style: run black formatter on 52 non-enterprise files 2026-03-12 14:23:50 -03:00
custom_hooks style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
db feat(proxy): add project_alias tracking through callback metadata pipeline 2026-03-23 10:44:17 -07:00
discovery_endpoints feat: add control plane for multi-proxy worker management 2026-03-19 22:50:19 -07:00
example_config_yaml [Infra] Merging RC Branch with Main (#23786) 2026-03-16 15:32:20 -07:00
fine_tuning_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
google_endpoints
guardrails fix(proxy): anchor metadata dict in _process_response/_process_error so pop() mutates the real dict 2026-03-23 15:39:23 +01:00
health_check_utils
health_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
hooks fix(proxy): enforce budget limits across multi-pod deployments via Redis-backed spend counters 2026-03-27 20:39:52 +01:00
image_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
management_endpoints Merge pull request #24718 from BerriAI/litellm_ryan-march-26 2026-03-28 09:01:11 -07:00
management_helpers fix: resolve mypy type errors in audit_logs.py 2026-03-21 15:42:01 -07:00
middleware Fix inflight mypy 2026-03-02 19:41:32 +05:30
ocr_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
openai_evals_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
openai_files_endpoints [Staging] - Ishaan March 17th (#23903) 2026-03-18 15:09:01 -07:00
pass_through_endpoints feat(proxy): add project_alias tracking through callback metadata pipeline 2026-03-23 10:44:17 -07:00
policy_engine style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
prompts
public_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
rag_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
realtime_endpoints [Fix] Use type:ignore instead of Union return type for realtime endpoint 2026-03-13 11:42:26 -07:00
rerank_endpoints
response_api_endpoints fix: address Greptile review comments 2026-03-19 14:10:58 +05:30
response_polling feat(polling): check rate limits before creating polling ID 2026-03-19 13:59:59 +05:30
search_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
spend_tracking [Fix] Resolve mypy type errors across 3 files 2026-03-30 10:56:54 -07:00
swagger
test_prompts
types_utils style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
ui_crud_endpoints [Fix] Remove "API" from custom key description text 2026-03-16 22:35:44 -07:00
vector_store_endpoints fix(mypy): sync route_type Literals, fix BFL params and signatures 2026-03-12 23:51:35 +00:00
vector_store_files_endpoints style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
vertex_ai_endpoints
video_endpoints [Staging] - Ishaan March 17th (#23903) 2026-03-18 15:09:01 -07:00
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml fix: fix responses cost calc 2026-03-18 19:52:59 -07:00
_super_secret_config.yaml
_types.py fix: add /user/bulk_update to management_routes so proxy admins can access it 2026-03-27 17:50:42 -07:00
.gitignore
cached_logo.jpg
caching_routes.py
common_request_processing.py fix: apply Black formatting to 7 files 2026-03-21 14:51:15 -07:00
compliance_checks.py
custom_auth_auto.py
custom_prompt_management.py
custom_sso.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
custom_validate.py
dd_span_tagger.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
enterprise
health_check.py fix: re-attach model_id after endpoint cleaning, bump log level 2026-03-27 20:57:08 +05:30
lambda.py
litellm_pre_call_utils.py Fix codeql 2026-03-28 00:01:33 +05:30
llamaguard_prompt.txt
logo.jpg
mcp_registry.json feat(ui): group MCP tools by CRUD risk category in allowlist panels (#23403) 2026-03-11 21:15:25 -07:00
mcp_tools.py
model_config.yaml
openapi_registry.json feat(ui): OpenAPI MCP server support with popular API quick-picker (#23200) 2026-03-10 13:59:52 -07:00
openapi.json
post_call_rules.py
prisma_migration.py
prometheus_cleanup.py
proxy_cli.py feat(proxy): use AZURE_DEFAULT_API_VERSION for proxy --api_version default 2026-03-19 15:57:03 +05:30
proxy_config.yaml
proxy_server.py Merge pull request #24682 from michelligabriele/fix/budget-spend-counters 2026-03-27 16:59:23 -07:00
README.md
route_llm_request.py style: apply black formatting to fix CI lint check 2026-03-17 18:52:57 +00:00
schema.prisma [Feature] /v2/team/list: Add org admin access control, members_count, and indexes 2026-03-17 20:34:15 -07:00
start.sh
utils.py feat(proxy): add project_alias tracking through callback metadata pipeline 2026-03-23 10:44:17 -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