litellm-mirror/litellm/proxy
2024-02-05 22:40:52 -08:00
..
_experimental (feat) new ui build 2024-02-03 18:53:05 -08:00
db (fix) patch -For DynamoDB Backwards Compatibility 2024-01-29 16:52:31 -08:00
example_config_yaml v0 using custom_key_generate 2024-01-20 08:39:52 -08:00
hooks fix(utils.py): override default success callbacks with dynamic callbacks if set 2024-02-02 06:21:43 -08:00
queue refactor: add black formatting 2023-12-25 14:11:20 +05:30
secret_managers fix(google_kms.py): support enums for key management system 2023-12-27 13:19:33 +05:30
tests (fix) proxy - streaming sagemaker 2024-01-23 11:12:16 -08:00
.gitignore fix(gitmodules): remapping to new proxy 2023-10-12 21:23:53 -07:00
__init__.py refactor: add black formatting 2023-12-25 14:11:20 +05:30
_types.py (feat) update max_budget in /user/update 2024-02-03 14:12:18 -08:00
admin_ui.py (feat) use cli args to start streamlit 2024-01-23 15:58:14 -08:00
health_check.py feat(health_check.py): more detailed health check calls 2023-12-28 09:12:57 +05:30
lambda.py Add mangum. 2023-11-23 00:04:47 -05:00
openapi.json (feat) add swagger.json for litellm proxy 2023-10-13 20:41:04 -07:00
otel_config.yaml (feat) proxy: otel logging 2023-12-01 21:04:08 -08:00
post_call_rules.py (docs) add example post call rules to proxy 2024-01-15 20:58:50 -08:00
proxy_cli.py Merge branch 'main' into litellm_embedding_caching_updates 2024-02-03 18:08:47 -08:00
proxy_config.yaml (feat) proxy - upperbound params /key/generate 2024-02-05 22:40:52 -08:00
proxy_server.py (feat) upperbound_key_generate_params 2024-02-05 22:38:47 -08:00
README.md (docs) update readme proxy server 2023-11-17 17:40:44 -08:00
schema.prisma (feat) set user_role for Users 2024-02-03 10:23:50 -08:00
start.sh fix(factory.py): fixing llama-2 non-chat models prompt templating 2023-11-07 21:33:54 -08:00
utils.py feat(utils.py): support cost tracking for openai/azure image gen models 2024-02-03 17:09:54 -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.