mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
docs
This commit is contained in:
parent
121d378719
commit
ed94410ef5
1 changed files with 17 additions and 22 deletions
|
|
@ -4,30 +4,25 @@ For every LLM LiteLLM allows you to:
|
|||
* Get model context window
|
||||
* Get cost per token
|
||||
|
||||
## LiteLLM API api.litellm.ai
|
||||
Usage
|
||||
```curl
|
||||
curl 'https://api.litellm.ai/get_max_tokens?model=claude-2'
|
||||
```
|
||||
|
||||
### Output
|
||||
```json
|
||||
{
|
||||
"input_cost_per_token": 1.102e-05,
|
||||
"max_tokens": 100000,
|
||||
"model": "claude-2",
|
||||
"output_cost_per_token": 3.268e-05
|
||||
}
|
||||
```
|
||||
|
||||
## LiteLLM Package
|
||||
Usage
|
||||
```python
|
||||
import litellm
|
||||
model_data = litellm.model_cost["gpt-4"]
|
||||
```
|
||||
|
||||
## LiteLLM API api.litellm.ai
|
||||
Usage
|
||||
```python
|
||||
import requests
|
||||
|
||||
url = "https://api.litellm.ai/get_max_tokens?model=claude-2"
|
||||
|
||||
response = requests.request("GET", url)
|
||||
|
||||
print(response.text)
|
||||
```
|
||||
|
||||
```curl
|
||||
curl 'https://api.litellm.ai/get_max_tokens?model=gpt-3.5-turbo'
|
||||
```
|
||||
|
||||
```curl
|
||||
curl 'https://api.litellm.ai/get_max_tokens?model=claude-2'
|
||||
```
|
||||
|
||||
```
|
||||
Loading…
Add table
Reference in a new issue