litellm-mirror/litellm/proxy
Krish Dholakia ae7f54498f Litellm enforce enterprise features (#7357)
* fix(proxy_server.py): enforce team id based model add only works if enterprise user

* fix(auth_checks.py): enforce common_checks can only be imported by user_api_key_auth.py

* fix(auth_checks.py): insert not premium user error message on failed common checks run
2024-12-21 19:14:13 -08:00
..
_experimental ui - new build 2024-12-21 15:01:17 -08:00
analytics_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
auth Litellm enforce enterprise features (#7357) 2024-12-21 19:14:13 -08:00
common_utils Litellm dev 12 20 2024 p3 (#7339) 2024-12-20 21:13:32 -08:00
config_management_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
db (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
example_config_yaml (fix) LiteLLM Proxy fix GET /files/{file_id:path}/content" endpoint (#7342) 2024-12-20 21:27:45 -08:00
fine_tuning_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
guardrails (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
health_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
hooks Litellm dev 12 20 2024 p3 (#7339) 2024-12-20 21:13:32 -08:00
management_endpoints apply linting fixes 2024-12-21 14:31:23 -08:00
management_helpers (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
openai_files_endpoints (fix) LiteLLM Proxy fix GET /files/{file_id:path}/content" endpoint (#7342) 2024-12-20 21:27:45 -08:00
pass_through_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
proxy_load_test (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
rerank_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
spend_tracking (refactor) - fix from enterprise.utils import ui_get_spend_by_tags (#7352) 2024-12-21 14:17:12 -08:00
ui_crud_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
vertex_ai_endpoints (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
.gitignore
__init__.py
_logging.py fix(_logging.py): fix timestamp format for json logs 2024-06-20 15:20:21 -07:00
_new_secret_config.yaml Litellm dev 2024 12 20 p1 (#7335) 2024-12-20 21:22:31 -08:00
_super_secret_config.yaml docs(enterprise.md): cleanup docs 2024-07-15 14:52:08 -07:00
_types.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
cached_logo.jpg (feat) use hosted images for custom branding 2024-02-22 14:51:40 -08:00
caching_routes.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
custom_sso.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
enterprise feat(llama_guard.py): add llama guard support for content moderation + new async_moderation_hook endpoint 2024-02-17 19:13:04 -08:00
health_check.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
lambda.py
litellm_pre_call_utils.py Litellm dev 12 20 2024 p3 (#7339) 2024-12-20 21:13:32 -08:00
llamaguard_prompt.txt feat(llama_guard.py): allow user to define custom unsafe content categories 2024-02-17 17:42:47 -08:00
logo.jpg (feat) admin ui custom branding 2024-02-21 17:34:42 -08:00
model_config.yaml Revert "Revert "(feat) Allow using include to include external YAML files in a config.yaml (#6922)"" 2024-11-27 16:08:59 -08:00
openapi.json
post_call_rules.py (docs) add example post call rules to proxy 2024-01-15 20:58:50 -08:00
prisma_migration.py Litellm expose disable schema update flag (#6085) 2024-10-05 21:26:51 -04:00
proxy_cli.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
proxy_config.yaml (Admin UI) - Test Key Tab - Allow using UI Session instead of manually creating a virtual key (#7348) 2024-12-21 13:14:15 -08:00
proxy_server.py Litellm enforce enterprise features (#7357) 2024-12-21 19:14:13 -08:00
README.md [Feat-Proxy] Allow using custom sso handler (#5809) 2024-09-20 19:14:33 -07:00
route_llm_request.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
schema.prisma litellm db fixes LiteLLM_UserTable (#7089) 2024-12-07 19:08:37 -08:00
start.sh
utils.py (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -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