"examples/vscode:/vscode.git/clone" did not exist on "56e18dc3c1877b990c97425263fbfdb5def80880"
quick-start.ipynb 2.44 KB
Newer Older
Meenakshi Sharma's avatar
Meenakshi Sharma committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4ac805ba-ce88-423f-bf3a-d8b2e0ef3a71",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Quick Start Guide for Dynamo in Jupyter Notebook\n",
    "\n",
    "# ## Installation\n",
    "\n",
    "# The following steps will install necessary system packages, \n",
    "# set up a virtual environment using `uv`, and install the `abc` package.\n",
    "\n",
    "import os\n",
    "\n",
    "# Install system-level dependencies\n",
    "print(\"Updating package lists and installing required system packages...\")\n",
    "os.system(\"apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq python3-dev curl libucx0\")\n",
    "\n",
    "# Install uv package manager\n",
    "print(\"Installing uv package manager...\")\n",
    "os.system(\"curl -LsSf https://astral.sh/uv/install.sh | sh\")\n",
    "os.system(\"source $HOME/.local/bin/env\")\n",
    "\n",
    "# Create and activate a virtual environment for ABC\n",
    "print(\"Setting up virtual environment...\")\n",
    "os.system(\"uv venv dynamo-venv\")\n",
    "os.system(\"source dynamo-venv/bin/activate\")\n",
    "\n",
    "# Install the Dynamo package with all dependencies\n",
    "print(\"Installing Dynamo package...\")\n",
    "os.system(\"uv pip install ai-dynamo[all]\")\n",
    "\n",
    "# ## Running and Interacting with an LLM Locally\n",
    "\n",
    "# To run a model and interact with it locally, we use `dynamo run` with a Hugging Face model.\n",
    "# Dynamo supports several backends, including: mistralrs, sglang, vllm, and tensorrtllm.\n",
    "\n",
    "# Example command to run a model\n",
    "model_name = \"deepseek-ai/DeepSeek-R1-Distill-Llama-8B\"\n",
    "backend = \"vllm\"\n",
    "command = f\"dynamo run out={backend} {model_name}\"\n",
    "\n",
    "print(f\"Running the model with: {command}\")\n",
    "os.system(command)\n",
    "\n",
    "# Once launched, you'll be able to chat directly with the model from the command line.\n",
    "\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}