diff --git a/docs/my-website/docs/proxy_api.md b/docs/my-website/docs/proxy_api.md index 3f9fdbf63..e16d7f690 100644 --- a/docs/my-website/docs/proxy_api.md +++ b/docs/my-website/docs/proxy_api.md @@ -1,6 +1,8 @@ +import TokenGen from '../src/components/TokenGen.js' + # 🚨 LITELLM API (Access Claude-2/Llama2-70b/etc.) -This is an api built for the Open Interpreter community. It provides access to: +Use this if you're trying to add support for new LLMs and need access for testing: * OpenAI models * gpt-4 * gpt-3.5-turbo @@ -31,28 +33,30 @@ 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 +## Step 1: Save your LiteLLM API Key + +This is your unique LiteLLM API Key. Save this for later use. + + +## Step 2: Test a new LLM + +Now let's test if claude-2 is working in our code +``` +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"}] +# set env var +os.environ["ANTHROPIC_API_KEY"] = "sk-litellm-1234" # 👈 replace with your unique key -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) +messages = [{"role": "user", "content": "Hey, how's it going?"}] + +response = completion(model="claude-2", messages=messages) + +print(response) ``` -## In CodeInterpreter - +## For OpenInterpreter +This was initially built for the Open Interpreter community. If you're trying to use this feature in there, here's how you can do it: **Note**: You will need to clone and modify the Github repo, until [this PR is merged.](https://github.com/KillianLucas/open-interpreter/pull/288) ``` diff --git a/docs/my-website/package-lock.json b/docs/my-website/package-lock.json index 2fdb212c5..2befb74b0 100644 --- a/docs/my-website/package-lock.json +++ b/docs/my-website/package-lock.json @@ -18,7 +18,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "sharp": "^0.32.5", - "uuid": "^9.0.0" + "uuid": "^9.0.1" }, "devDependencies": { "@docusaurus/module-type-aliases": "2.4.1" @@ -12823,9 +12823,13 @@ } }, "node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } diff --git a/docs/my-website/package.json b/docs/my-website/package.json index 7c855b8bf..49b303034 100644 --- a/docs/my-website/package.json +++ b/docs/my-website/package.json @@ -24,7 +24,7 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "sharp": "^0.32.5", - "uuid": "^9.0.0" + "uuid": "^9.0.1" }, "devDependencies": { "@docusaurus/module-type-aliases": "2.4.1" diff --git a/docs/my-website/src/components/TokenGen.js b/docs/my-website/src/components/TokenGen.js new file mode 100644 index 000000000..1e89facc7 --- /dev/null +++ b/docs/my-website/src/components/TokenGen.js @@ -0,0 +1,34 @@ +import React, { useState, useEffect } from 'react'; +import {v4 as uuidv4} from 'uuid'; + +const CodeBlock = ({ token }) => { + const codeWithToken = `${token}`; + + return ( +
+      {token ? codeWithToken : ""}
+    
+ ); +}; + +const TokenGen = () => { + const [token, setToken] = useState(null); + + useEffect(() => { + const generateToken = () => { + // Generate a special uuid/token "sk-litellm-" + const newToken = `sk-litellm-${uuidv4()}`; + setToken(newToken); + }; + + generateToken(); + }, []); + + return ( +
+ +
+ ); +}; + +export default TokenGen; \ No newline at end of file diff --git a/docs/my-website/yarn.lock b/docs/my-website/yarn.lock index 6709b667b..12bd72c5e 100644 --- a/docs/my-website/yarn.lock +++ b/docs/my-website/yarn.lock @@ -7954,10 +7954,10 @@ uuid@^8.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^9.0.0: - version "9.0.0" - resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz" - integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== +uuid@^9.0.1: + version "9.0.1" + resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== value-equal@^1.0.1: version "1.0.1"