litellm/litellm/proxy
Cursor Agent e317d20573 feat: Redact messages in spend logs' proxy_server_request
This change ensures that sensitive message content within the `proxy_server_request` field of spend logs is redacted when message logging is turned off or when the redaction header is used. This enhances privacy and security by preventing the logging of potentially sensitive user inputs in the request details.

Co-authored-by: ishaan <ishaan@berri.ai>
2026-01-09 22:06:34 +00:00
..
_experimental Fix: Nonetype object has no method .get() for call tool 2026-01-07 10:42:02 +05:30
agent_endpoints Merge pull request #17781 from BerriAI/litellm_daily_agent_table 2025-12-11 15:01:50 -08:00
analytics_endpoints fix(sql): Optimize SpendLogs queries to use timestamp filtering for index usage (#17504) 2025-12-04 21:52:57 -08:00
anthropic_endpoints fix(proxy): return json error response instead of sse format for initial streaming errors (#18757) 2026-01-07 21:26:47 +05:30
auth Add fix for bedrock_cache, metadata and max_model_budget (#18872) 2026-01-10 01:09:00 +05:30
batches_endpoints Fix model getting twice 2025-12-16 15:43:55 +05:30
client add a new feature fix to expose the team alias when authenticating th… (#17725) 2025-12-10 10:10:28 -08:00
common_utils Fix: Clarify database_connection_pool_limit applies per worker, not per instance (#18780) 2026-01-07 13:57:03 -08:00
config_management_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
container_endpoints [Feat] Litellm new endpoint add container file upload (#18743) 2026-01-07 13:36:55 +05:30
credential_endpoints Added new step into rotate master key function for processing credentials table (#17952) 2025-12-16 09:40:22 +05:30
custom_hooks [Feat] SSO - Allow users to run a custom sso login handler (#12465) 2025-07-09 16:36:30 -07:00
db fix: proactive RDS IAM token refresh to prevent 15-min connection failed (#18795) 2026-01-08 23:53:36 +05:30
discovery_endpoints Support Disable Admin UI 2025-12-23 13:52:05 -08:00
example_config_yaml [Feat] Guardrails Load Balancing - Allow Platform admins to load balance between guardrails (#18181) 2025-12-19 00:08:03 +05:30
fine_tuning_endpoints fix: Get custom_llm_provider from query param (#16731) 2025-11-17 19:56:41 -08:00
google_endpoints [Feat] New Logging Integration - Azure Sentinel Logger (#18146) 2025-12-18 02:04:49 +05:30
guardrails Hotfix - docs qualifire (#18724) 2026-01-07 17:23:12 +05:30
health_check_utils fix lint errors (#15406) 2025-10-10 14:16:23 -07:00
health_endpoints add license endpoint (#18311) 2025-12-25 11:11:17 +05:30
hooks Add fix for bedrock_cache, metadata and max_model_budget (#18872) 2026-01-10 01:09:00 +05:30
image_endpoints Fix image edit endpoint (#17046) 2025-11-24 20:52:35 -08:00
management_endpoints feat: add mcp registry 2026-01-09 15:07:39 +09:00
management_helpers [Feat] Tag Management - Add support for setting tag based budgets (#15433) 2025-10-10 19:24:50 -07:00
middleware PrometheusAuthMiddleware 2025-04-04 20:37:53 -07:00
ocr_endpoints [Feat] Native /ocr endpoint support (#15573) 2025-10-15 17:20:01 -07:00
openai_files_endpoints fix:No module named 'fastapi' 2025-12-19 15:20:01 +05:30
pass_through_endpoints Fix : litellm import error 2026-01-10 01:03:50 +05:30
prompts [Feat] UI - Show "get code" section for prompt management + minor polish of showing version history (#16941) 2025-11-21 14:00:33 -08:00
public_endpoints Feat/add watsonx fields (#18569) 2026-01-03 02:53:17 +05:30
rag_endpoints [Feat] RAG query endpoint - Add RAG Search / Query endpoint (#18376) 2025-12-23 22:30:37 +05:30
rerank_endpoints use correct get custom headers 2025-03-12 17:16:51 -07:00
response_api_endpoints Revert "feat: Add built-in migration lock to prevent concurrent Prisma migrat…" (#18719) 2026-01-06 23:56:02 +05:30
response_polling Fix lint and mypy error for response api polling 2025-12-08 20:42:23 +05:30
search_endpoints Add cost tracking and logging support 2025-11-25 17:14:59 +05:30
spend_tracking feat: Redact messages in spend logs' proxy_server_request 2026-01-09 22:06:34 +00:00
swagger Change favicon (#16837) 2025-11-19 20:38:22 -08:00
test_prompts Prompt Management (2/2) - New /prompt/list endpoint + key-based access to prompt templates (#13218) 2025-08-02 10:36:38 -07:00
types_utils [Feat] Allow reading custom logger python scripts from s3 (#12623) 2025-07-16 15:07:01 -07:00
ui_crud_endpoints Adding role mappings to SSOConfig DB 2025-12-16 15:48:26 -08:00
vector_store_endpoints resolve embeddings model config 2025-12-17 21:56:47 -08:00
vector_store_files_endpoints Vector store files Stable Release (#16643) 2025-11-15 13:00:33 -08:00
vertex_ai_endpoints Move query params to create_pass_through_route call (#17660) 2025-12-08 12:57:49 -08:00
video_endpoints Fix : use litellm params for other video apis 2025-12-09 23:03:29 +05:30
.gitignore
__init__.py
_logging.py
_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 Guardrails - LiteLLM Content Filter - add support for running content filters on images (#18044) 2025-12-18 16:46:14 +05:30
_super_secret_config.yaml fix: remove fake keys causing security scans to fail (#18140) 2025-12-17 10:14:06 -08:00
_types.py Merge pull request #18763 from BerriAI/litellm_staging_01_07_2026 2026-01-09 17:01:58 +05:30
cached_logo.jpg Litellm dev 01 23 2025 p2 (#7962) 2025-01-23 21:02:15 -08:00
caching_routes.py fix install on python 2025-06-14 15:42:06 -07:00
common_request_processing.py Merge branch 'main' into litellm_staging_01_06_2026 2026-01-09 17:06:17 +05:30
custom_auth_auto.py Custom Auth - bubble up custom exceptions (#13093) 2025-07-29 16:28:25 -07:00
custom_prompt_management.py [Fix] CI/CD - mypy & check_code_and_doc_quality & mcp_testing (#17920) 2025-12-13 08:18:43 -08: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 Azure DALL-E-3 health check content policy violation by using safe default prompt (#16329) 2025-11-07 15:30:56 -08:00
lambda.py
litellm_pre_call_utils.py feat: Add Prometheus metrics for request queue time and guardrails (#17973) 2026-01-06 23:50:11 +05:30
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 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 fix(proxy_cli.py): check for env var for IAM_TOKEN_DB_AUTH 2025-11-11 11:56:58 -08:00
proxy_config.yaml [Feat] Litellm new endpoint add container file upload (#18743) 2026-01-07 13:36:55 +05:30
proxy_server.py Merge pull request #18833 from BerriAI/litellm_staging_01_08_2026 2026-01-09 17:04:29 +05:30
README.md [Feat-Proxy] Allow using custom sso handler (#5809) 2024-09-20 19:14:33 -07:00
route_llm_request.py [Feat] Litellm new endpoint add container file upload (#18743) 2026-01-07 13:36:55 +05:30
schema.prisma Merge remote-tracking branch 'origin' into litellm_key_team_routing_config 2026-01-07 11:08:01 -08:00
start.sh
utils.py Merge branch 'main' into litellm_staging_01_06_2026 2026-01-09 17:06:17 +05:30

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