Continuous Batching

Sohu runs inference in batches. Generally LLMs run inference in batches already. They’ll load up the weights one time and run a forward pass on as many sequences as it possibly can. There’s generally a few ways this is done: static batching and continuous batching.

In static batching, we’ll process say 4 sequences at a time.

LLM Inference Diagram.png

The obvious problem here is that sequences don’t all end at the same time. S_2 finished significantly faster than S_4, so we’re wasting compute.

But with continuous batching, as soon as one sequence finishes processing, a new sequence will take its place. Let’s watch it happen in real time:

# Don't forget to run this cell!! It might take a while
!pip install https://storage.googleapis.com/etched-blitz/etched_blitz-0.0.1-cp310-cp310-manylinux1_x86_64.whl
!pip install aiofiles
Collecting etched-blitz==0.0.1
  Using cached https://storage.googleapis.com/etched-blitz/etched_blitz-0.0.1-cp310-cp310-manylinux1_x86_64.whl (178.3 MB)
Collecting cmake>=3.21 (from etched-blitz==0.0.1)
  Using cached cmake-3.30.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.1 kB)
Collecting ninja (from etched-blitz==0.0.1)
  Using cached ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl.metadata (5.3 kB)
Requirement already satisfied: psutil in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from etched-blitz==0.0.1) (6.0.0)
Collecting sentencepiece (from etched-blitz==0.0.1)
  Using cached sentencepiece-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.7 kB)
Requirement already satisfied: numpy<2.0.0 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from etched-blitz==0.0.1) (1.26.4)
Requirement already satisfied: requests in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from etched-blitz==0.0.1) (2.32.2)
Collecting tqdm (from etched-blitz==0.0.1)
  Using cached tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
Collecting py-cpuinfo (from etched-blitz==0.0.1)
  Using cached py_cpuinfo-9.0.0-py3-none-any.whl.metadata (794 bytes)
Collecting transformers>=4.40.0 (from etched-blitz==0.0.1)
  Using cached transformers-4.42.3-py3-none-any.whl.metadata (43 kB)
Collecting tokenizers>=0.19.1 (from etched-blitz==0.0.1)
  Using cached tokenizers-0.19.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.7 kB)
Collecting fastapi (from etched-blitz==0.0.1)
  Using cached fastapi-0.111.0-py3-none-any.whl.metadata (25 kB)
Collecting aiohttp (from etched-blitz==0.0.1)
  Using cached aiohttp-3.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.5 kB)
Collecting openai (from etched-blitz==0.0.1)
  Using cached openai-1.35.9-py3-none-any.whl.metadata (21 kB)
Collecting uvicorn[standard] (from etched-blitz==0.0.1)
  Using cached uvicorn-0.30.1-py3-none-any.whl.metadata (6.3 kB)
Collecting pydantic>=2.0 (from etched-blitz==0.0.1)
  Using cached pydantic-2.8.0-py3-none-any.whl.metadata (123 kB)
Requirement already satisfied: pillow in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from etched-blitz==0.0.1) (10.3.0)
Collecting prometheus-client>=0.18.0 (from etched-blitz==0.0.1)
  Using cached prometheus_client-0.20.0-py3-none-any.whl.metadata (1.8 kB)
Collecting prometheus-fastapi-instrumentator>=7.0.0 (from etched-blitz==0.0.1)
  Using cached prometheus_fastapi_instrumentator-7.0.0-py3-none-any.whl.metadata (13 kB)
Collecting tiktoken>=0.6.0 (from etched-blitz==0.0.1)
  Using cached tiktoken-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)
Collecting lm-format-enforcer==0.10.1 (from etched-blitz==0.0.1)
  Using cached lm_format_enforcer-0.10.1-py3-none-any.whl.metadata (16 kB)
Collecting outlines>=0.0.43 (from etched-blitz==0.0.1)
  Using cached outlines-0.0.46-py3-none-any.whl.metadata (15 kB)
Requirement already satisfied: typing-extensions in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from etched-blitz==0.0.1) (4.11.0)
Requirement already satisfied: filelock>=3.10.4 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from etched-blitz==0.0.1) (3.13.1)
Collecting ray>=2.9 (from etched-blitz==0.0.1)
  Using cached ray-2.31.0-cp310-cp310-manylinux2014_x86_64.whl.metadata (13 kB)
Collecting nvidia-ml-py (from etched-blitz==0.0.1)
  Using cached nvidia_ml_py-12.555.43-py3-none-any.whl.metadata (8.6 kB)
Requirement already satisfied: torch==2.3.0 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from etched-blitz==0.0.1) (2.3.0)
Requirement already satisfied: torchvision==0.18.0 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from etched-blitz==0.0.1) (0.18.0)
Collecting xformers==0.0.26.post1 (from etched-blitz==0.0.1)
  Using cached xformers-0.0.26.post1-cp310-cp310-manylinux2014_x86_64.whl.metadata (1.0 kB)
Collecting vllm-flash-attn==2.5.9 (from etched-blitz==0.0.1)
  Using cached vllm_flash_attn-2.5.9-cp310-cp310-manylinux1_x86_64.whl.metadata (476 bytes)
Collecting interegular>=0.3.2 (from lm-format-enforcer==0.10.1->etched-blitz==0.0.1)
  Using cached interegular-0.3.3-py37-none-any.whl.metadata (3.0 kB)
Requirement already satisfied: packaging in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from lm-format-enforcer==0.10.1->etched-blitz==0.0.1) (24.1)
Requirement already satisfied: pyyaml in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from lm-format-enforcer==0.10.1->etched-blitz==0.0.1) (6.0.1)
Requirement already satisfied: sympy in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from torch==2.3.0->etched-blitz==0.0.1) (1.12)
Requirement already satisfied: networkx in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from torch==2.3.0->etched-blitz==0.0.1) (3.3)
Requirement already satisfied: jinja2 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from torch==2.3.0->etched-blitz==0.0.1) (3.1.4)
Collecting fsspec (from torch==2.3.0->etched-blitz==0.0.1)
  Using cached fsspec-2024.6.1-py3-none-any.whl.metadata (11 kB)
Collecting lark (from outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached lark-1.1.9-py3-none-any.whl.metadata (1.9 kB)
Requirement already satisfied: nest-asyncio in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from outlines>=0.0.43->etched-blitz==0.0.1) (1.6.0)
Collecting cloudpickle (from outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached cloudpickle-3.0.0-py3-none-any.whl.metadata (7.0 kB)
Collecting diskcache (from outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached diskcache-5.6.3-py3-none-any.whl.metadata (20 kB)
Collecting numba (from outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached numba-0.60.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.7 kB)
Requirement already satisfied: referencing in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from outlines>=0.0.43->etched-blitz==0.0.1) (0.35.1)
Requirement already satisfied: jsonschema in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from outlines>=0.0.43->etched-blitz==0.0.1) (4.22.0)
Collecting datasets (from outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached datasets-2.20.0-py3-none-any.whl.metadata (19 kB)
Collecting pycountry (from outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached pycountry-24.6.1-py3-none-any.whl.metadata (12 kB)
Collecting pyairports (from outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached pyairports-2.1.1-py3-none-any.whl.metadata (1.7 kB)
Collecting starlette<1.0.0,>=0.30.0 (from prometheus-fastapi-instrumentator>=7.0.0->etched-blitz==0.0.1)
  Using cached starlette-0.37.2-py3-none-any.whl.metadata (5.9 kB)
Collecting annotated-types>=0.4.0 (from pydantic>=2.0->etched-blitz==0.0.1)
  Using cached annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB)
Collecting pydantic-core==2.20.0 (from pydantic>=2.0->etched-blitz==0.0.1)
  Using cached pydantic_core-2.20.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)
Requirement already satisfied: click>=7.0 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from ray>=2.9->etched-blitz==0.0.1) (8.1.7)
Collecting msgpack<2.0.0,>=1.0.0 (from ray>=2.9->etched-blitz==0.0.1)
  Using cached msgpack-1.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.1 kB)
Collecting protobuf!=3.19.5,>=3.15.3 (from ray>=2.9->etched-blitz==0.0.1)
  Using cached protobuf-5.27.2-cp38-abi3-manylinux2014_x86_64.whl.metadata (592 bytes)
Collecting aiosignal (from ray>=2.9->etched-blitz==0.0.1)
  Using cached aiosignal-1.3.1-py3-none-any.whl.metadata (4.0 kB)
Collecting frozenlist (from ray>=2.9->etched-blitz==0.0.1)
  Using cached frozenlist-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)
Collecting regex>=2022.1.18 (from tiktoken>=0.6.0->etched-blitz==0.0.1)
  Using cached regex-2024.5.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (40 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from requests->etched-blitz==0.0.1) (2.0.4)
Requirement already satisfied: idna<4,>=2.5 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from requests->etched-blitz==0.0.1) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from requests->etched-blitz==0.0.1) (2.2.2)
Requirement already satisfied: certifi>=2017.4.17 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from requests->etched-blitz==0.0.1) (2024.6.2)
Collecting huggingface-hub<1.0,>=0.16.4 (from tokenizers>=0.19.1->etched-blitz==0.0.1)
  Using cached huggingface_hub-0.23.4-py3-none-any.whl.metadata (12 kB)
Collecting safetensors>=0.4.1 (from transformers>=4.40.0->etched-blitz==0.0.1)
  Using cached safetensors-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.8 kB)
Requirement already satisfied: attrs>=17.3.0 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from aiohttp->etched-blitz==0.0.1) (23.2.0)
Collecting multidict<7.0,>=4.5 (from aiohttp->etched-blitz==0.0.1)
  Using cached multidict-6.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.2 kB)
Collecting yarl<2.0,>=1.0 (from aiohttp->etched-blitz==0.0.1)
  Using cached yarl-1.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (31 kB)
Collecting async-timeout<5.0,>=4.0 (from aiohttp->etched-blitz==0.0.1)
  Using cached async_timeout-4.0.3-py3-none-any.whl.metadata (4.2 kB)
Collecting fastapi-cli>=0.0.2 (from fastapi->etched-blitz==0.0.1)
  Using cached fastapi_cli-0.0.4-py3-none-any.whl.metadata (7.0 kB)
Collecting httpx>=0.23.0 (from fastapi->etched-blitz==0.0.1)
  Using cached httpx-0.27.0-py3-none-any.whl.metadata (7.2 kB)
Collecting python-multipart>=0.0.7 (from fastapi->etched-blitz==0.0.1)
  Using cached python_multipart-0.0.9-py3-none-any.whl.metadata (2.5 kB)
Collecting ujson!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,>=4.0.1 (from fastapi->etched-blitz==0.0.1)
  Using cached ujson-5.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.3 kB)
Collecting orjson>=3.2.1 (from fastapi->etched-blitz==0.0.1)
  Using cached orjson-3.10.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (50 kB)
Collecting email_validator>=2.0.0 (from fastapi->etched-blitz==0.0.1)
  Using cached email_validator-2.2.0-py3-none-any.whl.metadata (25 kB)
Collecting h11>=0.8 (from uvicorn[standard]->etched-blitz==0.0.1)
  Using cached h11-0.14.0-py3-none-any.whl.metadata (8.2 kB)
Collecting httptools>=0.5.0 (from uvicorn[standard]->etched-blitz==0.0.1)
  Using cached httptools-0.6.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.6 kB)
Collecting python-dotenv>=0.13 (from uvicorn[standard]->etched-blitz==0.0.1)
  Using cached python_dotenv-1.0.1-py3-none-any.whl.metadata (23 kB)
Collecting uvloop!=0.15.0,!=0.15.1,>=0.14.0 (from uvicorn[standard]->etched-blitz==0.0.1)
  Using cached uvloop-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.9 kB)
Collecting watchfiles>=0.13 (from uvicorn[standard]->etched-blitz==0.0.1)
  Using cached watchfiles-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.9 kB)
Collecting websockets>=10.4 (from uvicorn[standard]->etched-blitz==0.0.1)
  Using cached websockets-12.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)
Collecting anyio<5,>=3.5.0 (from openai->etched-blitz==0.0.1)
  Using cached anyio-4.4.0-py3-none-any.whl.metadata (4.6 kB)
Collecting distro<2,>=1.7.0 (from openai->etched-blitz==0.0.1)
  Using cached distro-1.9.0-py3-none-any.whl.metadata (6.8 kB)
Collecting sniffio (from openai->etched-blitz==0.0.1)
  Using cached sniffio-1.3.1-py3-none-any.whl.metadata (3.9 kB)
Requirement already satisfied: exceptiongroup>=1.0.2 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from anyio<5,>=3.5.0->openai->etched-blitz==0.0.1) (1.2.1)
Collecting dnspython>=2.0.0 (from email_validator>=2.0.0->fastapi->etched-blitz==0.0.1)
  Using cached dnspython-2.6.1-py3-none-any.whl.metadata (5.8 kB)
Collecting typer>=0.12.3 (from fastapi-cli>=0.0.2->fastapi->etched-blitz==0.0.1)
  Using cached typer-0.12.3-py3-none-any.whl.metadata (15 kB)
Collecting httpcore==1.* (from httpx>=0.23.0->fastapi->etched-blitz==0.0.1)
  Using cached httpcore-1.0.5-py3-none-any.whl.metadata (20 kB)
Requirement already satisfied: MarkupSafe>=2.0 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from jinja2->torch==2.3.0->etched-blitz==0.0.1) (2.1.3)
Collecting pyarrow>=15.0.0 (from datasets->outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached pyarrow-16.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.metadata (3.0 kB)
Collecting pyarrow-hotfix (from datasets->outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached pyarrow_hotfix-0.6-py3-none-any.whl.metadata (3.6 kB)
Collecting dill<0.3.9,>=0.3.0 (from datasets->outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached dill-0.3.8-py3-none-any.whl.metadata (10 kB)
Collecting pandas (from datasets->outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)
Collecting xxhash (from datasets->outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached xxhash-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (12 kB)
Collecting multiprocess (from datasets->outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached multiprocess-0.70.16-py310-none-any.whl.metadata (7.2 kB)
Collecting fsspec (from torch==2.3.0->etched-blitz==0.0.1)
  Using cached fsspec-2024.5.0-py3-none-any.whl.metadata (11 kB)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from jsonschema->outlines>=0.0.43->etched-blitz==0.0.1) (2023.12.1)
Requirement already satisfied: rpds-py>=0.7.1 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from jsonschema->outlines>=0.0.43->etched-blitz==0.0.1) (0.18.1)
Collecting llvmlite<0.44,>=0.43.0dev0 (from numba->outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached llvmlite-0.43.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.8 kB)
Requirement already satisfied: mpmath>=0.19 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from sympy->torch==2.3.0->etched-blitz==0.0.1) (1.3.0)
Collecting shellingham>=1.3.0 (from typer>=0.12.3->fastapi-cli>=0.0.2->fastapi->etched-blitz==0.0.1)
  Using cached shellingham-1.5.4-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting rich>=10.11.0 (from typer>=0.12.3->fastapi-cli>=0.0.2->fastapi->etched-blitz==0.0.1)
  Using cached rich-13.7.1-py3-none-any.whl.metadata (18 kB)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from pandas->datasets->outlines>=0.0.43->etched-blitz==0.0.1) (2.9.0.post0)
Collecting pytz>=2020.1 (from pandas->datasets->outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.7 (from pandas->datasets->outlines>=0.0.43->etched-blitz==0.0.1)
  Using cached tzdata-2024.1-py2.py3-none-any.whl.metadata (1.4 kB)
Requirement already satisfied: six>=1.5 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas->datasets->outlines>=0.0.43->etched-blitz==0.0.1) (1.16.0)
Requirement already satisfied: markdown-it-py>=2.2.0 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from rich>=10.11.0->typer>=0.12.3->fastapi-cli>=0.0.2->fastapi->etched-blitz==0.0.1) (3.0.0)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from rich>=10.11.0->typer>=0.12.3->fastapi-cli>=0.0.2->fastapi->etched-blitz==0.0.1) (2.18.0)
Requirement already satisfied: mdurl~=0.1 in /home/action-runner/miniconda3/envs/worker-blitz-docs-build/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer>=0.12.3->fastapi-cli>=0.0.2->fastapi->etched-blitz==0.0.1) (0.1.2)
Using cached lm_format_enforcer-0.10.1-py3-none-any.whl (42 kB)
Using cached vllm_flash_attn-2.5.9-cp310-cp310-manylinux1_x86_64.whl (37.1 MB)
Using cached xformers-0.0.26.post1-cp310-cp310-manylinux2014_x86_64.whl (222.7 MB)
Using cached cmake-3.30.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (26.9 MB)
Using cached outlines-0.0.46-py3-none-any.whl (101 kB)
Using cached prometheus_client-0.20.0-py3-none-any.whl (54 kB)
Using cached prometheus_fastapi_instrumentator-7.0.0-py3-none-any.whl (19 kB)
Using cached pydantic-2.8.0-py3-none-any.whl (423 kB)
Using cached pydantic_core-2.20.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
Using cached ray-2.31.0-cp310-cp310-manylinux2014_x86_64.whl (66.2 MB)
Using cached tiktoken-0.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
Using cached tokenizers-0.19.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)
Using cached transformers-4.42.3-py3-none-any.whl (9.3 MB)
Using cached tqdm-4.66.4-py3-none-any.whl (78 kB)
Using cached aiohttp-3.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
Using cached fastapi-0.111.0-py3-none-any.whl (91 kB)
Using cached ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl (307 kB)
Using cached nvidia_ml_py-12.555.43-py3-none-any.whl (39 kB)
Using cached openai-1.35.9-py3-none-any.whl (328 kB)
Using cached py_cpuinfo-9.0.0-py3-none-any.whl (22 kB)
Using cached sentencepiece-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)
Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Using cached annotated_types-0.7.0-py3-none-any.whl (13 kB)
Using cached anyio-4.4.0-py3-none-any.whl (86 kB)
Using cached async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
Using cached distro-1.9.0-py3-none-any.whl (20 kB)
Using cached email_validator-2.2.0-py3-none-any.whl (33 kB)
Using cached fastapi_cli-0.0.4-py3-none-any.whl (9.5 kB)
Using cached frozenlist-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (239 kB)
Using cached h11-0.14.0-py3-none-any.whl (58 kB)
Using cached httptools-0.6.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (341 kB)
Using cached httpx-0.27.0-py3-none-any.whl (75 kB)
Using cached httpcore-1.0.5-py3-none-any.whl (77 kB)
Using cached huggingface_hub-0.23.4-py3-none-any.whl (402 kB)
Using cached interegular-0.3.3-py37-none-any.whl (23 kB)
Using cached msgpack-1.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (385 kB)
Using cached multidict-6.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (124 kB)
Using cached orjson-3.10.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
Using cached protobuf-5.27.2-cp38-abi3-manylinux2014_x86_64.whl (309 kB)
Using cached python_dotenv-1.0.1-py3-none-any.whl (19 kB)
Using cached python_multipart-0.0.9-py3-none-any.whl (22 kB)
Using cached regex-2024.5.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (775 kB)
Using cached safetensors-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
Using cached sniffio-1.3.1-py3-none-any.whl (10 kB)
Using cached starlette-0.37.2-py3-none-any.whl (71 kB)
Using cached ujson-5.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (53 kB)
Using cached uvicorn-0.30.1-py3-none-any.whl (62 kB)
Using cached uvloop-0.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB)
Using cached watchfiles-0.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB)
Using cached websockets-12.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (130 kB)
Using cached yarl-1.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (301 kB)
Using cached cloudpickle-3.0.0-py3-none-any.whl (20 kB)
Using cached datasets-2.20.0-py3-none-any.whl (547 kB)
Using cached fsspec-2024.5.0-py3-none-any.whl (316 kB)
Using cached diskcache-5.6.3-py3-none-any.whl (45 kB)
Using cached lark-1.1.9-py3-none-any.whl (111 kB)
Using cached numba-0.60.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.7 MB)
Using cached pyairports-2.1.1-py3-none-any.whl (371 kB)
Using cached pycountry-24.6.1-py3-none-any.whl (6.3 MB)
Using cached dill-0.3.8-py3-none-any.whl (116 kB)
Using cached dnspython-2.6.1-py3-none-any.whl (307 kB)
Using cached llvmlite-0.43.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.9 MB)
Using cached pyarrow-16.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (40.8 MB)
Using cached typer-0.12.3-py3-none-any.whl (47 kB)
Using cached multiprocess-0.70.16-py310-none-any.whl (134 kB)
Using cached pandas-2.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB)
Using cached pyarrow_hotfix-0.6-py3-none-any.whl (7.9 kB)
Using cached xxhash-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (194 kB)
Using cached pytz-2024.1-py2.py3-none-any.whl (505 kB)
Using cached rich-13.7.1-py3-none-any.whl (240 kB)
Using cached shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)
Using cached tzdata-2024.1-py2.py3-none-any.whl (345 kB)
Installing collected packages: sentencepiece, pytz, pyairports, py-cpuinfo, nvidia-ml-py, ninja, xxhash, websockets, uvloop, ujson, tzdata, tqdm, sniffio, shellingham, safetensors, regex, python-multipart, python-dotenv, pydantic-core, pycountry, pyarrow-hotfix, pyarrow, protobuf, prometheus-client, orjson, multidict, msgpack, llvmlite, lark, interegular, httptools, h11, fsspec, frozenlist, dnspython, distro, diskcache, dill, cmake, cloudpickle, async-timeout, annotated-types, yarl, uvicorn, tiktoken, rich, pydantic, pandas, numba, multiprocess, huggingface-hub, httpcore, email_validator, anyio, aiosignal, xformers, watchfiles, vllm-flash-attn, typer, tokenizers, starlette, lm-format-enforcer, httpx, aiohttp, transformers, ray, prometheus-fastapi-instrumentator, openai, fastapi-cli, fastapi, datasets, outlines, etched-blitz
Successfully installed aiohttp-3.9.5 aiosignal-1.3.1 annotated-types-0.7.0 anyio-4.4.0 async-timeout-4.0.3 cloudpickle-3.0.0 cmake-3.30.0 datasets-2.20.0 dill-0.3.8 diskcache-5.6.3 distro-1.9.0 dnspython-2.6.1 email_validator-2.2.0 etched-blitz-0.0.1 fastapi-0.111.0 fastapi-cli-0.0.4 frozenlist-1.4.1 fsspec-2024.5.0 h11-0.14.0 httpcore-1.0.5 httptools-0.6.1 httpx-0.27.0 huggingface-hub-0.23.4 interegular-0.3.3 lark-1.1.9 llvmlite-0.43.0 lm-format-enforcer-0.10.1 msgpack-1.0.8 multidict-6.0.5 multiprocess-0.70.16 ninja-1.11.1.1 numba-0.60.0 nvidia-ml-py-12.555.43 openai-1.35.9 orjson-3.10.6 outlines-0.0.46 pandas-2.2.2 prometheus-client-0.20.0 prometheus-fastapi-instrumentator-7.0.0 protobuf-5.27.2 py-cpuinfo-9.0.0 pyairports-2.1.1 pyarrow-16.1.0 pyarrow-hotfix-0.6 pycountry-24.6.1 pydantic-2.8.0 pydantic-core-2.20.0 python-dotenv-1.0.1 python-multipart-0.0.9 pytz-2024.1 ray-2.31.0 regex-2024.5.15 rich-13.7.1 safetensors-0.4.3 sentencepiece-0.2.0 shellingham-1.5.4 sniffio-1.3.1 starlette-0.37.2 tiktoken-0.7.0 tokenizers-0.19.1 tqdm-4.66.4 transformers-4.42.3 typer-0.12.3 tzdata-2024.1 ujson-5.10.0 uvicorn-0.30.1 uvloop-0.19.0 vllm-flash-attn-2.5.9 watchfiles-0.22.0 websockets-12.0 xformers-0.0.26.post1 xxhash-3.4.1 yarl-1.9.4
Collecting aiofiles
  Using cached aiofiles-24.1.0-py3-none-any.whl.metadata (10 kB)
Using cached aiofiles-24.1.0-py3-none-any.whl (15 kB)
Installing collected packages: aiofiles
Successfully installed aiofiles-24.1.0
from vllm import LLMEngine, EngineArgs
from vllm.utils import random_uuid

engine = LLMEngine.from_engine_args(EngineArgs(
   model="microsoft/Phi-3-mini-4k-instruct",
   dtype="half",
   max_num_batched_tokens=9,
   max_num_seqs=8,
   disable_sliding_window=True,
   enable_chunked_prefill=True,
   disable_log_stats=True,
   enable_log_batch_visualization=True))
WARNING 07-03 18:44:17 config.py:1286] Casting torch.bfloat16 to torch.float16.
INFO 07-03 18:44:17 config.py:727] Chunked prefill is enabled (EXPERIMENTAL).
INFO 07-03 18:44:17 llm_engine.py:166] Initializing an LLM engine (v0.0.1) with config: model='microsoft/Phi-3-mini-4k-instruct', speculative_config=None, tokenizer='microsoft/Phi-3-mini-4k-instruct', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, rope_scaling=None, rope_theta=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.float16, max_seq_len=2047, download_dir=None, load_format=LoadFormat.AUTO, tensor_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=False, kv_cache_dtype=auto, quantization_param_path=None, device_config=cuda, decoding_config=DecodingConfig(guided_decoding_backend='outlines'), observability_config=ObservabilityConfig(otlp_traces_endpoint=None), seed=0, served_model_name=microsoft/Phi-3-mini-4k-instruct)
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
INFO 07-03 18:44:21 weight_utils.py:218] Using model weights format ['*.safetensors']
INFO 07-03 18:44:23 model_runner.py:225] Loading model weights took 7.1183 GB
INFO 07-03 18:44:23 gpu_executor.py:83] # GPU blocks: 2162, # CPU blocks: 682
INFO 07-03 18:44:25 model_runner.py:840] Capturing the model for CUDA graphs. This may lead to unexpected consequences if the model is not static. To run the model in eager mode, set 'enforce_eager=True' or use '--enforce-eager' in the CLI.
INFO 07-03 18:44:25 model_runner.py:844] CUDA graphs can take additional 1~3 GiB memory per GPU. If you are running out of memory, consider decreasing `gpu_memory_utilization` or enforcing eager mode. You can also reduce the `max_num_seqs` as needed to decrease memory usage.
INFO 07-03 18:44:26 model_runner.py:916] Graph capturing finished in 1 secs.
import time
from IPython.display import clear_output
from vllm import SamplingParams


prompts = [
    "Hello my name is",
    "The president's",
    "water boils at",
    "The capital of France",
    "Cats really like",
    "The sun rises",
    "Humans are a",
    "The largest planet is",
    "Snow is very very",
    "Birds use their",
    "Fish swim in"
]
sampling_params = SamplingParams(temperature=0, top_p=0.95, max_tokens=4)

all_requests = []
for prompt in prompts:
  all_requests.append((random_uuid(), prompt, sampling_params))

while True:
  if all_requests:
    req_id, prompt, sp = all_requests.pop(0)
    engine.add_request(req_id, prompt, sp)

  clear_output(wait=True)
  outputs = engine.step()

  formatted_outputs = []
  for output in outputs:
    print(f"{output.prompt}: {output.outputs[0].text}")

  time.sleep(2)

  if not engine.has_unfinished_requests():
    break
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐
│ Hello        │
└──────────────┘
┌──────────────┐
│ my           │
└──────────────┘
┌──────────────┐
│ name         │
└──────────────┘
┌──────────────┐
│ is           │
└──────────────┘

Hello my name is:  John

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐
│ Hello        ││ The          │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ my           ││ president    │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ name         ││ '            │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ is           ││ s            │
└──────────────┘└──────────────┘
                ┌──────────────┐
                │ John         │
                └──────────────┘

The president's:  role
Hello my name is:  John and

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐
│ Hello        ││ The          ││ water        │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ my           ││ president    ││ bo           │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ name         ││ '            ││ ils          │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ is           ││ s            ││ at           │
└──────────────┘└──────────────┘└──────────────┘
                ┌──────────────┐┌──────────────┐
                │ John         ││ and          │
                └──────────────┘└──────────────┘
                                ┌──────────────┐
                                │ role         │
                                └──────────────┘

water boils at:  
Hello my name is:  John and I
The president's:  role in

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Hello        ││ The          ││ water        ││ The          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ my           ││ president    ││ bo           ││ capital      │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ name         ││ '            ││ ils          ││ of           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ is           ││ s            ││ at           ││ France       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                ┌──────────────┐┌──────────────┐┌──────────────┐
                │ John         ││ and          ││ I            │
                └──────────────┘└──────────────┘└──────────────┘
                                ┌──────────────┐┌──────────────┐
                                │ role         ││ in           │
                                └──────────────┘└──────────────┘
                                                ┌──────────────┐
                                                │              │
                                                └──────────────┘

The capital of France:  is
Hello my name is:  John and I am
The president's:  role in the
water boils at:  1

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Hello        ││ The          ││ water        ││ The          ││ C            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ my           ││ president    ││ bo           ││ capital      ││ ats          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ name         ││ '            ││ ils          ││ of           ││ really       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ is           ││ s            ││ at           ││ France       ││ like         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                │ John         ││ and          ││ I            ││ the          │
                └──────────────┘└──────────────┘└──────────────┘└──────────────┘
                                ┌──────────────┐┌──────────────┐┌──────────────┐
                                │ role         ││ in           ││ 1            │
                                └──────────────┘└──────────────┘└──────────────┘
                                                ┌──────────────┐┌──────────────┐
                                                │              ││ is           │
                                                └──────────────┘└──────────────┘

Cats really like:  to
The president's:  role in the legisl
water boils at:  10
The capital of France:  is Paris

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Hello        ││ The          ││ water        ││ The          ││ C            ││ The          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ my           ││ president    ││ bo           ││ capital      ││ ats          ││ sun          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ name         ││ '            ││ ils          ││ of           ││ really       ││ r            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ is           ││ s            ││ at           ││ France       ││ like         ││ ises         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                │ John         ││ and          ││ I            ││ the          ││ 0            │
                └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                                │ role         ││ in           ││ 1            ││ Paris        │
                                └──────────────┘└──────────────┘└──────────────┘└──────────────┘
                                                ┌──────────────┐┌──────────────┐┌──────────────┐
                                                │              ││ is           ││ to           │
                                                └──────────────┘└──────────────┘└──────────────┘

The sun rises:  in
water boils at:  100
The capital of France:  is Paris.
Cats really like:  to be

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Hello        ││ The          ││ water        ││ The          ││ C            ││ The          ││ Hum          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ my           ││ president    ││ bo           ││ capital      ││ ats          ││ sun          ││ ans          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ name         ││ '            ││ ils          ││ of           ││ really       ││ r            ││ are          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ is           ││ s            ││ at           ││ France       ││ like         ││ ises         ││ a            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                │ John         ││ and          ││ I            ││ the          ││ 0            ││ .            │
                └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                                │ role         ││ in           ││ 1            ││ Paris        ││ be           │
                                └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                                                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                                                │              ││ is           ││ to           ││ in           │
                                                └──────────────┘└──────────────┘└──────────────┘└──────────────┘

Humans are a:  part
The capital of France:  is Paris.

Cats really like:  to be p
The sun rises:  in the

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Hello        ││ The          ││ water        ││ The          ││ C            ││ The          ││ Hum          ││ The          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ my           ││ president    ││ bo           ││ capital      ││ ats          ││ sun          ││ ans          ││ largest      │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ name         ││ '            ││ ils          ││ of           ││ really       ││ r            ││ are          ││ planet       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ is           ││ s            ││ at           ││ France       ││ like         ││ ises         ││ a            ││ is           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                │ John         ││ and          ││ I            ││ the          ││ 0            ││ .            ││ p            │
                └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                                │ role         ││ in           ││ 1            ││ Paris        ││ be           ││ the          │
                                └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                                                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                                                │              ││ is           ││ to           ││ in           ││ part         │
                                                └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘

The largest planet is:  Jup
Cats really like:  to be pett
The sun rises:  in the east
Humans are a:  part of

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ The          ││ water        ││ The          ││ C            ││ The          ││ Hum          ││ The          ││ Snow         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ president    ││ bo           ││ capital      ││ ats          ││ sun          ││ ans          ││ largest      ││ is           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ '            ││ ils          ││ of           ││ really       ││ r            ││ are          ││ planet       ││ very         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ s            ││ at           ││ France       ││ like         ││ ises         ││ a            ││ is           ││ very         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ John         ││ and          ││ I            ││ the          ││ 0            ││ .            ││ p            ││ east         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                │ role         ││ in           ││ 1            ││ Paris        ││ be           ││ the          ││ of           │
                └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                                │              ││ is           ││ to           ││ in           ││ part         ││ Jup          │
                                └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘

Snow is very very:  cold
The sun rises:  in the east and
Humans are a:  part of the
The largest planet is:  Jupiter

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ water        ││ The          ││ C            ││ The          ││ Hum          ││ The          ││ Snow         ││ Bird         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ bo           ││ capital      ││ ats          ││ sun          ││ ans          ││ largest      ││ is           ││ s            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ ils          ││ of           ││ really       ││ r            ││ are          ││ planet       ││ very         ││ use          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ at           ││ France       ││ like         ││ ises         ││ a            ││ is           ││ very         ││ their        │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ and          ││ I            ││ the          ││ 0            ││ .            ││ p            ││ east         ││ the          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ role         ││ in           ││ 1            ││ Paris        ││ be           ││ the          ││ of           ││ iter         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
                ┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
                │              ││ is           ││ to           ││ in           ││ part         ││ Jup          ││ cold         │
                └──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘

Birds use their:  be
Humans are a:  part of the natural
The largest planet is:  Jupiter.
Snow is very very:  cold.

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ The          ││ C            ││ The          ││ Hum          ││ The          ││ Snow         ││ Bird         ││ Fish         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ capital      ││ ats          ││ sun          ││ ans          ││ largest      ││ is           ││ s            ││ sw           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ of           ││ really       ││ r            ││ are          ││ planet       ││ very         ││ use          ││ im           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ France       ││ like         ││ ises         ││ a            ││ is           ││ very         ││ their        ││ in           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ I            ││ the          ││ 0            ││ .            ││ p            ││ east         ││ the          ││ .            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ in           ││ 1            ││ Paris        ││ be           ││ the          ││ of           ││ iter         ││ .            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│              ││ is           ││ to           ││ in           ││ part         ││ Jup          ││ cold         ││ be           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘

Fish swim in:  a
The largest planet is:  Jupiter.

Snow is very very:  cold.

Birds use their:  beaks

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ C            ││ The          ││ Hum          ││ The          ││ Snow         ││ Bird         ││ Fish         ││ \n           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ ats          ││ sun          ││ ans          ││ largest      ││ is           ││ s            ││ sw           ││ aks          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ really       ││ r            ││ are          ││ planet       ││ very         ││ use          ││ im           ││ a            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                
│ like         ││ ises         ││ a            ││ is           ││ very         ││ their        ││ in           │                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                
│ the          ││ 0            ││ .            ││ p            ││ east         ││ the          ││ .            │                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                
│ 1            ││ Paris        ││ be           ││ the          ││ of           ││ iter         ││ .            │                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                
│ is           ││ to           ││ in           ││ part         ││ Jup          ││ cold         ││ be           │                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                

Snow is very very:  cold.


Birds use their:  beaks to
Fish swim in:  a pattern

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ The          ││ Hum          ││ The          ││ Snow         ││ Bird         ││ Fish         ││ \n           ││ to           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ sun          ││ ans          ││ largest      ││ is           ││ s            ││ sw           ││ aks          ││ pattern      │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                
│ r            ││ are          ││ planet       ││ very         ││ use          ││ im           ││ a            │                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                
│ ises         ││ a            ││ is           ││ very         ││ their        ││ in           │                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                
│ 0            ││ .            ││ p            ││ east         ││ the          ││ .            │                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                
│ Paris        ││ be           ││ the          ││ of           ││ iter         ││ .            │                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                
│ to           ││ in           ││ part         ││ Jup          ││ cold         ││ be           │                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                

Birds use their:  beaks to pe
Fish swim in:  a pattern that

Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Hum          ││ The          ││ Snow         ││ Bird         ││ Fish         ││ \n           ││ to           ││ that         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                
│ ans          ││ largest      ││ is           ││ s            ││ sw           ││ aks          ││ pattern      │                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                
│ are          ││ planet       ││ very         ││ use          ││ im           ││ a            │                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ a            ││ is           ││ very         ││ their        ││ in           │                                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ .            ││ p            ││ east         ││ the          ││ .            │                                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ be           ││ the          ││ of           ││ iter         ││ .            │                                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ in           ││ part         ││ Jup          ││ cold         ││ be           │                                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                                

Fish swim in:  a pattern that doubles

What’s happening here is that on every step (forward pass) the engine takes, we are adding another sequence for it to process. Each sequence is getting batched together with previously running sequences. For example, “The largest planet it” is getting prefilled, while the other tokens in the batch are all begin decoded.

You might be wondering, isn’t this going to make all decodes slow? Normally, yes. On a GPU, running prefills and decodes in the same batch would slow down every single batch, and thus inter-token latency (ITL), since prefills take so much longer than a decode. However, Sohu is able to perform the entire prefill in ~6ms. Thus, we’re able to get state-of-the-art time to first token (TTFT) while not trading off any ITL speed.

OpenAI compatible server

Let’s see this behavior deployed to an OpenAI compatible server, something you might be using in production

# Free model from memory
import gc
import torch
from vllm.distributed.parallel_state import destroy_model_parallel

destroy_model_parallel()
del engine.model_executor.driver_worker
del engine
gc.collect()
torch.cuda.empty_cache()

Start an OpenAI server running on http://localhost:8000

%%bash

nohup python3 -m vllm.entrypoints.openai.api_server \
  --model microsoft/Phi-3-mini-4k-instruct \
  --enable-chunked-prefill \
  --disable-sliding-window \
  --max-num-batched-tokens=12 \
  --max-num-seqs=12 \
  --dtype=half \
  --enable-log-batch-visualization \
  > server_output.log 2>&1 &

# Store the PID of the background process
SERVER_PID=$!
echo "vLLM server starting with PID: $SERVER_PID"
echo $SERVER_PID > .vllm_server_pid.txt

# Function to check if the server is ready
check_server() {
  curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/v1/models
}

# Wait for the server to be ready
echo "Waiting for the server to be ready..."
while true; do
  HTTP_STATUS=$(check_server)
  if [ "$HTTP_STATUS" -eq 200 ]; then
    echo "Server is ready!"
    break
  fi
  echo "Server not ready yet. Retrying in 5 seconds..."
  sleep 5
done

echo "vLLM server is up and running!"
vLLM server starting with PID: 11169
Waiting for the server to be ready...
Server not ready yet. Retrying in 5 seconds...
Server not ready yet. Retrying in 5 seconds...
Server not ready yet. Retrying in 5 seconds...
Server is ready!
vLLM server is up and running!

Here we instantiate an AsyncOpenAI server and send in three messages. Watch how Blitz chooses to batch together the tokens:

import asyncio
import time
from openai import AsyncOpenAI
from IPython.display import clear_output

# Set OpenAI's API key and API base to use vLLM's API server.
openai_api_key = "EMPTY"
openai_api_base = "http://localhost:8000/v1"

client = AsyncOpenAI(
    api_key=openai_api_key,
    base_url=openai_api_base,
)


async def process_message(message):
    response = await client.chat.completions.create(
        model="microsoft/Phi-3-mini-4k-instruct",
        messages=[{"role": "user", "content": message}],
        max_tokens=24,
        temperature=0.7
    )
    return response.choices[0].message.content


def get_next_batch(file_path, line_to_start_at):
    try:
        with open(file_path, 'rb') as file:
            file.seek(0, 2)  # Go to the end of the file
            file_size = file.tell()

            if line_to_start_at >= file_size:
                return None, line_to_start_at  # No new content

            file.seek(line_to_start_at)
            content = file.read()
            lines = content.split(b'\n')

            batch_start = None
            for i, line in enumerate(lines):
                if b'Batch' in line:
                    batch_start = i
                    break

            if batch_start is not None:
                batch_lines = []
                for j in range(batch_start, len(lines)):
                    if b'INFO' in lines[j] or (b'Batch' in lines[j] and j > batch_start):
                        break
                    batch_lines.append(lines[j])

                if batch_lines:
                    next_batch = b'\n'.join(batch_lines).decode('utf-8', errors='replace')
                    new_line_to_start_at = line_to_start_at + sum(len(line) + 1 for line in lines[:j])
                    return next_batch, new_line_to_start_at

            return None, file_size  # No batch found, return the current file size as the new starting point
    except Exception as e:
        print(f"Error reading log file: {str(e)}")
        return None, line_to_start_at

def print_batches(log_file_path):
    last_processed_line = 0
    while True:
        batch, last_processed_line = get_next_batch(log_file_path, last_processed_line)
        if batch:
            clear_output(wait=True)
            print(f"Batch:\n{batch}\n")
            time.sleep(1)  # 1 second delay between batch prints
        else:
            break

async def main():
    messages = [
        "Tell me a joke about programming.",
        "Explain quantum computing in simple terms.",
        "What are the main features of Python?"
    ]

    # Process messages concurrently
    responses = await asyncio.gather(*[process_message(msg) for msg in messages])

    # Print batches
    print_batches('server_output.log')

    # Print final results
    clear_output(wait=True)
    print("Final results:")
    for i, (message, response) in enumerate(zip(messages, responses)):
        print(f"\nMessage {i+1}: {message}")
        print(f"Response: {response}")

loop = asyncio.get_running_loop()
await loop.create_task(main())
Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐
│ <|user|>     │
└──────────────┘
┌──────────────┐
│ Exp          │
└──────────────┘
┌──────────────┐
│ lain         │
└──────────────┘
┌──────────────┐
│ quantum      │
└──────────────┘
┌──────────────┐
│ computing    │
└──────────────┘
┌──────────────┐
│ in           │
└──────────────┘
┌──────────────┐
│ simple       │
└──────────────┘
┌──────────────┐
│ terms        │
└──────────────┘
┌──────────────┐
│ .            │
└──────────────┘
┌──────────────┐
│ <|end|>      │
└──────────────┘
┌──────────────┐
│ <|assistan.. │
└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐
│ <|user|>     ││ <|user|>     │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ Exp          ││ Tell         │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ lain         ││ me           │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ quantum      ││ a            │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ computing    ││ jo           │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ in           ││ ke           │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ simple       ││ about        │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ terms        ││ programming  │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ .            ││ .            │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ <|end|>      ││ <|end|>      │
└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐
│ <|assistan.. ││ <|assistan.. │
└──────────────┘└──────────────┘
                ┌──────────────┐
                │ Quant        │
                └──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐
│ <|user|>     ││ <|user|>     ││ <|user|>     │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ Exp          ││ Tell         ││ What         │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ lain         ││ me           ││ are          │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ quantum      ││ a            ││ the          │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ computing    ││ jo           ││ main         │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ in           ││ ke           ││ features     │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ simple       ││ about        ││ of           │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ terms        ││ programming  ││ Python       │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ .            ││ .            ││ ?            │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ <|end|>      ││ <|end|>      ││ <|end|>      │
└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐
│ <|assistan.. ││ <|assistan.. ││ um           │
└──────────────┘└──────────────┘└──────────────┘
                ┌──────────────┐┌──────────────┐
                │ Quant        ││ Why          │
                └──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ <|user|>     ││ <|user|>     ││ <|user|>     ││ <|assistan.. │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Exp          ││ Tell         ││ What         ││ computing    │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ lain         ││ me           ││ are          ││ do           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐                
│ quantum      ││ a            ││ the          │                
└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐                
│ computing    ││ jo           ││ main         │                
└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐                
│ in           ││ ke           ││ features     │                
└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐                
│ simple       ││ about        ││ of           │                
└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐                
│ terms        ││ programming  ││ Python       │                
└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐                
│ .            ││ .            ││ ?            │                
└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐                
│ <|end|>      ││ <|end|>      ││ <|end|>      │                
└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐                
│ <|assistan.. ││ <|assistan.. ││ um           │                
└──────────────┘└──────────────┘└──────────────┘                
                ┌──────────────┐┌──────────────┐                
                │ Quant        ││ Why          │                
                └──────────────┘└──────────────┘                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ <|user|>     ││ <|user|>     ││ <|user|>     ││ <|assistan.. ││ is           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Exp          ││ Tell         ││ What         ││ computing    ││ program      │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ lain         ││ me           ││ are          ││ do           ││ Python       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐                                
│ quantum      ││ a            ││ the          │                                
└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐                                
│ computing    ││ jo           ││ main         │                                
└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐                                
│ in           ││ ke           ││ features     │                                
└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐                                
│ simple       ││ about        ││ of           │                                
└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐                                
│ terms        ││ programming  ││ Python       │                                
└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐                                
│ .            ││ .            ││ ?            │                                
└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐                                
│ <|end|>      ││ <|end|>      ││ <|end|>      │                                
└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐                                
│ <|assistan.. ││ <|assistan.. ││ um           │                                
└──────────────┘└──────────────┘└──────────────┘                                
                ┌──────────────┐┌──────────────┐                                
                │ Quant        ││ Why          │                                
                └──────────────┘└──────────────┘                                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ <|user|>     ││ <|user|>     ││ <|user|>     ││ <|assistan.. ││ is           ││ a            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Exp          ││ Tell         ││ What         ││ computing    ││ program      ││ mers         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ lain         ││ me           ││ are          ││ do           ││ Python       ││ is           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ quantum      ││ a            ││ the          │                                                
└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ computing    ││ jo           ││ main         │                                                
└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ in           ││ ke           ││ features     │                                                
└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ simple       ││ about        ││ of           │                                                
└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ terms        ││ programming  ││ Python       │                                                
└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ .            ││ .            ││ ?            │                                                
└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ <|end|>      ││ <|end|>      ││ <|end|>      │                                                
└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ <|assistan.. ││ <|assistan.. ││ um           │                                                
└──────────────┘└──────────────┘└──────────────┘                                                
                ┌──────────────┐┌──────────────┐                                                
                │ Quant        ││ Why          │                                                
                └──────────────┘└──────────────┘                                                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ <|user|>     ││ <|user|>     ││ <|user|>     ││ <|assistan.. ││ is           ││ a            ││ type         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Exp          ││ Tell         ││ What         ││ computing    ││ program      ││ mers         ││ always       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ lain         ││ me           ││ are          ││ do           ││ Python       ││ is           ││ a            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│ quantum      ││ a            ││ the          │                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│ computing    ││ jo           ││ main         │                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│ in           ││ ke           ││ features     │                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│ simple       ││ about        ││ of           │                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│ terms        ││ programming  ││ Python       │                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│ .            ││ .            ││ ?            │                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│ <|end|>      ││ <|end|>      ││ <|end|>      │                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│ <|assistan.. ││ <|assistan.. ││ um           │                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                
                ┌──────────────┐┌──────────────┐                                                                
                │ Quant        ││ Why          │                                                                
                └──────────────┘└──────────────┘                                                                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ <|user|>     ││ <|user|>     ││ <|user|>     ││ <|assistan.. ││ is           ││ a            ││ type         ││ of           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Exp          ││ Tell         ││ What         ││ computing    ││ program      ││ mers         ││ always       ││ mix          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ lain         ││ me           ││ are          ││ do           ││ Python       ││ is           ││ a            ││ high         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐                                                                                
│ quantum      ││ a            ││ the          │                                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                                
│ computing    ││ jo           ││ main         │                                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                                
│ in           ││ ke           ││ features     │                                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                                
│ simple       ││ about        ││ of           │                                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                                
│ terms        ││ programming  ││ Python       │                                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                                
│ .            ││ .            ││ ?            │                                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                                
│ <|end|>      ││ <|end|>      ││ <|end|>      │                                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                                
│ <|assistan.. ││ <|assistan.. ││ um           │                                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                                
                ┌──────────────┐┌──────────────┐                                                                                
                │ Quant        ││ Why          │                                                                                
                └──────────────┘└──────────────┘                                                                                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ <|user|>     ││ <|user|>     ││ <|assistan.. ││ is           ││ a            ││ type         ││ of           ││ computing    │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Tell         ││ What         ││ computing    ││ program      ││ mers         ││ always       ││ mix          ││ up           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ me           ││ are          ││ do           ││ Python       ││ is           ││ a            ││ high         ││ -            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐                                                                                                
│ a            ││ the          │                                                                                                
└──────────────┘└──────────────┘                                                                                                
┌──────────────┐┌──────────────┐                                                                                                
│ jo           ││ main         │                                                                                                
└──────────────┘└──────────────┘                                                                                                
┌──────────────┐┌──────────────┐                                                                                                
│ ke           ││ features     │                                                                                                
└──────────────┘└──────────────┘                                                                                                
┌──────────────┐┌──────────────┐                                                                                                
│ about        ││ of           │                                                                                                
└──────────────┘└──────────────┘                                                                                                
┌──────────────┐┌──────────────┐                                                                                                
│ programming  ││ Python       │                                                                                                
└──────────────┘└──────────────┘                                                                                                
┌──────────────┐┌──────────────┐                                                                                                
│ .            ││ ?            │                                                                                                
└──────────────┘└──────────────┘                                                                                                
┌──────────────┐┌──────────────┐                                                                                                
│ <|end|>      ││ <|end|>      │                                                                                                
└──────────────┘└──────────────┘                                                                                                
┌──────────────┐┌──────────────┐                                                                                                
│ <|assistan.. ││ um           │                                                                                                
└──────────────┘└──────────────┘                                                                                                
┌──────────────┐┌──────────────┐                                                                                                
│ Quant        ││ Why          │                                                                                                
└──────────────┘└──────────────┘                                                                                                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ <|user|>     ││ <|assistan.. ││ is           ││ a            ││ type         ││ of           ││ computing    ││ that         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ What         ││ computing    ││ program      ││ mers         ││ always       ││ mix          ││ up           ││ Hall         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ are          ││ do           ││ Python       ││ is           ││ a            ││ high         ││ -            ││ level        │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐                                                                                                                
│ the          │                                                                                                                
└──────────────┘                                                                                                                
┌──────────────┐                                                                                                                
│ main         │                                                                                                                
└──────────────┘                                                                                                                
┌──────────────┐                                                                                                                
│ features     │                                                                                                                
└──────────────┘                                                                                                                
┌──────────────┐                                                                                                                
│ of           │                                                                                                                
└──────────────┘                                                                                                                
┌──────────────┐                                                                                                                
│ Python       │                                                                                                                
└──────────────┘                                                                                                                
┌──────────────┐                                                                                                                
│ ?            │                                                                                                                
└──────────────┘                                                                                                                
┌──────────────┐                                                                                                                
│ <|end|>      │                                                                                                                
└──────────────┘                                                                                                                
┌──────────────┐                                                                                                                
│ um           │                                                                                                                
└──────────────┘                                                                                                                
┌──────────────┐                                                                                                                
│ Why          │                                                                                                                
└──────────────┘                                                                                                                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ <|assistan.. ││ is           ││ a            ││ type         ││ of           ││ computing    ││ that         ││ uses         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ computing    ││ program      ││ mers         ││ always       ││ mix          ││ up           ││ Hall         ││ owe          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ do           ││ Python       ││ is           ││ a            ││ high         ││ -            ││ level        ││ ,            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ is           ││ a            ││ type         ││ of           ││ computing    ││ that         ││ uses         ││ the          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ program      ││ mers         ││ always       ││ mix          ││ up           ││ Hall         ││ owe          ││ en           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Python       ││ is           ││ a            ││ high         ││ -            ││ level        ││ ,            ││ interpreted  │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ a            ││ type         ││ of           ││ computing    ││ that         ││ uses         ││ the          ││ principles   │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ mers         ││ always       ││ mix          ││ up           ││ Hall         ││ owe          ││ en           ││ and          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ is           ││ a            ││ high         ││ -            ││ level        ││ ,            ││ interpreted  ││ programming  │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ type         ││ of           ││ computing    ││ that         ││ uses         ││ the          ││ principles   ││ of           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ always       ││ mix          ││ up           ││ Hall         ││ owe          ││ en           ││ and          ││ Christmas    │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ a            ││ high         ││ -            ││ level        ││ ,            ││ interpreted  ││ programming  ││ language     │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ of           ││ computing    ││ that         ││ uses         ││ the          ││ principles   ││ of           ││ quantum      │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ mix          ││ up           ││ Hall         ││ owe          ││ en           ││ and          ││ Christmas    ││ ?            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ high         ││ -            ││ level        ││ ,            ││ interpreted  ││ programming  ││ language     ││ with         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ computing    ││ that         ││ uses         ││ the          ││ principles   ││ of           ││ quantum      ││ mechan       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ up           ││ Hall         ││ owe          ││ en           ││ and          ││ Christmas    ││ ?            ││ \n           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ -            ││ level        ││ ,            ││ interpreted  ││ programming  ││ language     ││ with         ││ dynamic      │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ that         ││ uses         ││ the          ││ principles   ││ of           ││ quantum      ││ mechan       ││ ics          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Hall         ││ owe          ││ en           ││ and          ││ Christmas    ││ ?            ││ \n           ││ \n           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ level        ││ ,            ││ interpreted  ││ programming  ││ language     ││ with         ││ dynamic      ││ typing       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ uses         ││ the          ││ principles   ││ of           ││ quantum      ││ mechan       ││ ics          ││ ,            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ owe          ││ en           ││ and          ││ Christmas    ││ ?            ││ \n           ││ \n           ││ \n           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ ,            ││ interpreted  ││ programming  ││ language     ││ with         ││ dynamic      ││ typing       ││ ,            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ the          ││ principles   ││ of           ││ quantum      ││ mechan       ││ ics          ││ ,            ││ the          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ en           ││ and          ││ Christmas    ││ ?            ││ \n           ││ \n           ││ \n           ││ B            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ interpreted  ││ programming  ││ language     ││ with         ││ dynamic      ││ typing       ││ ,            ││ clear        │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ principles   ││ of           ││ quantum      ││ mechan       ││ ics          ││ ,            ││ the          ││ science      │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ and          ││ Christmas    ││ ?            ││ \n           ││ \n           ││ \n           ││ B            ││ ecause       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ programming  ││ language     ││ with         ││ dynamic      ││ typing       ││ ,            ││ clear        ││ syntax       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ of           ││ quantum      ││ mechan       ││ ics          ││ ,            ││ the          ││ science      ││ of           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ Christmas    ││ ?            ││ \n           ││ \n           ││ \n           ││ B            ││ ecause       ││ Oct          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ language     ││ with         ││ dynamic      ││ typing       ││ ,            ││ clear        ││ syntax       ││ ,            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ quantum      ││ mechan       ││ ics          ││ ,            ││ the          ││ science      ││ of           ││ the          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ ?            ││ \n           ││ \n           ││ \n           ││ B            ││ ecause       ││ Oct          ││              │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ with         ││ dynamic      ││ typing       ││ ,            ││ clear        ││ syntax       ││ ,            ││ and          │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ mechan       ││ ics          ││ ,            ││ the          ││ science      ││ of           ││ the          ││ very         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ \n           ││ \n           ││ \n           ││ B            ││ ecause       ││ Oct          ││              ││ 3            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ dynamic      ││ typing       ││ ,            ││ clear        ││ syntax       ││ ,            ││ and          ││ an           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ ics          ││ ,            ││ the          ││ science      ││ of           ││ the          ││ very         ││ small        │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ \n           ││ \n           ││ B            ││ ecause       ││ Oct          ││              ││ 3            ││ 1            │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ typing       ││ ,            ││ clear        ││ syntax       ││ ,            ││ and          ││ an           ││ emphas       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ ,            ││ the          ││ science      ││ of           ││ the          ││ very         ││ small        ││ equals       │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ \n           ││ B            ││ ecause       ││ Oct          ││              ││ 3            ││ 1            ││ is           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                
│ ,            ││ clear        ││ syntax       ││ ,            ││ and          ││ an           ││ emphas       │                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ the          ││ science      ││ of           ││ the          ││ very         ││ small        ││ equals       ││ on           │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                
│ B            ││ ecause       ││ Oct          ││              ││ 3            ││ 1            ││ is           │                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                
│ clear        ││ syntax       ││ ,            ││ and          ││ an           ││ emphas       │                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐
│ science      ││ of           ││ the          ││ very         ││ small        ││ equals       ││ on           ││ read         │
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                
│ ecause       ││ Oct          ││              ││ 3            ││ 1            ││ is           │                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ syntax       ││ ,            ││ and          ││ an           ││ emphas       │                                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                
│ of           ││ the          ││ very         ││ small        ││ equals       ││ on           ││ read         │                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                                
│ Oct          ││              ││ 3            ││ 1            ││ is           │                                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│ ,            ││ and          ││ an           ││ emphas       │                                                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                                                



Batch:
Batch 1         Batch 2         Batch 3         Batch 4         Batch 5         Batch 6         Batch 7         Batch 8         
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                
│ the          ││ very         ││ small        ││ equals       ││ on           ││ read         │                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                
┌──────────────┐┌──────────────┐┌──────────────┐┌──────────────┐                                                                
│              ││ 3            ││ 1            ││ is           │                                                                
└──────────────┘└──────────────┘└──────────────┘└──────────────┘                                                                
┌──────────────┐┌──────────────┐┌──────────────┐                                                                                
│ and          ││ an           ││ emphas       │                                                                                
└──────────────┘└──────────────┘└──────────────┘                                                                                



Final results:

Message 1: Tell me a joke about programming.
Response:  Why do programmers always mix up Halloween and Christmas?


Because Oct 31 equals Dec

Message 2: Explain quantum computing in simple terms.
Response:  Quantum computing is a type of computing that uses the principles of quantum mechanics, the science of the very small,

Message 3: What are the main features of Python?
Response:  Python is a high-level, interpreted programming language with dynamic typing, clear syntax, and an emphasis on readability
# To kill the server if you want to try some other configuration

import os
import signal

def kill_vllm_server():
    try:
        with open('.vllm_server_pid.txt', 'r') as f:
            pid = int(f.read().strip())
        
        os.kill(pid, signal.SIGTERM)
        print(f"SIGTERM signal sent to process {pid}")
        
        # Wait a bit and check if the process is still running
        import time
        time.sleep(2)
        
        try:
            os.kill(pid, 0)  # This will raise an OSError if the process is not running
            print(f"Process {pid} is still running. Sending SIGKILL...")
            os.kill(pid, signal.SIGKILL)
            print(f"SIGKILL signal sent to process {pid}")
        except OSError:
            print(f"Process {pid} has been terminated successfully")
        
        # Clean up the PID file
        os.remove('.vllm_server_pid.txt')
    except FileNotFoundError:
        print("PID file not found. Server might not be running.")
    except ProcessLookupError:
        print(f"Process {pid} not found. It may have already terminated.")
    except Exception as e:
        print(f"An error occurred: {e}")

kill_vllm_server()
SIGTERM signal sent to process 11169
Process 11169 has been terminated successfully

Docs

Access comprehensive developer documentation for Blitz

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources