litellm-mirror/litellm/proxy
2024-03-21 09:57:10 -07:00
..
_experimental (feat) new ui build 2024-03-19 13:06:30 -07:00
auth fix(handle_jwt.py): track spend for user using jwt auth 2024-03-20 10:55:52 -07:00
db (fix) dynamo db test - new model_spend params 2024-02-17 19:13:04 -08:00
example_config_yaml v0 using custom_key_generate 2024-01-20 08:39:52 -08:00
hooks fix(prompt_injection_detection.py): fix type check 2024-03-21 08:56:13 -07:00
proxy_load_test (fix) locustfile used in load test 2024-03-15 12:38:37 -07:00
queue refactor: add black formatting 2023-12-25 14:11:20 +05:30
secret_managers fix(utils.py): initial commit for aws secret manager support 2024-03-16 14:37:46 -07:00
tests fix(proxy/utils.py): batch writing updates to db 2024-03-18 16:47:02 -07: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
_new_secret_config.yaml fix(proxy/utils.py): move to batch writing db updates 2024-03-16 22:32:00 -07:00
_types.py Merge branch 'main' into litellm_llm_api_prompt_injection_check 2024-03-21 09:57:10 -07:00
admin_ui.py (feat) use cli args to start streamlit 2024-01-23 15:58:14 -08:00
cached_logo.jpg (feat) use hosted images for custom branding 2024-02-22 14:51:40 -08:00
custom_callbacks.py (feat) fix custom handler bug 2024-02-28 14:48:55 -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 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
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
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 (feat) start proxy with default num_workers=1 2024-03-20 10:46:32 -07:00
proxy_config.yaml (fix) include prom endpoint 2024-03-19 17:30:07 -07:00
proxy_server.py Merge branch 'main' into litellm_llm_api_prompt_injection_check 2024-03-21 09:57:10 -07:00
README.md (docs) update readme proxy server 2023-11-17 17:40:44 -08:00
schema.prisma fix(blocked_user_list.py): check if end user blocked in db 2024-03-16 13:03:52 -07: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(proxy_server.py): enable llm api based prompt injection checks 2024-03-20 22:43:42 -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.