Skip to content

Commit

Permalink
init docs structure (#234)
Browse files Browse the repository at this point in the history
Signed-off-by: Siddhant Ray <[email protected]>
  • Loading branch information
Siddhant-Ray authored Mar 5, 2025
1 parent f29edf2 commit cb5ebb2
Show file tree
Hide file tree
Showing 40 changed files with 475 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
8 changes: 8 additions & 0 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sphinx==8.0.2
sphinx-autodoc-typehints==2.4.1
sphinx-book-theme==1.1.3
sphinx-click==6.0.0
sphinx-copybutton==0.5.2
sphinx-togglebutton==0.3.2
sphinx_design==0.6.1
sphinxemoji==0.3.1
Binary file added docs/source/assets/output.ico
Binary file not shown.
Binary file added docs/source/assets/prodarch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/assets/prodstack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/assets/prodstack_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/assets/vllm-logo-only-light.ico
Binary file not shown.
Binary file added docs/source/assets/vllm-logo-only-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/assets/vllm-logo-text-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/source/benchmarks/multiround-qa.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _multiround-qa:

Multi-round QA
==============
96 changes: 96 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import os
import sys
from dataclasses import asdict

from sphinx.ext import autodoc

sys.path.insert(0, os.path.abspath("../../src"))

project = "production-stack"
copyright = "2025, vLLM Production Stack Team"
author = "vLLM Production Stack Team"

extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.linkcode",
"sphinx.ext.intersphinx",
"sphinx_copybutton",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"myst_parser",
"sphinxarg.ext",
"sphinx_design",
"sphinx_togglebutton",
]

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []

templates_path = ["_templates"]
exclude_patterns = []


class MockedClassDocumenter(autodoc.ClassDocumenter):
"""Remove note about base class when a class is
derived from object."""

def add_line(self, line: str, source: str, *lineno: int) -> None:
if line == " Bases: :py:class:`object`":
return
super().add_line(line, source, *lineno)


autodoc.ClassDocumenter = MockedClassDocumenter

# autodoc_default_options = {
# "members": True,
# "undoc-members": True,
# "private-members": True
# }


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_title = project
html_theme = "sphinx_book_theme"
html_static_path = ["_static"]
html_logo = "./assets/prodstack_icon.png"
html_favicon = "./assets/output.ico"
html_permalinks_icon = "<span>#</span>"
# pygments_style = "sphinx"
# pygments_style_dark = "fruity"
html_theme_options = {
"path_to_docs": "docs/source",
"repository_url": "https://github.com/vllm-project/production-stack",
"use_repository_button": True,
"use_edit_page_button": True,
# navigation and sidebar
"show_toc_level": 2,
"announcement": None,
"secondary_sidebar_items": [
"page-toc",
],
"navigation_depth": 3,
"primary_sidebar_end": [],
"pygments_light_style": "tango",
"pygments_dark_style": "monokai",
}

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"typing_extensions": ("https://typing-extensions.readthedocs.io/en/latest", None),
"numpy": ("https://numpy.org/doc/stable", None),
"torch": ("https://pytorch.org/docs/stable", None),
"psutil": ("https://psutil.readthedocs.io/en/stable", None),
}
4 changes: 4 additions & 0 deletions docs/source/deployment/cloud-deployment/aws.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _aws:

AWS
===
4 changes: 4 additions & 0 deletions docs/source/deployment/cloud-deployment/gcp.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _gcp:

Google Cloud Platform
=====================
14 changes: 14 additions & 0 deletions docs/source/deployment/cloud-deployment/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. _index:


Cloud Environments
==============================================

📈 Easily deploy the stack on AWS, GCP, or any other cloud provider

.. toctree::
:maxdepth: 1
:caption: Deployment

aws.rst
gcp.rst
4 changes: 4 additions & 0 deletions docs/source/deployment/helm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _helm_charts:

Helm Charts
=======================================
4 changes: 4 additions & 0 deletions docs/source/deployment/ray/ray.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _ray_deploy:

Ray Deployment
=======================================
4 changes: 4 additions & 0 deletions docs/source/dev_guide/dev_api/engine-stats.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _engine-stats:

Engine Stats
============
12 changes: 12 additions & 0 deletions docs/source/dev_guide/dev_api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _dev_api_index:

Developer API
================

.. toctree::
:maxdepth: 1
:caption: Developer Guide

router-logic.rst
engine-stats.rst
service-discovery.rst
4 changes: 4 additions & 0 deletions docs/source/dev_guide/dev_api/router-logic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _router-logic:

Router Logic
============
4 changes: 4 additions & 0 deletions docs/source/dev_guide/dev_api/service-discovery.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _service-discovery:

Service Discovery
=================
11 changes: 11 additions & 0 deletions docs/source/dev_guide/peripheral/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _peripheral_index:

Peripheral
================

.. toctree::
:maxdepth: 1
:caption: Developer Guide

models.rst
interfaces.rst
4 changes: 4 additions & 0 deletions docs/source/dev_guide/peripheral/interfaces.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _dev_interfaces:

Interfaces
================
4 changes: 4 additions & 0 deletions docs/source/dev_guide/peripheral/models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _models:

Models
======
6 changes: 6 additions & 0 deletions docs/source/getting_started/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _examples:

Minimal Example
===============

Add simple tutorial here.
59 changes: 59 additions & 0 deletions docs/source/getting_started/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.. _installation:

.. role:: raw-html(raw)
:format: html

Installation
============

Architecture
------------

.. figure:: ../assets/prodarch.png
:width: 60%
:align: center
:alt: production-arch
:class: no-scaled-link


The stack is set up using Helm, and contains the following key parts:


* **Serving engine**: The vLLM engines that run different LLMs
* **Request router**: Directs requests to appropriate backends based on routing keys or session IDs to maximize KV cache reuse.
* **Observability stack**: monitors the metrics of the backends through `Prometheus <https://prometheus.io/>`_ and `Grafana <https://grafana.com/>`_.


Prerequisites
-------------

- A running Kubernetes (K8s) environment with GPUs
- Run ``cd utils`` && ``bash install-minikube-cluster.sh``
- Or follow our `tutorial <https://github.com/vllm-project/production-stack/blob/main/tutorials/00-install-kubernetes-env.md>`_


Deployment
----------

vLLM Production Stack can be deployed via helm charts. Clone the repo to local and execute the following commands for a minimal deployment:

.. code:: bash
git clone https://github.com/vllm-project/production-stack.git
cd production-stack/
helm repo add vllm https://vllm-project.github.io/production-stack
helm install vllm vllm/vllm-stack -f tutorials/assets/values-01-minimal-example.yaml
The deployed stack provides the same `OpenAI API interface <https://docs.vllm.ai/en/latest/serving/openai_compatible_server.html?ref=blog.mozilla.ai#openai-compatible-server>`_ as vLLM, and can be accessed through kubernetes service.

To validate the installation and and send query to the stack, refer to this `example <https://github.com/vllm-project/production-stack/blob/main/tutorials/01-minimal-helm-installation.md>`_.

Uninstallation
--------------

To uninstall the stack, run:

.. code:: bash
sudo helm uninstall vllm
4 changes: 4 additions & 0 deletions docs/source/getting_started/troubleshooting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _troubleshooting:

Troubleshooting
===========================
Loading

0 comments on commit cb5ebb2

Please sign in to comment.