litellm/litellm/proxy
Vincent Koc 0dcc744f7e
fix(proxy): handle missing DATABASE_URL in append_query_params (#21239)
* fix: handle missing database url in append_query_params

* Update litellm/proxy/proxy_cli.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-16 09:03:10 -08:00
..
_experimental chore: update Next.js build artifacts (2026-02-15 01:33 UTC, node v22.16.0) 2026-02-14 17:33:10 -08:00
agent_endpoints Merge remote-tracking branch 'origin' into litellm_access_groups_inte 2026-02-14 13:27:36 -08:00
analytics_endpoints
anthropic_endpoints [Fix] 404 Not Found on /api/event_logging/batch endpoint (#20504) 2026-02-05 10:58:08 -08:00
auth fixing linting 2026-02-14 15:58:42 -08:00
batches_endpoints fix: proxy/batches_endpoints/endpoints.py:309:11: PLR0915 Too many statements (54 > 50) 2026-02-16 18:41:06 +05:30
client
common_utils fix: as per request changes 2026-02-14 04:34:58 +05:30
config_management_endpoints
container_endpoints
credential_endpoints
custom_hooks
db perf(spend): avoid duplicate daily agent transaction computation (#21187) 2026-02-16 18:28:34 +05:30
discovery_endpoints fix(azure): preserve content_policy_violation error details from Azure OpenAI (#20883) 2026-02-10 22:47:03 -08:00
example_config_yaml [Guardrails] Add guardrail pipeline support for conditional sequential execution (#21177) 2026-02-13 19:49:12 -08:00
fine_tuning_endpoints
google_endpoints
guardrails test fixes 2026-02-14 15:54:20 -08:00
health_check_utils fix: shared health check serialization (#21119) 2026-02-13 09:15:43 -08:00
health_endpoints Fix health endpoints 2026-01-31 12:25:04 -08:00
hooks Add comments 2026-02-14 19:46:56 -05:00
image_endpoints fix(arize-phoenix): dynamic project naming from metadata + guardrails on image generation 2026-02-11 15:45:46 +05:30
management_endpoints Merge pull request #20314 from Harshit28j/fix/sso_PKCE_deployments 2026-02-16 19:40:44 +05:30
management_helpers
middleware
ocr_endpoints
openai_files_endpoints Addressed greptile comments to extract common helpers and return 404 2026-02-16 07:58:04 -05:00
pass_through_endpoints fix(ci): Fix mypy type errors across 6 files (#21179) 2026-02-13 18:14:43 -08:00
policy_engine Merge pull request #21202 from jquinter/fix-unused-variable-pipeline-executor 2026-02-14 14:36:01 -03:00
prompts
public_endpoints
rag_endpoints
rerank_endpoints
response_api_endpoints
response_polling
search_endpoints masking sensitive values 2026-02-03 16:09:37 -08:00
spend_tracking fix ruff check 2026-02-12 22:17:14 -08:00
swagger
test_prompts
types_utils
ui_crud_endpoints Merge pull request #20444 from BerriAI/litellm_ui_config_req_auth_mh 2026-02-06 12:34:27 -08:00
vector_store_endpoints fix(ci): Fix mypy type errors across 6 files (#21179) 2026-02-13 18:14:43 -08:00
vector_store_files_endpoints Add support for managed file ids 2026-02-13 10:52:48 +05:30
vertex_ai_endpoints
video_endpoints
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml Guardrails - new Policy Templates (pre-configured guardrail combinations for specific use-cases) (#21025) 2026-02-13 11:53:02 -08:00
_super_secret_config.yaml
_types.py Merge branch 'main' into litellm_fix-virtual-key-grace-period 2026-02-15 08:09:13 +05:30
.gitignore
cached_logo.jpg update image and bounded logo in navbar 2026-01-30 16:35:24 -08:00
caching_routes.py
common_request_processing.py Agent Guardrails - on streaming output (#21206) 2026-02-14 11:36:52 -08:00
custom_auth_auto.py
custom_prompt_management.py
custom_sso.py Add support for extra fields in Generic SSO via GENERIC_USER_EXTRA_ATTRIBUTES (#20761) 2026-02-10 16:00:28 +05:30
custom_validate.py
enterprise
health_check.py
lambda.py
litellm_pre_call_utils.py docs: improve comment clarity per Greptile feedback 2026-02-14 14:43:20 -03:00
llamaguard_prompt.txt
logo.jpg
mcp_registry.json feat: MCP server discovery UI (#21079) 2026-02-12 17:59:21 -08:00
mcp_tools.py
model_config.yaml
openapi.json
post_call_rules.py
prisma_migration.py
proxy_cli.py fix(proxy): handle missing DATABASE_URL in append_query_params (#21239) 2026-02-16 09:03:10 -08:00
proxy_config.yaml [UI] M2M OAuth2 UI Flow (#20794) 2026-02-09 19:28:02 -08:00
proxy_server.py Fix CI/CD pyroscope test failure (#21219) 2026-02-14 12:07:20 -08:00
README.md
route_llm_request.py _route_user_config_request fix 2026-02-07 12:30:58 -08:00
schema.prisma Merge branch 'main' into litellm_fix-virtual-key-grace-period 2026-02-15 08:09:13 +05:30
start.sh
utils.py Merge branch 'main' into litellm_fix-virtual-key-grace-period 2026-02-15 08:09:13 +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