forked from phoenix/litellm-mirror
docs(virtual_keys.md): add enable/disable virtual keys to docs + refactor sidebar
This commit is contained in:
parent
b6bf994084
commit
16c8549b77
5 changed files with 66 additions and 30 deletions
|
@ -10,7 +10,7 @@ Track spend for keys, users, and teams across 100+ LLMs.
|
||||||
|
|
||||||
**Step 1**
|
**Step 1**
|
||||||
|
|
||||||
👉 [Setup LiteLLM with a Database](https://docs.litellm.ai/docs/proxy/deploy)
|
👉 [Setup LiteLLM with a Database](https://docs.litellm.ai/docs/proxy/virtual_keys#setup)
|
||||||
|
|
||||||
|
|
||||||
**Step2** Send `/chat/completions` request
|
**Step2** Send `/chat/completions` request
|
||||||
|
@ -151,7 +151,7 @@ Navigate to the Usage Tab on the LiteLLM UI (found on https://your-proxy-endpoin
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
## ✨ (Enterprise) API Endpoints to get Spend
|
## ✨ (Enterprise) API Endpoints to get Spend
|
||||||
#### Getting Spend Reports - To Charge Other Teams, Customers, Users
|
### Getting Spend Reports - To Charge Other Teams, Customers, Users
|
||||||
|
|
||||||
Use the `/global/spend/report` endpoint to get spend reports
|
Use the `/global/spend/report` endpoint to get spend reports
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ Use the `/global/spend/report` endpoint to get spend reports
|
||||||
|
|
||||||
<TabItem value="per team" label="Spend Per Team">
|
<TabItem value="per team" label="Spend Per Team">
|
||||||
|
|
||||||
##### Example Request
|
#### Example Request
|
||||||
|
|
||||||
👉 Key Change: Specify `group_by=team`
|
👉 Key Change: Specify `group_by=team`
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ curl -X GET 'http://localhost:4000/global/spend/report?start_date=2024-04-01&end
|
||||||
-H 'Authorization: Bearer sk-1234'
|
-H 'Authorization: Bearer sk-1234'
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Example Response
|
#### Example Response
|
||||||
<Tabs>
|
<Tabs>
|
||||||
|
|
||||||
<TabItem value="response" label="Expected Response">
|
<TabItem value="response" label="Expected Response">
|
||||||
|
@ -292,7 +292,7 @@ Customer This is the value of `user_id` passed when calling [`/key/generate`](ht
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
##### Example Request
|
#### Example Request
|
||||||
|
|
||||||
👉 Key Change: Specify `group_by=customer`
|
👉 Key Change: Specify `group_by=customer`
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ curl -X GET 'http://localhost:4000/global/spend/report?start_date=2024-04-01&end
|
||||||
-H 'Authorization: Bearer sk-1234'
|
-H 'Authorization: Bearer sk-1234'
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Example Response
|
#### Example Response
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
@ -359,7 +359,7 @@ curl -X GET 'http://localhost:4000/global/spend/report?start_date=2024-04-01&end
|
||||||
-H 'Authorization: Bearer sk-1234'
|
-H 'Authorization: Bearer sk-1234'
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Example Response
|
#### Example Response
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
@ -406,7 +406,7 @@ curl -X GET 'http://localhost:4000/global/spend/report?start_date=2024-04-01&end
|
||||||
-H 'Authorization: Bearer sk-1234'
|
-H 'Authorization: Bearer sk-1234'
|
||||||
```
|
```
|
||||||
|
|
||||||
##### Example Response
|
#### Example Response
|
||||||
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
@ -472,7 +472,7 @@ curl -X GET 'http://localhost:4000/global/spend/report?start_date=2024-04-01&end
|
||||||
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
#### Allowing Non-Proxy Admins to access `/spend` endpoints
|
### Allowing Non-Proxy Admins to access `/spend` endpoints
|
||||||
|
|
||||||
Use this when you want non-proxy admins to access `/spend` endpoints
|
Use this when you want non-proxy admins to access `/spend` endpoints
|
||||||
|
|
||||||
|
@ -572,7 +572,7 @@ model_list:
|
||||||
|
|
||||||
👉 Head to [Custom Input/Output Pricing](https://docs.litellm.ai/docs/proxy/custom_pricing) to setup custom pricing or your models
|
👉 Head to [Custom Input/Output Pricing](https://docs.litellm.ai/docs/proxy/custom_pricing) to setup custom pricing or your models
|
||||||
|
|
||||||
## ✨ Custom k,v pairs
|
## ✨ Custom Spend Log metadata
|
||||||
|
|
||||||
Log specific key,value pairs as part of the metadata for a spend log
|
Log specific key,value pairs as part of the metadata for a spend log
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# 🎉 Demo App
|
# Demo App
|
||||||
|
|
||||||
Here is a demo of the proxy. To log in pass in:
|
Here is a demo of the proxy. To log in pass in:
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Tabs from '@theme/Tabs';
|
import Tabs from '@theme/Tabs';
|
||||||
import TabItem from '@theme/TabItem';
|
import TabItem from '@theme/TabItem';
|
||||||
|
|
||||||
# 💡 Migrating from OpenAI (Langchain, OpenAI SDK, LlamaIndex, Instructor, Curl)
|
# Langchain, OpenAI SDK, LlamaIndex, Instructor, Curl examples
|
||||||
|
|
||||||
LiteLLM Proxy is **OpenAI-Compatible**, and supports:
|
LiteLLM Proxy is **OpenAI-Compatible**, and supports:
|
||||||
* /chat/completions
|
* /chat/completions
|
||||||
|
|
|
@ -598,6 +598,44 @@ client = openai.OpenAI(
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
|
### Enable/Disable Virtual Keys
|
||||||
|
|
||||||
|
**Disable Keys**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -L -X POST 'http://0.0.0.0:4000/key/block' \
|
||||||
|
-H 'Authorization: Bearer LITELLM_MASTER_KEY' \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{"key": "KEY-TO-BLOCK"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
Expected Response:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
{
|
||||||
|
...
|
||||||
|
"blocked": true
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Enable Keys**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -L -X POST 'http://0.0.0.0:4000/key/unblock' \
|
||||||
|
-H 'Authorization: Bearer LITELLM_MASTER_KEY' \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{"key": "KEY-TO-UNBLOCK"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
{
|
||||||
|
...
|
||||||
|
"blocked": false
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Custom Auth
|
### Custom Auth
|
||||||
|
|
||||||
You can now override the default api key auth.
|
You can now override the default api key auth.
|
||||||
|
|
|
@ -31,6 +31,7 @@ const sidebars = {
|
||||||
"proxy/quick_start",
|
"proxy/quick_start",
|
||||||
"proxy/docker_quick_start",
|
"proxy/docker_quick_start",
|
||||||
"proxy/deploy",
|
"proxy/deploy",
|
||||||
|
"proxy/demo",
|
||||||
"proxy/prod",
|
"proxy/prod",
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
|
@ -44,9 +45,23 @@ const sidebars = {
|
||||||
},
|
},
|
||||||
"proxy/enterprise",
|
"proxy/enterprise",
|
||||||
"proxy/user_keys",
|
"proxy/user_keys",
|
||||||
"proxy/demo",
|
|
||||||
"proxy/configs",
|
"proxy/configs",
|
||||||
"proxy/reliability",
|
"proxy/reliability",
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
label: "🔑 Authentication",
|
||||||
|
items: ["proxy/virtual_keys", "proxy/token_auth", "proxy/oauth2"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
label: "💸 Spend Tracking + Budgets",
|
||||||
|
items: ["proxy/cost_tracking", "proxy/users", "proxy/custom_pricing", "proxy/team_budgets", "proxy/billing", "proxy/customers"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
label: "Routing",
|
||||||
|
items: ["proxy/load_balancing", "proxy/tag_routing", "proxy/team_based_routing", "proxy/customer_routing",],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
label: "Use with Provider SDKs",
|
label: "Use with Provider SDKs",
|
||||||
|
@ -59,9 +74,6 @@ const sidebars = {
|
||||||
"pass_through/langfuse"
|
"pass_through/langfuse"
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"proxy/cost_tracking",
|
|
||||||
"proxy/custom_pricing",
|
|
||||||
"proxy/virtual_keys",
|
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
label: "Admin UI",
|
label: "Admin UI",
|
||||||
|
@ -94,24 +106,10 @@ const sidebars = {
|
||||||
"oidc"
|
"oidc"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"proxy/tag_routing",
|
|
||||||
"proxy/users",
|
|
||||||
"proxy/team_budgets",
|
|
||||||
"proxy/customers",
|
|
||||||
"proxy/billing",
|
|
||||||
"proxy/token_auth",
|
|
||||||
"proxy/oauth2",
|
|
||||||
"proxy/caching",
|
"proxy/caching",
|
||||||
"proxy/pass_through",
|
"proxy/pass_through",
|
||||||
"proxy/email",
|
"proxy/email",
|
||||||
"proxy/multiple_admins",
|
"proxy/multiple_admins",
|
||||||
"proxy/team_based_routing",
|
|
||||||
"proxy/customer_routing",
|
|
||||||
{
|
|
||||||
type: "category",
|
|
||||||
label: "Extra Load Balancing",
|
|
||||||
items: ["proxy/load_balancing"],
|
|
||||||
},
|
|
||||||
"proxy/model_management",
|
"proxy/model_management",
|
||||||
"proxy/health",
|
"proxy/health",
|
||||||
"proxy/debugging",
|
"proxy/debugging",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue