litellm/litellm/proxy
Krish Dholakia e4e10aa4ed
Litellm dev 07 21 2025 p1 (#12848)
* fix(main.py): fix async retryer

Fixes https://github.com/BerriAI/litellm/issues/12830

* fix(forward_clientside_headers_by_model_group.py): filter out 'content-type' from forwardable headers

clientside content-type != proxy content type, can cause requests to hang

* test(tests/): update tests
2025-07-21 22:09:39 -07:00
..
_experimental docs(bulk_edit_users.md): add guide on bulk editing existing users 2025-07-19 18:26:09 -07:00
analytics_endpoints
anthropic_endpoints fix(anthropic_endpoints.py): publicly expose anthropic v1/messages endpoint 2025-06-26 10:47:37 -07:00
auth Passthrough Auth - make Auth checks OSS + Anthropic - only show 'reasoning_effort' for supported models (#12847) 2025-07-21 21:55:41 -07:00
batches_endpoints Batches - support batch retrieve with target model Query Param + Anthropic - completion bridge, yield content_block_stop chunk (#12228) 2025-07-01 22:13:48 -07:00
client Add "keys import" command to CLI (#12620) 2025-07-15 20:14:43 -07:00
common_utils Bulk Edit Users on UI (#12763) 2025-07-19 11:04:23 -07:00
config_management_endpoints
credential_endpoints
custom_hooks [Feat] SSO - Allow users to run a custom sso login handler (#12465) 2025-07-09 16:36:30 -07:00
db dont emit warning for Max in memory queue flush count (#12489) 2025-07-10 10:36:16 -07:00
discovery_endpoints fix code qa check 2025-07-11 22:35:27 -07:00
example_config_yaml
fine_tuning_endpoints
google_endpoints [Feat] Add gemini-cli support - call VertexAI models through LiteLLM Native gemini routes (#12053) 2025-06-25 18:39:25 -07:00
guardrails fix(proxy): Fix Model Armor project_id initialization order (#12766) 2025-07-19 15:20:40 -07:00
health_endpoints Health check app on separate port (#12718) 2025-07-18 11:17:15 -07:00
hooks Prometheus - fix request increment + add route tracking for streaming requests (#11731) 2025-06-14 16:26:48 -07:00
image_endpoints Feat: add add azure endpoint for image endpoints (#11482) 2025-06-06 10:38:37 -07:00
management_endpoints Fix team_member_budget update logic (#12843) 2025-07-21 22:06:29 -07:00
management_helpers [MCP Gateway] access group UI object permission fix (#12523) 2025-07-11 18:25:40 -07:00
middleware
openai_files_endpoints Store batch output file id in DB + Store batch file status in DB + (experimental) BATCH API COST TRACKING 2025-06-25 22:41:22 -07:00
pass_through_endpoints Bedrock Passthrough cost tracking (/invoke + /converse routes - streaming + non-streaming) (#12123) 2025-06-27 20:01:12 -07:00
public_endpoints build(ui/): UI - Public Model Hub v2 (#12532) 2025-07-11 22:24:31 -07:00
rerank_endpoints
response_api_endpoints [Feat] New LLM API Endpoint - Add List input items for Responses API (#11602) 2025-06-10 15:47:16 -07:00
spend_tracking fix: Handle circular references in spend tracking metadata JSON serialization (#12643) 2025-07-16 07:24:41 -07:00
swagger
types_utils [Feat] Allow reading custom logger python scripts from s3 (#12623) 2025-07-16 15:07:01 -07:00
ui_crud_endpoints Litellm dev 07 21 2025 p1 (#12848) 2025-07-21 22:09:39 -07:00
vector_store_endpoints [Feat] LLM API Endpoint - Expose OpenAI Compatible /vector_stores/{vector_store_id}/search endpoint (#12749) 2025-07-18 18:18:53 -07:00
vertex_ai_endpoints
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml Litellm dev 07 21 2025 p1 (#12848) 2025-07-21 22:09:39 -07:00
_super_secret_config.yaml
_types.py Fix team_member_budget update logic (#12843) 2025-07-21 22:06:29 -07:00
.gitignore
cached_logo.jpg
caching_routes.py fix install on python 2025-06-14 15:42:06 -07:00
common_request_processing.py /streamGenerateContent - non-gemini model support (#12647) 2025-07-18 10:56:29 -07:00
custom_auth_auto.py Support returning virtual key in custom auth + Handle provider-specific optional params for embedding calls (#11346) 2025-06-03 07:24:13 -07:00
custom_prompt_management.py Litellm dev 07 03 2025 p2 (#12301) 2025-07-03 22:40:21 -07:00
custom_sso.py
custom_validate.py
enterprise
health_check.py
lambda.py
litellm_pre_call_utils.py Allow forwarding clientside headers by model group (#12753) 2025-07-19 15:17:13 -07:00
litellm.log Teams - Support default key expiry + UI - support enforcing access for members of specific SSO Group (#12023) 2025-06-24 21:58:07 -07:00
llamaguard_prompt.txt
logo.jpg
mcp_tools.py
model_config.yaml
openapi.json
post_call_rules.py
prisma_migration.py refactor(prisma_migration.py): refactor to support use_prisma_migrate - for helm hook (#12600) 2025-07-14 22:11:46 -07:00
proxy_cli.py Health check app on separate port (#12718) 2025-07-18 11:17:15 -07:00
proxy_config.yaml [Docs] 1.74.6.rc note (#12765) 2025-07-19 11:54:22 -07:00
proxy_server.py Litellm dev 07 21 2025 p1 (#12848) 2025-07-21 22:09:39 -07:00
README.md
route_llm_request.py [Feat] Proxy - New LLM API Routes /v1/vector_stores and /v1/vector_stores/vs_abc123/search (#12699) 2025-07-17 11:19:25 -07:00
schema.prisma [Bug Fix] QA - Use PG Vector Vector Store with LiteLLM (#12716) 2025-07-18 08:41:18 -07:00
start.sh
utils.py Guardrails AI - pre-call + logging only guardrail (pii detection/competitor names) support (#12506) 2025-07-10 21:41:02 -07: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