From febb163850b2dd68abc45b49125d76f82bf3da3a Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 7 Nov 2023 17:24:47 -0800 Subject: [PATCH] (docs) proxy server openai api base --- docs/my-website/docs/simple_proxy.md | 31 +++++++--------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/docs/my-website/docs/simple_proxy.md b/docs/my-website/docs/simple_proxy.md index 7249f7e76c..5c37dd779e 100644 --- a/docs/my-website/docs/simple_proxy.md +++ b/docs/my-website/docs/simple_proxy.md @@ -25,29 +25,14 @@ litellm --test This will now automatically route any requests for gpt-3.5-turbo to bigcode starcoder, hosted on huggingface inference endpoints. -#### Output -```json -{ - "object": "chat.completion", - "choices": [ - { - "finish_reason": "length", - "index": 0, - "message": { - "content": ", and create a new test page.\n\n### Test data\n\n- A user named", - "role": "assistant" - } - } - ], - "id": "chatcmpl-56634359-d4ce-4dbc-972c-86a640e3a5d8", - "created": 1699308314.054251, - "model": "huggingface/bigcode/starcoder", - "usage": { - "completion_tokens": 16, - "prompt_tokens": 10, - "total_tokens": 26 - } -} +### Replace openai base + +```python +import openai + +openai.api_base = "http://0.0.0.0:8000" + +print(openai.ChatCompletion.create(model="test", messages=[{"role":"user", "content":"Hey!"}])) ``` ### Supported LLMs