litellm/litellm/proxy
Miguel Armenta 750fc4a980
azure content enhancement... (#22581)
* azure content enhancement...

* rafactored to increase confidence score

* improvements based on additional feedback

* removed unused import

* Force-split any word longer than max length allowed

* preserve whitespace in text splitting

* moving common initialization to base class

* consolidate enforcement into async_make_request as single point, remove redundant caller-side checks, extract shared init/HTTP logic into base, and fix stale log messages

* clean up

* clean up tests
2026-03-04 10:22:30 -08:00
..
_experimental Agent Tracing - support context_id based trace id propogation + nested llm calls (#22626) 2026-03-03 18:19:12 -08:00
agent_endpoints Agent Tracing - support context_id based trace id propogation + nested llm calls (#22626) 2026-03-03 18:19:12 -08:00
analytics_endpoints
anthropic_endpoints fix(count_tokens): include system and tools in token counting API requests 2026-02-27 15:39:35 -03:00
auth Merge pull request #22678 from Harshit28j/litellm_custom_auth_opt_in 2026-03-04 14:53:44 +05:30
batches_endpoints Merge pull request #22728 from BerriAI/litellm_batch_expiry_validation_followup 2026-03-04 10:16:02 -08:00
client
common_utils Merge pull request #22103 from Harshit28j/litellm_feat_datadog_metrics 2026-02-28 17:25:23 +05:30
config_management_endpoints
container_endpoints
credential_endpoints
custom_hooks
db [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -08:00
discovery_endpoints
example_config_yaml
fine_tuning_endpoints
google_endpoints
guardrails azure content enhancement... (#22581) 2026-03-04 10:22:30 -08:00
health_check_utils
health_endpoints fix(mypy): fix 3 mypy errors in presidio.py and _health_endpoints.py (#22422) 2026-02-28 10:46:27 -08:00
hooks Fix: Removed the process-level _encrypted_response_id_cache from __init__ 2026-03-04 12:30:49 +05:30
image_endpoints
management_endpoints fix: remove unused imports in tool_management_endpoints and streaming_iterator 2026-03-04 11:36:08 -03:00
management_helpers
middleware Fix inflight mypy 2026-03-02 19:41:32 +05:30
ocr_endpoints Enable local file support for OCR (#22133) 2026-02-27 10:50:02 -08:00
openai_evals_endpoints
openai_files_endpoints Merge pull request #22728 from BerriAI/litellm_batch_expiry_validation_followup 2026-03-04 10:16:02 -08:00
pass_through_endpoints fix: catch exceptions in pass-through streaming logging handler (#21636) 2026-03-02 19:21:10 +05:30
policy_engine
prompts
public_endpoints Development environment setup (#22432) 2026-02-28 14:50:06 -08:00
rag_endpoints
rerank_endpoints
response_api_endpoints feat(proxy): add WebSocket endpoint for responses API and route_llm_request support 2026-03-02 17:22:44 +05:30
response_polling
search_endpoints
spend_tracking Agent Tracing - support context_id based trace id propogation + nested llm calls (#22626) 2026-03-03 18:19:12 -08:00
swagger
test_prompts
types_utils
ui_crud_endpoints [Feature] UI - Admin Settings: Add opt-in flag for Projects feature 2026-02-28 10:32:02 -08:00
vector_store_endpoints
vector_store_files_endpoints
vertex_ai_endpoints
video_endpoints
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -08:00
_super_secret_config.yaml
_types.py [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -08:00
.gitignore
cached_logo.jpg
caching_routes.py
common_request_processing.py Merge pull request #22559 from BerriAI/litellm_responses_websocket 2026-03-04 17:57:34 +05:30
compliance_checks.py
custom_auth_auto.py
custom_prompt_management.py
custom_sso.py
custom_validate.py
dd_span_tagger.py feat(proxy): add key_alias, key_hash, requested_model DD APM span tags (#22710) 2026-03-03 20:22:59 -08:00
enterprise
health_check.py add docs and formatting 2026-02-28 14:08:09 +05:30
lambda.py
litellm_pre_call_utils.py [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -08:00
llamaguard_prompt.txt
logo.jpg
mcp_registry.json
mcp_tools.py
model_config.yaml
openapi.json
post_call_rules.py
prisma_migration.py
prometheus_cleanup.py Add Prometheus child_exit cleanup for gunicorn workers 2026-02-27 16:11:15 -08:00
proxy_cli.py Add Prometheus child_exit cleanup for gunicorn workers 2026-02-27 16:11:15 -08:00
proxy_config.yaml
proxy_server.py [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -08:00
README.md
route_llm_request.py feat(proxy): add WebSocket endpoint for responses API and route_llm_request support 2026-03-02 17:22:44 +05:30
schema.prisma [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -08:00
start.sh
utils.py [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -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