mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-08 10:21:43 +00:00
docs
This commit is contained in:
@@ -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'
|
||||
```
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user