Add Docs For SGLang Native Router (#2308)

This commit is contained in:
Chayenne
2024-12-04 15:41:22 -08:00
committed by GitHub
parent 786be44da5
commit 18ea841f40
3 changed files with 121 additions and 72 deletions

View File

@@ -177,18 +177,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'The World Health Organization formally declared an end to the COVID-19 global health emergency'"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"@trace\n",
"def rag_pipeline(question: str) -> str:\n",
@@ -307,18 +296,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'The World Health Organization formally declared an end to the COVID-19 global health emergency in May 2023.'"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"@trace\n",
"def rag_pipeline(question: str) -> str:\n",
@@ -355,15 +333,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: nest-asyncio in /Users/joschkabraun/miniconda3/envs/sglang/lib/python3.10/site-packages (1.6.0)\r\n"
]
}
],
"outputs": [],
"source": [
"!pip install nest-asyncio\n",
"import nest_asyncio\n",
@@ -382,45 +352,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Run name set to: sneak-weal, since a name was not provided.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 100/100 [00:27<00:00, 3.63it/s]\n",
"Waiting for evaluations to finish: 100%|██████████| 19/19 [00:10<00:00, 1.89it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Experiment RAG Run sneak-weal stats:\n",
"{\n",
" \"latency\": \"2.69\",\n",
" \"input_tokens\": \"61.26\",\n",
" \"output_tokens\": \"75.88\",\n",
" \"total_tokens\": \"137.14\",\n",
" \"cost\": \"0.00\",\n",
" \"answer_context_faithfulness_statement_level\": \"0.26\",\n",
" \"answer_matches_target_llm_grader\": \"0.22\",\n",
" \"context_query_relevancy\": \"0.27\",\n",
" \"percent_target_supported_by_context\": \"0.40\"\n",
"}\n",
"\n",
"\n",
"View experiment & traces at: https://app.parea.ai/experiments/RAG/30f0244a-d56c-44ff-bdfb-8f47626304b6\n",
"\n"
]
}
],
"outputs": [],
"source": [
"e = p.experiment(\n",
" \"RAG\",\n",