docs(token_usage.md): adding registering model via url to docs

This commit is contained in:
Krrish Dholakia 2023-10-24 16:21:31 -07:00
parent b3dc1eccc3
commit 59ddda5c4b

View file

@ -145,8 +145,10 @@ print(model_cost) # {'gpt-3.5-turbo': {'max_tokens': 4000, 'input_cost_per_token
### 8. `register_model` ### 8. `register_model`
* Input: Provide EITHER a model cost dictionary or a url to a hosted json blob
* Output: Returns updated model_cost dictionary + updates litellm.model_cost with model details. * Output: Returns updated model_cost dictionary + updates litellm.model_cost with model details.
**Dictionary**
```python ```python
from litellm import register_model from litellm import register_model
@ -161,6 +163,14 @@ litellm.register_model({
}) })
``` ```
**URL for json blob**
```python
import litellm
litellm.register_model(model_cost=
"https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json")
```
### 9. `api.litellm.ai` ### 9. `api.litellm.ai`
**Example Curl Request** **Example Curl Request**