litellm/litellm/proxy
2026-02-26 15:19:32 +05:30
..
_experimental Merge origin/main and address Greptile review feedback 2026-02-24 15:13:19 -08:00
agent_endpoints fix: use UI_TEAM_ID constant instead of hardcoded string 2026-02-20 18:14:57 -08:00
analytics_endpoints
anthropic_endpoints
auth fix: req changes 2026-02-26 15:19:32 +05:30
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 feat(proxy): tool policies - auto-discover tools + policy enforcement guardrail (#22041) 2026-02-24 16:27:06 -08:00
discovery_endpoints
example_config_yaml
fine_tuning_endpoints
google_endpoints
guardrails feat(proxy): tool policies - auto-discover tools + policy enforcement guardrail (#22041) 2026-02-24 16:27:06 -08:00
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 fix: custom auth budget issue 2026-02-26 13:03:01 +05:30
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
rerank_endpoints
response_api_endpoints
response_polling
search_endpoints
spend_tracking [Fix] Include all SpendLogsMetadata keys in spend logs payload 2026-02-20 17:25:28 -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 fix: custom auth budget issue 2026-02-26 13:03:01 +05:30
.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: custom auth budget issue 2026-02-26 13:03:01 +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 [Feat] UI - Allow using AI to understand Usage patterns (#22042) 2026-02-24 16:40:04 -08:00
README.md
route_llm_request.py
schema.prisma feat: add new code execution dataset (#22065) 2026-02-24 20:58:23 -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