litellm/litellm/proxy
Krish Dholakia bfaab8ad7e
Merge pull request #14557 from timelfrink/fix/issue-14478-bedrock-count-tokens-endpoint
Implement AWS Bedrock CountTokens API support
2025-09-17 23:51:06 -07:00
..
_experimental fix: ci/cd tests + lint errors (#14646) 2025-09-17 17:06:43 -07:00
analytics_endpoints
anthropic_endpoints [Fix] Remove INFO level log from /messages endpoint (#14377) 2025-09-09 12:51:03 -07:00
auth [Performance] RPS Improvement +500 RPS when sending the user field (#14616) 2025-09-16 16:18:23 -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 Fixed incorrect key info endpoint (#13633) 2025-08-15 11:10:06 -07:00
common_utils [Performance] RPS Improvement +500 RPS when sending the user field (#14616) 2025-09-16 16:18: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 [Security] Fix: Ensure .info() logs are not used for request/responses + Add code QA check for possible violations (#14386) 2025-09-09 13:55:56 -07:00
discovery_endpoints fix code qa check 2025-07-11 22:35:27 -07:00
example_config_yaml Merge pull request #14519 from uc4w6c/feat/add_tools_permission_guardrail 2025-09-13 23:22:31 -07:00
fine_tuning_endpoints
google_endpoints format 2025-09-02 09:52:50 +08:00
guardrails Merge pull request #14653 from ARajan1084/in-memory-guardrail-fix 2025-09-17 17:42:23 -07:00
health_endpoints fix(_health_endpoints.py): protect /health/test_connection - only allow users who are allowed to create models, to call this endpoint 2025-09-17 15:28:35 -07:00
hooks fix: ci/cd tests + lint errors (#14646) 2025-09-17 17:06:43 -07:00
image_endpoints
management_endpoints fix(key_management_endpoints.py): include created by keys in /key/list 2025-09-16 16:47:25 -07:00
management_helpers Enhance team member permission error message with guidance for key creation (#13443) 2025-08-08 14:35:06 -07:00
middleware
openai_files_endpoints fix: ci/cd tests + lint errors (#14646) 2025-09-17 17:06:43 -07:00
pass_through_endpoints Merge pull request #14557 from timelfrink/fix/issue-14478-bedrock-count-tokens-endpoint 2025-09-17 23:51:06 -07:00
prompts Prompt Management - add prompts on UI (#13240) 2025-08-02 22:33:37 -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]Add cancel endpoint support for openai and azure (#14561) 2025-09-15 07:08:56 -07:00
spend_tracking feat: implement middle-truncation for spend log payloads 2025-09-17 16:30:25 +03:00
swagger Swagger - bump DOMPurify version + add back Support local swagger bundle (good for airgapped environments) + support local swagger on custom root paths (#12911) 2025-07-23 11:22:56 -07:00
test_prompts Prompt Management (2/2) - New /prompt/list endpoint + key-based access to prompt templates (#13218) 2025-08-02 10:36:38 -07:00
types_utils [Feat] Allow reading custom logger python scripts from s3 (#12623) 2025-07-16 15:07:01 -07:00
ui_crud_endpoints feat: Add logo customization for LiteLLM admin UI (#12958) 2025-08-06 08:10:08 -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 fix(bedrock_guardrails.py): respect bedrock runtime endpoint when using guardrails 2025-09-17 14:41:40 -07:00
_super_secret_config.yaml
_types.py [Fix] /responses API - add cancel endpoint + allow non-admins to use this as an llm api endpoint (#14594) 2025-09-15 18:49:54 -07:00
.gitignore
cached_logo.jpg
caching_routes.py
common_request_processing.py [Feat]Add cancel endpoint support for openai and azure (#14561) 2025-09-15 07:08:56 -07:00
custom_auth_auto.py Custom Auth - bubble up custom exceptions (#13093) 2025-07-29 16:28:25 -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 fix: ci/cd tests + lint errors (#14646) 2025-09-17 17:06:43 -07:00
llamaguard_prompt.txt
logo.jpg
mcp_tools.py
model_config.yaml
openapi.json
post_call_rules.py
prisma_migration.py LiteLLM SDK <-> Proxy: support user param + Prisma - remove use_prisma_migrate flag - redundant as this is now default (#13555) 2025-08-12 22:03:39 -07:00
proxy_cli.py Update proxy_cli.py help message (#14369) 2025-09-09 13:52:59 -07:00
proxy_config.yaml [QA] E2E - Testing for bedrock batches api (#14525) 2025-09-12 19:31:19 -07:00
proxy_server.py fix(proxy_server.py): fix api call 2025-09-09 19:44:25 -07:00
README.md
route_llm_request.py [Feat]Add cancel endpoint support for openai and azure (#14561) 2025-09-15 07:08:56 -07:00
schema.prisma Prompt Management - add prompts on UI (#13240) 2025-08-02 22:33:37 -07:00
start.sh
utils.py Router - reduce p99 latency w/ redis enabled by 50% + OTEL - track pre_call hook latency (#13362) 2025-08-09 16:09:51 -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