mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
update docs for hosted litellm
This commit is contained in:
parent
22ce31a4f4
commit
f3a42086d4
2 changed files with 27 additions and 15 deletions
|
@ -18,30 +18,42 @@ See our live dashboard 👉 [admin.litellm.ai](https://admin.litellm.ai/)
|
||||||
- By setting it as an environment variable - `os.environ["LITELLM_EMAIL"] = "your_email"`.
|
- By setting it as an environment variable - `os.environ["LITELLM_EMAIL"] = "your_email"`.
|
||||||
|
|
||||||
## Code Setup
|
## Code Setup
|
||||||
```python
|
|
||||||
import litellm
|
|
||||||
|
|
||||||
## Setup for activating / using the litellm dashboard
|
|
||||||
litellm.email = "test_email@test.com"
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
## Calling Completion() with the LiteLLM Dashboard
|
|
||||||
```python
|
```python
|
||||||
import litellm
|
import litellm
|
||||||
from litellm import completion
|
|
||||||
|
|
||||||
## Setup for activating / using the litellm dashboard
|
## Setup for activating / using the litellm dashboard
|
||||||
litellm.email = "test_email@test.com"
|
litellm.email = "test_email@test.com"
|
||||||
|
|
||||||
user_message = "Hello, how are you?"
|
```
|
||||||
messages = [{ "content": user_message,"role": "user"}]
|
|
||||||
|
|
||||||
|
## Using LiteLLM Dashboard - Add New LLMs
|
||||||
|
LiteLLM allows you to add a new model using the liteLLM Dashboard
|
||||||
|
Go to `admin.litellm.ai/<your_email>`
|
||||||
|
Navigate to the 'Add New LLM' Section
|
||||||
|
<Image img={require('../../img/add_model.png')} alt="Dashboard" />
|
||||||
|
- Select Provider
|
||||||
|
- Select your LLM
|
||||||
|
- Add your LLM Key
|
||||||
|
|
||||||
|
### Using your new LLM - Completion() with the LiteLLM Dashboard
|
||||||
|
```python
|
||||||
|
from litellm import embedding, completion
|
||||||
|
# keys set in admin.litellm.ai/<your_email> or .env OPENAI_API_KEY
|
||||||
|
messages = [{ "content": "Hello, how are you?" ,"role": "user"}]
|
||||||
|
|
||||||
# openai call
|
# openai call
|
||||||
response = completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}])
|
response = completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}])
|
||||||
|
```
|
||||||
|
|
||||||
# bad request call
|
## Using LiteLLM Dashboard - Debug your Call Logs
|
||||||
response = completion(model="chatgpt-test", messages=[{"role": "user", "content": "Hi 👋 - i'm a bad request"}])
|
|
||||||
|
|
||||||
```
|
```python
|
||||||
|
from litellm import embedding, completion
|
||||||
|
# keys set in admin.litellm.ai/<your_email> or .env OPENAI_API_KEY
|
||||||
|
messages = [{ "content": "Hello, how are you?" ,"role": "user"}]
|
||||||
|
|
||||||
|
# openai call
|
||||||
|
response = completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}])
|
||||||
|
```
|
||||||
|
|
||||||
|
See your Logs below
|
BIN
docs/my-website/img/add_model.png
Normal file
BIN
docs/my-website/img/add_model.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Loading…
Add table
Add a link
Reference in a new issue