litellm/litellm/proxy
2024-05-13 10:10:44 -07:00
..
_experimental ui - new build 2024-05-11 15:58:55 -07:00
auth Merge pull request #3378 from duckboy81/patch-1 2024-05-10 10:07:36 -07:00
db (feat) stop eagerly evaluating fstring 2024-03-25 09:01:42 -07:00
example_config_yaml feat(bedrock_httpx.py): moves to using httpx client for bedrock cohere calls 2024-05-11 13:43:08 -07:00
hooks (Fix) - linting errors 2024-05-11 15:57:06 -07:00
proxy_load_test (fix) locust load test use uuid 2024-03-25 15:36:30 -07:00
queue
secret_managers fix(utils.py): initial commit for aws secret manager support 2024-03-16 14:37:46 -07:00
tests test -base64 cache hits 2024-04-10 16:46:56 -07:00
__init__.py
_new_secret_config.yaml fix(langfuse.py): fix langfuse environ check 2024-04-24 13:21:00 -07:00
_super_secret_config.yaml feat(router.py): allow setting model_region in litellm_params 2024-05-11 10:18:08 -07:00
_types.py fix(proxy/_types.py): allow jwt admin to access spend routes 2024-05-11 21:31:34 -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 feat(proxy_server.py): return litellm version in response headers 2024-05-08 16:00:08 -07:00
proxy_config.yaml edit dev config.yaml 2024-05-11 13:24:59 -07:00
proxy_server.py feat - show monthly spend reports 2024-05-13 10:10:44 -07:00
README.md
schema.prisma feat(proxy_server.py): add CRUD endpoints for 'end_user' management 2024-05-08 18:50:36 -07:00
start.sh
utils.py feat - send daily spend reports 2024-05-13 09:25:31 -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.