litellm/litellm/proxy
Julio Quinteros Pro fdcb2ca37d fix(mypy): resolve type errors introduced by MCP user permissions (#21462)
- Cast `guardrail` to `Dict[str, Any]` in `mcp_end_user_permission/__init__.py`
  to fix "No overload variant of 'get' matches argument type 'str'" — the
  `Guardrail` TypedDict's `.get()` overloads resolve the key type to `Never`
  when chained with a `{}` default, making further `.get()` calls fail.
- Cast `fn` to `Dict[str, Any]` in `transformation.py`
  `transform_chat_completion_tool_params_to_responses_api_tools` to fix
  '"object" has no attribute "get"' — `tool.get("function")` on
  `Union[ChatCompletionFunctionToolParam, OpenAIMcpServerTool]` returns
  `object` because `"function"` is not a key in `OpenAIMcpServerTool`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 02:02:17 -03:00
..
_experimental Mcp user permissions (#21462) 2026-02-18 18:53:59 -08:00
agent_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
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: prompt registry 2026-02-18 00:34:54 +05:30
auth Mcp user permissions (#21462) 2026-02-18 18:53:59 -08:00
batches_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
client fix: prompt registry 2026-02-18 00:34:54 +05:30
common_utils fix: remove unused asyncio imports (F401) 2026-02-17 18:54:18 -03:00
config_management_endpoints
container_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
credential_endpoints fix: prompt registry 2026-02-18 00:34:54 +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 Revert "fix(pod-lock): make release lock compare-and-delete atomic (#21226)" 2026-02-18 17:24:34 +05:30
discovery_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
example_config_yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
fine_tuning_endpoints fix: Get custom_llm_provider from query param (#16731) 2025-11-17 19:56:41 -08:00
google_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
guardrails fix(mypy): resolve type errors introduced by MCP user permissions (#21462) 2026-02-19 02:02:17 -03:00
health_check_utils fix: prompt registry 2026-02-18 00:34:54 +05:30
health_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
hooks fix: prompt registry 2026-02-18 00:34:54 +05:30
image_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
management_endpoints Mcp user permissions (#21462) 2026-02-18 18:53:59 -08:00
management_helpers [Feat] Tag Management - Add support for setting tag based budgets (#15433) 2025-10-10 19:24:50 -07:00
middleware fix: improve streaming proxy throughput by fixing middleware and logging bottlenecks (#21501) 2026-02-18 16:16:49 -08:00
ocr_endpoints [Feat] Native /ocr endpoint support (#15573) 2025-10-15 17:20:01 -07:00
openai_evals_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
openai_files_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
pass_through_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
policy_engine fix: prompt registry 2026-02-18 00:34:54 +05:30
prompts fix: prompt registry 2026-02-18 00:34:54 +05:30
public_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
rag_endpoints tests and route permissions (#21508) 2026-02-18 16:58:38 -08:00
rerank_endpoints use correct get custom headers 2025-03-12 17:16:51 -07:00
response_api_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
response_polling fix: prompt registry 2026-02-18 00:34:54 +05:30
search_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
spend_tracking fixes - showing content filter on failure 2026-02-17 17:57:52 -08: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 fix: prompt registry 2026-02-18 00:34:54 +05:30
vector_store_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
vector_store_files_endpoints fix: prompt registry 2026-02-18 00:34:54 +05:30
vertex_ai_endpoints Move query params to create_pass_through_route call (#17660) 2025-12-08 12:57:49 -08:00
video_endpoints Revert "Litellm staging 01 15 2026" 2026-01-17 06:31:34 +09:00
.gitignore
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml Mcp user permissions (#21462) 2026-02-18 18:53:59 -08:00
_super_secret_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
_types.py Merge pull request #21500 from BerriAI/fix/managed-file-table-optional-defaults 2026-02-19 01:47:33 -03:00
cached_logo.jpg fix: prompt registry 2026-02-18 00:34:54 +05:30
caching_routes.py fix install on python 2025-06-14 15:42:06 -07:00
common_request_processing.py fix: prompt registry 2026-02-18 00:34:54 +05:30
compliance_checks.py Add compliance checker endpoints + UI panel (#21432) 2026-02-17 18:22:26 -08:00
custom_auth_auto.py Custom Auth - bubble up custom exceptions (#13093) 2025-07-29 16:28:25 -07:00
custom_prompt_management.py fix: prompt registry 2026-02-18 00:34:54 +05:30
custom_sso.py fix: prompt registry 2026-02-18 00:34:54 +05:30
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 Mcp user permissions (#21462) 2026-02-18 18:53:59 -08:00
llamaguard_prompt.txt
logo.jpg
mcp_registry.json fix: prompt registry 2026-02-18 00:34:54 +05:30
mcp_tools.py example mcp tools 2025-03-20 17:53:20 -07:00
model_config.yaml
openapi.json
post_call_rules.py
prisma_migration.py Revert "Fix/prisma schema permission (#19391)" 2026-01-21 17:19:32 +05:30
proxy_cli.py fix: prompt registry 2026-02-18 00:34:54 +05:30
proxy_config.yaml fix: prompt registry 2026-02-18 00:34:54 +05:30
proxy_server.py Merge pull request #21511 from BerriAI/litellm_store_model_in_db_from_database 2026-02-18 17:43:56 -08:00
README.md
route_llm_request.py fix: prompt registry 2026-02-18 00:34:54 +05:30
schema.prisma Mcp user permissions (#21462) 2026-02-18 18:53:59 -08:00
start.sh
utils.py Mcp user permissions (#21462) 2026-02-18 18:53:59 -08: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