litellm/litellm/proxy
Krish Dholakia 7a128e2017
VertexAI Anthropic - streaming passthrough cost tracking (#11734)
* feat(vertex_passthrough_logging_handler.py): initial anthropic passthrough streaming cost tracking support

* fix: fix linting errors

* test: update test
2025-06-15 01:16:43 -07:00
..
_experimental ui new build 2025-06-14 16:28:55 -07:00
analytics_endpoints
anthropic_endpoints fix: detect and return status codes in streaming responses (#10962) 2025-05-24 12:04:46 -07:00
auth [Fix] JWT - Fix error when team member already part of team (#11735) 2025-06-14 15:50:16 -07:00
batches_endpoints build(VLLM-Passthrough-with-loadbalancing-support-(enables-using-model-list-for-VLLM-/classify-endpoint)): Closes #11205 2025-05-31 09:00:04 -07:00
client Make all commands show server URL (#10801) 2025-06-09 17:37:40 -07:00
common_utils Update enduser spend and budget reset date based on budget duration (#8460) 2025-06-08 08:39:14 -07:00
config_management_endpoints
credential_endpoints added support to credential delete to support slashes in the curl (#10987) 2025-05-20 19:08:48 -07:00
db [Feat] Make batch size for maximum retention in spend logs a controllable parameter (#11459) 2025-06-05 17:11:51 -07:00
discovery_endpoints UI - Custom Server Root Path (Multiple Fixes) (#11337) 2025-06-02 17:48:03 -07:00
example_config_yaml [Feat] - Add Support for Showing Passthrough endpoint Error Logs on LiteLLM UI (#10990) 2025-05-20 18:29:39 -07:00
fine_tuning_endpoints Litellm managed file updates combined (#11040) 2025-05-22 17:20:41 -07:00
guardrails Pangea/kl/udpate readme (#11570) 2025-06-10 08:29:12 -07:00
health_endpoints Revert "Implement health check backend API and storage functionality (#11678)" 2025-06-14 15:45:33 -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] JWT - Fix error when team member already part of team (#11735) 2025-06-14 15:50:16 -07:00
management_helpers [Fix] QA Fixes - Vector Store Object Permissions (#11291) 2025-05-31 09:41:05 -07:00
middleware PrometheusAuthMiddleware 2025-04-04 20:37:53 -07:00
openai_files_endpoints build(VLLM-Passthrough-with-loadbalancing-support-(enables-using-model-list-for-VLLM-/classify-endpoint)): Closes #11205 2025-05-31 09:00:04 -07:00
pass_through_endpoints VertexAI Anthropic - streaming passthrough cost tracking (#11734) 2025-06-15 01:16:43 -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 Remove + Check for unsafe enterprise/ folder imports (#11107) 2025-05-24 08:59:02 -07:00
swagger feat: add offline swagger docs (#7653) 2025-04-06 13:55:06 -07:00
types_utils test fix post call rules (#9826) 2025-04-08 13:55:37 -07:00
ui_crud_endpoints Refactor settings response models in proxy_setting_endpoints.py 2025-06-04 15:08:05 -06:00
vertex_ai_endpoints
__init__.py
_logging.py
_new_new_secret_config.yaml
_new_secret_config.yaml Release note updates + Responses API Bridge improvements (#11740) 2025-06-15 01:13:10 -07:00
_super_secret_config.yaml
_types.py [Fix] JWT - Fix error when team member already part of team (#11735) 2025-06-14 15:50:16 -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 [Feat] New LLM API Endpoint - Add List input items for Responses API (#11602) 2025-06-10 15:47:16 -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 Revert "Revert "Support passing prompt_label to langfuse (#11018)"" 2025-05-22 14:14:39 -07:00
custom_sso.py
custom_validate.py
enterprise
health_check.py
lambda.py
litellm_pre_call_utils.py Prometheus - fix request increment + add route tracking for streaming requests (#11731) 2025-06-14 16:26:48 -07:00
llamaguard_prompt.txt
logo.jpg
mcp_tools.py
model_config.yaml
openapi.json
post_call_rules.py
prisma_migration.py
proxy_cli.py [Feat] LiteLLM Allow setting Uvicorn Keep Alive Timeout (#11594) 2025-06-10 13:30:19 -07:00
proxy_config.yaml [Feat] Prometheus - Allow controlling exposed metrics and labels (#11489) 2025-06-14 13:56:40 -07:00
proxy_server.py Add model access groups on UI (#11719) 2025-06-13 21:20:25 -07:00
README.md
route_llm_request.py [Feat] New LLM API Endpoint - Add List input items for Responses API (#11602) 2025-06-10 15:47:16 -07:00
schema.prisma Revert "feat(schema): add additional indexes to LiteLLM_SpendLogs for improve…" (#11683) 2025-06-12 18:18:44 -07:00
start.sh
utils.py fix code qa check 2025-06-14 15:56:00 -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