litellm/litellm/proxy
Julio Quinteros Pro 54e4af84d6
fix(auth): remove hardcoded base64 string flagged by secret scanner (#22125)
Replace literal Base64-encoded example value in docstring with a
placeholder to prevent GitGuardian/ggshield from flagging it as a
leaked Basic Authentication credential in container scans.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 14:18:36 -08:00
..
_experimental Agents - assign tools (#22064) 2026-02-25 11:44:30 -08:00
agent_endpoints Agents - assign tools (#22064) 2026-02-25 11:44:30 -08:00
analytics_endpoints
anthropic_endpoints
auth fix(auth): remove hardcoded base64 string flagged by secret scanner (#22125) 2026-02-25 14:18:36 -08:00
batches_endpoints fix(proxy): use batch_ prefix for Vertex AI batch IDs in encode_file_id_with_model (#21624) 2026-02-20 08:32:46 -08:00
client
common_utils Merge origin/main and address Greptile review feedback 2026-02-24 15:13:19 -08:00
config_management_endpoints
container_endpoints
credential_endpoints
custom_hooks
db merge: resolve conflict with origin/main in test_db_spend_update_writer.py 2026-02-25 12:15:53 -08:00
discovery_endpoints
example_config_yaml
fine_tuning_endpoints
google_endpoints fix: Metadata / Trace ID Missing in S3 Streaming Callbacks 2026-02-25 14:16:21 +05:30
guardrails Address CR feedback: fix auth dependency duplication, correct logger wording, clean imports 2026-02-25 18:02:12 +05:30
health_check_utils feat(proxy): limit concurrent health checks with health_check_concurrency (#20584) 2026-02-24 08:16:59 -08:00
health_endpoints removed extra comma typo 2026-02-24 17:37:00 -08:00
hooks Agents - assign tools (#22064) 2026-02-25 11:44:30 -08:00
image_endpoints
management_endpoints feat(agents): assign virtual keys to agents (#22045) 2026-02-24 18:28:16 -08:00
management_helpers
middleware perf: convert PrometheusAuthMiddleware from BaseHTTPMiddleware to pure ASGI 2026-02-21 12:06:31 -08:00
ocr_endpoints
openai_evals_endpoints
openai_files_endpoints fix(proxy): use batch_ prefix for Vertex AI batch IDs in encode_file_id_with_model (#21624) 2026-02-20 08:32:46 -08:00
pass_through_endpoints Merge origin/main and address Greptile review feedback 2026-02-24 15:13:19 -08:00
policy_engine Guardrail Policy Versioning (#21862) 2026-02-21 20:14:31 -08:00
prompts
public_endpoints fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
rag_endpoints tests and route permissions (#21508) 2026-02-18 16:58:38 -08:00
rerank_endpoints
response_api_endpoints
response_polling
search_endpoints
spend_tracking [Feature] Add request_duration_ms to SpendLogs 2026-02-24 21:04:53 -08:00
swagger
test_prompts
types_utils
ui_crud_endpoints fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -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 fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
_super_secret_config.yaml
_types.py Merge remote-tracking branch 'origin' into litellm_spend_log_duration 2026-02-25 12:06:19 -08:00
.gitignore
cached_logo.jpg
caching_routes.py
common_request_processing.py fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
compliance_checks.py
custom_auth_auto.py
custom_prompt_management.py
custom_sso.py
custom_validate.py
enterprise
health_check.py Merge upstream/main - resolve health check conflicts 2026-02-24 17:09:05 -08:00
lambda.py
litellm_pre_call_utils.py Fix clean header logger 2026-02-25 12:31:35 +05:30
llamaguard_prompt.txt
logo.jpg
mcp_registry.json
mcp_tools.py
model_config.yaml
openapi.json
post_call_rules.py
prisma_migration.py
proxy_cli.py
proxy_config.yaml
proxy_server.py Address CR feedback: fix auth dependency duplication, correct logger wording, clean imports 2026-02-25 18:02:12 +05:30
README.md
route_llm_request.py
schema.prisma Merge remote-tracking branch 'origin' into litellm_spend_log_duration 2026-02-25 12:06:19 -08:00
start.sh
utils.py feat(proxy): add warning/error level logging throughout spend tracking lifecycle 2026-02-24 10:17:35 -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