4.0 KiB
Documentation Build Guide
This directory contains the source files for the vLLM-Omni documentation.
Building Documentation Locally
Prerequisites
Install documentation dependencies:
uv pip install -e ".[docs]"
Build and Serve Documentation
From the project root:
# Serve documentation locally (auto-reload on changes)
# This starts a local web server at http://127.0.0.1:8000
mkdocs serve
# Build static site (generates HTML files in site/ directory)
mkdocs build
When using mkdocs serve, the documentation will be automatically available at http://127.0.0.1:8000. The server will automatically reload when you make changes to the documentation files.
Auto-generating API Documentation
The documentation automatically extracts docstrings from the code using mkdocstrings. To ensure your code is documented:
- Add docstrings to all public classes, functions, and methods
- Use Google or NumPy style docstrings (both are supported)
- Rebuild the documentation to see changes
Example docstring:
class Omni:
"""Main entry point for vLLM-Omni inference.
This class provides a high-level interface for running multi-modal
inference with non-autoregressive models.
Args:
model: Model name or path
stage_configs: Optional stage configurations
**kwargs: Additional arguments passed to the engine
Example:
>>> llm = Omni(model="Qwen/Qwen2.5-Omni")
>>> outputs = llm.generate(prompts="Hello")
"""
Documentation Structure
docs/
├── index.md # Main documentation page
├── getting_started/ # Getting started guides
├── architecture/ # Architecture documentation
├── api/ # API reference (auto-generated from code)
├── examples/ # Code examples
└── stylesheets/ # Custom CSS
Publishing Documentation
GitHub Pages (Recommended)
The documentation is automatically deployed to GitHub Pages using GitHub Actions.
-
Enable GitHub Pages:
- Go to repository
Settings→Pages - Set
SourcetoGitHub Actions - Save settings
- Go to repository
-
Push changes:
git push origin main -
Documentation will be available at:
https://vllm-omni.readthedocs.io
The GitHub Actions workflow (.github/workflows/docs.yml) will automatically:
- Build the documentation when you push to
mainbranch - Deploy it to GitHub Pages
- Update the documentation whenever you make changes
Read the Docs (Alternative)
You can also use Read the Docs for hosting:
- Sign up at https://readthedocs.org/
- Import the
vllm-project/vllm-omnirepository - Read the Docs will automatically build using
.readthedocs.yml - Documentation will be available at:
https://vllm-omni.readthedocs.io/
Configuration
The documentation configuration is in mkdocs.yml at the project root.
Tips
- API Documentation: API docs are automatically generated using
mkdocs-api-autonavandmkdocstrings- No need to manually create API pages - they're generated automatically
- Use
[module.name.ClassName][]syntax for cross-references in Summary pages
- Code Snippets: Use
--8<-- "path/to/file.py"for including code snippets - Markdown: Use Markdown for all documentation (no need for RST)
- Material Theme: Use Material theme features like:
- Admonitions:
!!! note,!!! warning, etc. - Code blocks with syntax highlighting
- Tabs for organizing content
- Math formulas using
pymdownx.arithmatex
- Admonitions:
Troubleshooting
Documentation not updating
- Make sure you've saved all files
- If using
mkdocs serve, it should auto-reload - Check for syntax errors in
mkdocs.yml
API links not working
- Ensure class names match exactly (case-sensitive)
- Check that the module is imported correctly
- Run
mkdocs build --strictto check for errors
Build errors
- Check Python version (requires 3.9+)
- Ensure all dependencies are installed:
pip install -e ".[docs]" - Check
mkdocs.ymlsyntax withmkdocs build --strict