{ "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 }