From 73487d59100a2e810cd15e494d34366fbf0c208d Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 26 Sep 2023 14:41:53 -0700 Subject: [PATCH] add proxy server to docs --- docs/my-website/docs/proxy_server.md | 34 +++++++++++++++++++ docs/my-website/sidebars.js | 2 +- litellm/__pycache__/__init__.cpython-311.pyc | Bin 11835 -> 11835 bytes litellm/__pycache__/utils.cpython-311.pyc | Bin 134277 -> 134277 bytes 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 docs/my-website/docs/proxy_server.md diff --git a/docs/my-website/docs/proxy_server.md b/docs/my-website/docs/proxy_server.md new file mode 100644 index 000000000..2d5c801b4 --- /dev/null +++ b/docs/my-website/docs/proxy_server.md @@ -0,0 +1,34 @@ +# OpenAI Proxy Server + +Use this to spin up a proxy api to translate openai api calls to any non-openai model (e.g. Huggingface, TogetherAI, Ollama, etc.) + +This works for async + streaming as well. + +## usage +```python +pip install litellm +``` + +```python +litellm --model +``` + +This will host a local proxy api at : **http://localhost:8000** + +[**Jump to Code**](https://github.com/BerriAI/litellm/blob/fef4146396d5d87006259e00095a62e3900d6bb4/litellm/proxy.py#L36) +## test it + +```curl +curl --location 'http://0.0.0.0:8000/chat/completions' \ +--header 'Content-Type: application/json' \ +--data '{ + "model": "gpt-3.5-turbo", + "messages": [ + { + "role": "user", + "content": "what do you know?" + } + ], +}' +``` + diff --git a/docs/my-website/sidebars.js b/docs/my-website/sidebars.js index 0c8750a47..15a6918bf 100644 --- a/docs/my-website/sidebars.js +++ b/docs/my-website/sidebars.js @@ -83,7 +83,7 @@ const sidebars = { "exception_mapping", 'debugging/local_debugging', "budget_manager", - "proxy_api", + "proxy_server", { type: 'category', label: 'Tutorials', diff --git a/litellm/__pycache__/__init__.cpython-311.pyc b/litellm/__pycache__/__init__.cpython-311.pyc index 240bff6fbcbbb1d419021cdea54ef902b79e61df..5a6b2ad79aadf2cd0fde83bc0ac3a15901e40d6f 100644 GIT binary patch delta 19 ZcmdlTvpa@sIWI340}zzkZ{#x60{}UB1k?Zk delta 19 ZcmdlTvpa@sIWI340}%LHZ{#x60{}Q_1f~E0 diff --git a/litellm/__pycache__/utils.cpython-311.pyc b/litellm/__pycache__/utils.cpython-311.pyc index e5918250d769aa3fdd18549beebcd1beaa9f603d..2b97701e7bcc7af005f12f7dfc89def12a13727e 100644 GIT binary patch delta 27 hcmZpj$