mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
* feat: add new model provider Novita AI * feat: use deepseek r1 model for examples in Novita AI docs * fix: fix tests * fix: fix tests for novita * fix: fix novita transformation
97 lines
2.1 KiB
Text
Vendored
97 lines
2.1 KiB
Text
Vendored
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {
|
|
"id": "iFEmsVJI_2BR"
|
|
},
|
|
"source": [
|
|
"# LiteLLM NovitaAI Cookbook"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"id": "cBlUhCEP_xj4"
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"!pip install litellm"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"id": "p-MQqWOT_1a7"
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"import os\n",
|
|
"\n",
|
|
"os.environ['NOVITA_API_KEY'] = \"\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"id": "Ze8JqMqWAARO"
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"from litellm import completion\n",
|
|
"response = completion(\n",
|
|
" model=\"novita/deepseek/deepseek-r1\",\n",
|
|
" messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n",
|
|
")\n",
|
|
"response"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"id": "-LnhELrnAM_J"
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"response = completion(\n",
|
|
" model=\"novita/deepseek/deepseek-r1\",\n",
|
|
" messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n",
|
|
")\n",
|
|
"response"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {
|
|
"id": "dJBOUYdwCEn1"
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"response = completion(\n",
|
|
" model=\"mistralai/mistral-7b-instruct\",\n",
|
|
" messages=[{\"role\": \"user\", \"content\": \"write code for saying hi\"}]\n",
|
|
")\n",
|
|
"response"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"colab": {
|
|
"provenance": []
|
|
},
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"name": "python"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 0
|
|
}
|