litellm/litellm/proxy
2024-04-18 11:13:05 -07:00
..
_experimental build(ui): add ui updates 2024-04-16 17:56:35 -07:00
auth fix(proxy_server.py): prevent non-admins from creating new keys 2024-04-16 11:22:02 -07:00
db
example_config_yaml
hooks feat(lowest_tpm_rpm_v2.py): move to using redis.incr and redis.mget for getting model usage from redis 2024-04-10 14:56:23 -07:00
proxy_load_test (fix) locust load test use uuid 2024-03-25 15:36:30 -07:00
queue
secret_managers
tests test -base64 cache hits 2024-04-10 16:46:56 -07:00
__init__.py
_new_secret_config.yaml fix(vertex_ai_anthropic.py): set vertex_credentials for vertex ai anthropic calls 2024-04-15 14:16:28 -07:00
_types.py add alert_types to config.yaml 2024-04-18 08:51:07 -07:00
.gitignore
admin_ui.py
cached_logo.jpg
custom_callbacks.py
enterprise
health_check.py test - /health endpoints 2024-04-13 10:09:18 -07:00
lambda.py
llamaguard_prompt.txt
logo.jpg
openapi.json
otel_config.yaml
post_call_rules.py
proxy_cli.py fix(proxy_cli.py): don't double load the router config 2024-04-10 13:23:56 -07:00
proxy_config.yaml Merge branch 'main' into litellm_fix_using_wildcard_openai_models_proxy 2024-04-15 14:35:06 -07:00
proxy_server.py ui - set alert_types 2024-04-18 11:13:05 -07:00
README.md
schema.prisma fix(proxy_server.py): allow mapping a user to an org 2024-04-08 20:45:11 -07:00
start.sh
utils.py feat return alert types on /config/get/callback 2024-04-17 21:02:10 -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.