This commit is contained in:
ishaan-jaff
2023-09-16 12:59:08 -07:00
parent 121d378719
commit ed94410ef5
+17 -22
View File
@@ -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'
```
```