diff --git a/docs/my-website/docs/budget_manager.md b/docs/my-website/docs/budget_manager.md index 059daba3c..2a3b25b8e 100644 --- a/docs/my-website/docs/budget_manager.md +++ b/docs/my-website/docs/budget_manager.md @@ -1,7 +1,7 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# 💸 API Budget Manager +# Budget Manager Don't want to get crazy bills because either while you're calling LLM APIs **or** while your users are calling them? use this. diff --git a/docs/my-website/docs/proxy_api.md b/docs/my-website/docs/proxy_api.md index 674d42ef9..31cb93ea5 100644 --- a/docs/my-website/docs/proxy_api.md +++ b/docs/my-website/docs/proxy_api.md @@ -1,4 +1,4 @@ -# Open Interpreter LLM API +# ⚡️ LITELLM API (Access Claude-2/Llama2-70b/etc.) This is an api built for the Open Interpreter community. It provides access to: * OpenAI models @@ -31,16 +31,38 @@ This is an api built for the Open Interpreter community. It provides access to: Here's how to call it: +## Through LiteLLM +```python +from litellm import completion +import os +## set ENV variables +os.environ["OPENAI_API_KEY"] = "litellm-api-key" + +messages = [{ "content": "Hello, how are you?","role": "user"}] + +response = completion( + model="command-nightly", + messages=[{ "content": "Hello, how are you?","role": "user"}], + api_base="https://proxy.litellm.ai", + custom_llm_provider="openai", + temperature=0.2, + max_tokens=80, +) +print(response) +``` + +## In CodeInterpreter + **Note**: You will need to clone and modify the Github repo, until [this PR is merged.](https://github.com/KillianLucas/open-interpreter/pull/288) In `interpreter.py` set, -``` +```python os.environ["OPENAI_API_KEY"] = "openinterpreter-key" litellm.api_base = "https://proxy.litellm.ai" ``` and change the model on [this line](https://github.com/KillianLucas/open-interpreter/blob/f803d0d7a545edabd541943145a2a60beaf604e4/interpreter/interpreter.py#L342C10-L342C10), to: -``` +```python self.model = "openai/gpt-4" # 👈 always add 'openai/' in front of the model name ```