Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -43,15 +43,18 @@ As is, CARROT supports routing to the following collection of large language mod
|
|
| 43 |
|
| 44 |
<div class="p-4 bg-gray-100 rounded-lg shadow-md">
|
| 45 |
<p><strong>Example: Using CARROT for Routing</strong></p>
|
| 46 |
-
|
|
|
|
| 47 |
import carrot_router
|
| 48 |
|
|
|
|
| 49 |
router = carrot_router.Router()
|
| 50 |
|
|
|
|
| 51 |
query = "What are the latest advancements in AI?"
|
| 52 |
|
|
|
|
| 53 |
best_model = router.route(query)
|
| 54 |
|
| 55 |
print(f"Recommended Model: {best_model}")
|
| 56 |
-
|
| 57 |
-
</div>
|
|
|
|
| 43 |
|
| 44 |
<div class="p-4 bg-gray-100 rounded-lg shadow-md">
|
| 45 |
<p><strong>Example: Using CARROT for Routing</strong></p>
|
| 46 |
+
|
| 47 |
+
```python
|
| 48 |
import carrot_router
|
| 49 |
|
| 50 |
+
# Initialize the router
|
| 51 |
router = carrot_router.Router()
|
| 52 |
|
| 53 |
+
# Define a query
|
| 54 |
query = "What are the latest advancements in AI?"
|
| 55 |
|
| 56 |
+
# Get the best model for cost-performance tradeoff
|
| 57 |
best_model = router.route(query)
|
| 58 |
|
| 59 |
print(f"Recommended Model: {best_model}")
|
| 60 |
+
</div> ```
|
|
|