diff --git a/.gitignore b/.gitignore
index f6f64fcef..ea0331b26 100644
--- a/.gitignore
+++ b/.gitignore
@@ -53,6 +53,7 @@ wheels/
.installed.cfg
*.egg
MANIFEST
+.cache/*
# PyInstaller
# Usually these files are written by a python script from a template
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 000000000..4797720f2
--- /dev/null
+++ b/.readthedocs.yaml
@@ -0,0 +1,22 @@
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required
+version: 2
+
+# Set the OS, Python version, and other tools you might need
+build:
+ os: ubuntu-24.04
+ tools:
+ python: "3.12"
+
+# Build documentation with Mkdocs
+mkdocs:
+ configuration: mkdocs.yml
+
+python:
+ install:
+ - method: pip
+ path: .
+ extra_requirements:
+ - dev
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 000000000..99db91219
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,77 @@
+# LLM Compressor Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our community include:
+
+- Demonstrating empathy and kindness toward other people
+- Being respectful of differing opinions, viewpoints, and experiences
+- Giving and gracefully accepting constructive feedback
+- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
+- Focusing on what is best not just for us as individuals, but for the overall community
+
+Examples of unacceptable behavior include:
+
+- The use of sexualized language or imagery, and sexual attention or advances of any kind
+- Trolling, insulting or derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others’ private information, such as a physical or email address, without their explicit permission
+- Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement through GitHub, Slack, or Email. All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
+
+Community Impact Guidelines were inspired by [Mozilla’s code of conduct enforcement ladder](https://github.com/mozilla/diversity).
+
+For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
diff --git a/docs/assets/llmcompressor-icon-white.png b/docs/assets/llmcompressor-icon-white.png
new file mode 100644
index 000000000..c14a0f72b
Binary files /dev/null and b/docs/assets/llmcompressor-icon-white.png differ
diff --git a/docs/assets/llmcompressor-icon.png b/docs/assets/llmcompressor-icon.png
new file mode 100644
index 000000000..d8b6748f4
Binary files /dev/null and b/docs/assets/llmcompressor-icon.png differ
diff --git a/docs/assets/llmcompressor-user-flows.png b/docs/assets/llmcompressor-user-flows.png
new file mode 100644
index 000000000..734ba3b1e
Binary files /dev/null and b/docs/assets/llmcompressor-user-flows.png differ
diff --git a/docs/developer/index.md b/docs/developer/index.md
new file mode 100644
index 000000000..9c55c6e9e
--- /dev/null
+++ b/docs/developer/index.md
@@ -0,0 +1,39 @@
+---
+weight: -3
+---
+
+# Developer
+
+Welcome to the Developer section of LLM Compressor! This area provides essential resources for developers who want to contribute to or extend LLM Compressor. Whether you're interested in fixing bugs, adding new features, improving documentation, or understanding the project's governance, you'll find comprehensive guides to help you get started.
+
+LLM Compressor is an open-source project that values community contributions. We maintain high standards for code quality, documentation, and community interactions to ensure that LLM Compressor remains a robust, reliable, and user-friendly tool for compressing large language models.
+
+## Developer Resources
+
+
+
+- :material-handshake:{ .lg .middle } Code of Conduct
+
+ ---
+
+ Our community guidelines ensure that participation in the LLM Compressor project is a positive, inclusive, and respectful experience for everyone.
+
+ [:octicons-arrow-right-24: Code of Conduct](code-of-conduct.md)
+
+- :material-source-pull:{ .lg .middle } Contributing Guide
+
+ ---
+
+ Learn how to effectively contribute to LLM Compressor, including reporting bugs, suggesting features, improving documentation, and submitting code.
+
+ [:octicons-arrow-right-24: Contributing Guide](contributing.md)
+
+- :material-tools:{ .lg .middle } Development Guide
+
+ ---
+
+ Detailed instructions for setting up your development environment, implementing changes, and adhering to the project's coding standards and best practices.
+
+ [:octicons-arrow-right-24: Development Guide](developing.md)
+
+
diff --git a/docs/examples/index.md b/docs/examples/index.md
new file mode 100644
index 000000000..d4059330f
--- /dev/null
+++ b/docs/examples/index.md
@@ -0,0 +1,9 @@
+---
+weight: -4
+---
+
+# Examples
+
+Welcome to the LLM Compressor examples section! Here, you'll find practical demonstrations showing how to use LLM Compressor to optimize large language models for faster and more efficient deployment with vLLM. These examples will help you understand the various compression techniques and functionalities available in LLM Compressor, making it easier to apply them to your own models.
+
+To explore the examples, you can either navigate through the list provided in the sidebar or click next to see the next example in the series. Each example is designed to be self-contained, with clear instructions and code snippets that you can run directly.
diff --git a/docs/getting-started/compress.md b/docs/getting-started/compress.md
new file mode 100644
index 000000000..c10bbfd83
--- /dev/null
+++ b/docs/getting-started/compress.md
@@ -0,0 +1,67 @@
+---
+weight: -8
+---
+
+# Compress Your Model
+
+LLM Compressor provides a straightforward way to compress your models using various optimization techniques. This guide will walk you through the process of compressing a model using different quantization methods.
+
+## Prerequisites
+
+Before you begin, ensure you have the following prerequisites:
+- **Operating System:** Linux (recommended for GPU support)
+- **Python Version:** 3.9 or newer
+- **Available GPU:** For optimal performance, it's recommended to use a GPU. LLM Compressor supports the latest PyTorch and CUDA versions for compatability with NVIDIA GPUs.
+
+## Select a Model and Dataset
+
+Before you start compressing, select the model you'd like to compress and a calibration dataset that is representative of your use case. LLM Compressor supports a variety of models and integrates natively with Hugging Face Transformers and Model Hub, so a great starting point is to use a model from the Hugging Face Model Hub. LLM Compressor also supports many datasets from the Hugging Face Datasets library, making it easy to find a suitable dataset for calibration.
+
+For this guide, we'll use the `TinyLlama` model and the `open_platypus` dataset for calibration. You can replace these with your own model and dataset as needed.
+
+## Select a Quantization Method and Scheme
+
+LLM Compressor supports several quantization methods and schemes, each with its own strengths and weaknesses. The choice of method and scheme will depend on your specific use case, hardware capabilities, and desired trade-offs between model size, speed, and accuracy.
+
+Some common quantization schemes include:
+
+| Scheme | Description | Hardware Compatibility |
+|--------|-------------|------------------------|
+| **FP W8A8** | 8-bit floating point (FP8) quantization for weights and activations, providing ~2X smaller weights with 8-bit arithmetic operations. Good for general performance and compression, especially for server and batch inference. | Latest NVIDIA GPUs (Ada Lovelace, Hopper, and later) and latest AMD GPUs |
+| **INT W8A8** | 8-bit integer (INT8) quantization for weights and activations, providing ~2X smaller weights with 8-bit arithmetic operations. Good for general performance and compression, especially for server and batch inference. | All NVIDIA GPUs, AMD GPUs, TPUs, CPUs, and other accelerators |
+| **W4A16** | 4-bit integer (INT4) weights with 16-bit floating point (FP16) activations, providing ~3.7X smaller weights but requiring 16-bit arithmetic operations. Maximum compression for latency-sensitive applications with limited memory. | All NVIDIA GPUs, AMD GPUs, TPUs, CPUs, and other accelerators |
+
+Some common quantization methods include:
+
+| Method | Description | Accuracy Recovery vs. Time |
+|--------|-------------|----------------------------|
+| **GPTQ** | Utilizes second-order layer-wise optimizations to prioritize important weights/activations and enables updates to remaining weights | High accuracy recovery but more expensive/slower to run |
+| **AWQ** | Uses channelwise scaling to better preserve important outliers in weights and activations | Moderate accuracy recovery with faster runtime than GPTQ |
+| **SmoothQuant** | Smooths outliers in activations by folding them into weights, ensuring better accuracy for weight and activation quantized models | Good accuracy recovery with minimal calibration time; composable with other methods |
+
+For this guide, we'll use `GPTQ` composed with `SmoothQuant` to create an `INT W8A8` quantized model. This combination provides a good balance for performance, accuracy, and compatability across a wide range of hardware.
+
+## Apply the Recipe
+
+LLM Compressor provides the `oneshot` API for simple and straightforward model compression. This API allows you to apply a pre-defined recipe to your model and dataset, making it easy to get started with compression. To apply what we discussed above, we'll import the necessary modifiers and create a recipe to apply to our model and dataset:
+
+```python
+from llmcompressor.modifiers.smoothquant import SmoothQuantModifier
+from llmcompressor.modifiers.quantization import GPTQModifier
+from llmcompressor import oneshot
+
+recipe = [
+ SmoothQuantModifier(smoothing_strength=0.8),
+ GPTQModifier(scheme="W8A8", targets="Linear", ignore=["lm_head"]),
+]
+oneshot(
+ model="TinyLlama/TinyLlama-1.1B-Chat-v1.0",
+ dataset="open_platypus",
+ recipe=recipe,
+ output_dir="TinyLlama-1.1B-Chat-v1.0-INT8",
+ max_seq_length=2048,
+ num_calibration_samples=512,
+)
+```
+
+Once the above code is run, it will save the compressed model to the specified output directory: `TinyLlama-1.1B-Chat-v1.0-INT8`. You can then load this model using the Hugging Face Transformers library or vLLM for inference and testing.
diff --git a/docs/getting-started/deploy.md b/docs/getting-started/deploy.md
new file mode 100644
index 000000000..a396410fe
--- /dev/null
+++ b/docs/getting-started/deploy.md
@@ -0,0 +1,57 @@
+---
+weight: -6
+---
+
+# Deploy with vLLM
+
+Once you've compressed your model using LLM Compressor, you can deploy it for efficient inference using vLLM. This guide walks you through the deployment process, using the output from the [Compress Your Model](compress.md) guide. If you haven't completed that step, change the model arguments in the code snippets below to point to your desired model.
+
+vLLM is a high-performance inference engine designed for large language models, providing support for various quantization formats and optimized for both single and multi-GPU setups. It also offers an OpenAI-compatible API for easy integration with existing applications.
+
+## Prerequisites
+
+Before deploying your model, ensure you have the following prerequisites:
+- **Operating System:** Linux (recommended for GPU support)
+- **Python Version:** 3.9 or newer
+- **Available GPU:** For optimal performance, it's recommended to use a GPU. vLLM supports a range of accelerators, including NVIDIA GPUs, AMD GPUs, TPUs, and other accelerators.
+- **vLLM Installed:** Ensure you have vLLM installed. You can install it using pip:
+ ```bash
+ pip install vllm
+ ```
+
+## Python API
+
+vLLM provides a Python API for easy integration with your applications, enabling you to load and use your compressed model directly in your Python code. To test the compressed model, use the following code:
+
+```python
+from vllm import LLM
+
+model = LLM("./TinyLlama-1.1B-Chat-v1.0-INT8")
+output = model.generate("What is machine learning?", max_tokens=256)
+print(output)
+```
+
+After running the above code, you should see the generated output from your compressed model. This confirms that the model is loaded and ready for inference.
+
+## HTTP Server
+
+vLLM also provides an HTTP server for serving your model via a RESTful API that is compatible with OpenAI's API definitions. This allows you to easily integrate your model into existing applications or services.
+To start the HTTP server, use the following command:
+
+```bash
+vllm serve "./TinyLlama-1.1B-Chat-v1.0-INT8"
+```
+
+By default, the server will run on `localhost:8000`. You can change the host and port by using the `--host` and `--port` flags. Now that the server is running, you can send requests to it using any HTTP client. For example, you can use `curl` to send a request:
+
+```bash
+curl -X POST http://localhost:8000/v1/chat/completions \
+ -H "Content-Type: application/json" \
+ -d '{
+ "model": "TinyLlama-1.1B-Chat-v1.0-INT8",
+ "messages": [{"role": "user", "content": "What is machine learning?"}],
+ "max_tokens": 256
+ }'
+```
+
+This will return a JSON response with the generated text from your model. You can also use any HTTP client library in your programming language of choice to send requests to the server.
diff --git a/docs/getting-started/index.md b/docs/getting-started/index.md
new file mode 100644
index 000000000..38d3fdd60
--- /dev/null
+++ b/docs/getting-started/index.md
@@ -0,0 +1,41 @@
+---
+weight: -10
+---
+
+# Getting Started
+
+Welcome to LLM Compressor! This section will guide you through the process of installing the library, compressing your first model, and deploying it with vLLM for faster, more efficient inference.
+
+LLM Compressor makes it simple to optimize large language models for deployment, offering various quantization techniques that help you find the perfect balance between model quality, performance, and resource efficiency.
+
+## Quick Start Guides
+
+Follow the guides below to get started with LLM Compressor and optimize your models for production deployment.
+
+
+
+- :material-package-variant:{ .lg .middle } Installation
+
+ ---
+
+ Learn how to install LLM Compressor using pip or from source.
+
+ [:octicons-arrow-right-24: Installation Guide](install.md)
+
+- :material-memory:{ .lg .middle } Compress Your Model
+
+ ---
+
+ Learn how to apply quantization to your models using different algorithms and formats.
+
+ [:octicons-arrow-right-24: Compression Guide](compress.md)
+
+- :material-rocket-launch:{ .lg .middle } Deploy with vLLM
+
+ ---
+
+ Deploy your compressed model for efficient inference using vLLM.
+
+ [:octicons-arrow-right-24: Deployment Guide](deploy.md)
+
+
diff --git a/docs/getting-started/install.md b/docs/getting-started/install.md
new file mode 100644
index 000000000..abef6e63f
--- /dev/null
+++ b/docs/getting-started/install.md
@@ -0,0 +1,67 @@
+---
+weight: -10
+---
+
+# Installation
+
+LLM Compressor can be installed using several methods depending on your requirements. Below are the detailed instructions for each installation pathway.
+
+## Prerequisites
+
+Before installing LLM Compressor, ensure you have the following prerequisites:
+
+- **Operating System:** Linux (recommended for GPU support)
+- **Python Version:** 3.9 or newer
+- **Pip Version:** Ensure you have the latest version of pip installed. You can upgrade pip using the following command:
+
+ ```bash
+ python -m pip install --upgrade pip
+ ```
+
+## Installation Methods
+
+### Install from PyPI
+
+The simplest way to install LLM Compressor is via pip from the Python Package Index (PyPI):
+
+```bash
+pip install llmcompressor
+```
+
+This will install the latest stable release of LLM Compressor.
+
+### Install a Specific Version from PyPI
+
+If you need a specific version of LLM Compressor, you can specify the version number during installation:
+
+```bash
+pip install llmcompressor==0.5.1
+```
+
+Replace `0.1.0` with your desired version number.
+
+### Install from Source
+
+To install the latest development version of LLM Compressor from the main branch, use the following command:
+
+```bash
+pip install git+https://github.com/vllm-project/llm-compressor.git
+```
+
+This will clone the repository and install LLM Compressor directly from the main branch.
+
+### Install from a Local Clone
+
+If you have cloned the LLM Compressor repository locally and want to install it, navigate to the repository directory and run:
+
+```bash
+pip install .
+```
+
+For development purposes, you can install it in editable mode with the `dev` extra:
+
+```bash
+pip install -e .[dev]
+```
+
+This allows you to make changes to the source code and have them reflected immediately without reinstalling.
diff --git a/docs/schemes.md b/docs/guides/compression_schemes.md
similarity index 99%
rename from docs/schemes.md
rename to docs/guides/compression_schemes.md
index 19ff746e4..90d8a49da 100644
--- a/docs/schemes.md
+++ b/docs/guides/compression_schemes.md
@@ -1,4 +1,4 @@
-# Optimization Schemes
+# Compression Schemes
## PTQ
PTQ is performed to reduce the precision of quantizable weights (e.g., linear layers) to a lower bit-width. Supported formats are:
diff --git a/docs/guides/index.md b/docs/guides/index.md
new file mode 100644
index 000000000..b1d012d0c
--- /dev/null
+++ b/docs/guides/index.md
@@ -0,0 +1,29 @@
+---
+weight: -5
+---
+
+# Guides
+
+Welcome to the LLM Compressor guides section! Here you'll find comprehensive documentation covering key components and concepts of LLM Compressor. These guides will help you understand the various compression options available, how to apply them effectively, and how to deploy your optimized models for maximum performance.
+
+## Key Guides
+
+
+
+- :material-tune:{ .lg .middle } Compression Schemes
+
+ ---
+
+ Explore the available compression schemes for Quantization and Pruning to determine which is best for your use case.
+
+ [:octicons-arrow-right-24: Compression Schemes](compression_schemes.md)
+
+- :material-content-save:{ .lg .middle } Saving Models
+
+ ---
+
+ Learn the enhanced ways to save your compressed models with the library's extended `save_pretrained` functionality for compatibility with vLLM deployment.
+
+ [:octicons-arrow-right-24: Saving a Model](saving_a_model.md)
+
+
diff --git a/docs/save_pretrained.md b/docs/guides/saving_a_model.md
similarity index 99%
rename from docs/save_pretrained.md
rename to docs/guides/saving_a_model.md
index 4790a1500..6cc5e137f 100644
--- a/docs/save_pretrained.md
+++ b/docs/guides/saving_a_model.md
@@ -1,4 +1,4 @@
-# Enhanced `save_pretrained` Arguments
+# Saving a Model
The `llmcompressor` library extends Hugging Face's `save_pretrained` method with additional arguments to support model compression functionality. This document explains these extra arguments and how to use them effectively.
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 000000000..711581f8a
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,71 @@
+# Home
+
+!!! info "New Feature: Axolotl Sparse Finetuning Integration"
+ Easily finetune sparse LLMs through our seamless integration with Axolotl.
+ [Learn more](https://docs.axolotl.ai/docs/custom_integrations.html#llmcompressor).
+
+!!! info "New Feature: AutoAWQ Integration"
+ Perform low-bit weight-only quantization efficiently using AutoAWQ, now part of LLM Compressor. [Learn more](https://github.com/vllm-project/llm-compressor/pull/1177).
+
+## 
LLM Compressor
+
+
+
+
+
+**LLM Compressor** is an easy-to-use library for optimizing large language models for deployment with vLLM, enabling up to **5X faster, cheaper inference**. It provides a comprehensive toolkit for:
+
+- Applying a wide variety of compression algorithms, including weight and activation quantization, pruning, and more
+- Seamlessly integrating with Hugging Face Transformers, Models, and Datasets
+- Using a `safetensors`-based file format for compressed model storage that is compatible with `vLLM`
+- Supporting performant compression of large models via `accelerate`
+
+## Key Features
+
+- **Weight and Activation Quantization:** Reduce model size and improve inference performance for general and server-based applications with the latest research.
+ - Supported Algorithms: GPTQ, AWQ, SmoothQuant, RTN
+ - Supported Formats: INT W8A8, FP W8A8
+- **Weight-Only Quantization:** Reduce model size and improve inference performance for latency sensitive applications with the latest research
+ - Supported Algorithms: GPTQ, AWQ, RTN
+ - Supported Formats: INT W4A16, INT W8A16
+- **Weight Pruning:** Reduce model size and improve inference performance for all use cases with the latest research
+ - Supported Algorithms: SparseGPT, Magnitude, Sparse Finetuning
+ - Supported Formats: 2:4 (semi-structured), unstructured
+
+## Key Sections
+
+
+
+- :material-rocket-launch:{ .lg .middle } Getting Started
+
+ ---
+
+ Install LLM Compressor and learn how to apply your first optimization recipe.
+
+ [:octicons-arrow-right-24: Getting started](./getting-started/)
+
+- :material-book-open-variant:{ .lg .middle } Guides
+
+ ---
+
+ Detailed guides covering compression schemes, algorithms, and advanced usage patterns.
+
+ [:octicons-arrow-right-24: Guides](./guides/)
+
+- :material-flask:{ .lg .middle } Examples
+
+ ---
+
+ Step-by-step examples for different compression techniques and model types.
+
+ [:octicons-arrow-right-24: Examples](./examples/)
+
+- :material-tools:{ .lg .middle } Developer Resources
+
+ ---
+
+ Information for contributors and developers extending LLM Compressor.
+
+ [:octicons-arrow-right-24: Developer Resources](./developer/)
+
+
diff --git a/docs/scripts/__init__.py b/docs/scripts/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/docs/scripts/gen_files.py b/docs/scripts/gen_files.py
new file mode 100644
index 000000000..afae28da5
--- /dev/null
+++ b/docs/scripts/gen_files.py
@@ -0,0 +1,114 @@
+"""
+Copy required files from outside of the docs directory into the docs directory
+for the documentation build and site.
+Uses mkdocs-gen-files to handle the file generation and compatibility with MkDocs.
+"""
+
+from dataclasses import dataclass
+from pathlib import Path
+from typing import Optional
+
+import mkdocs_gen_files
+
+
+@dataclass
+class ProcessFile:
+ root_path: Path
+ docs_path: Path
+ title: Optional[str] = None
+ weight: Optional[float] = None
+
+
+def find_project_root() -> Path:
+ start_path = Path(__file__).absolute()
+ current_path = start_path.parent
+
+ while current_path:
+ if (current_path / "mkdocs.yml").exists():
+ return current_path
+ current_path = current_path.parent
+
+ raise FileNotFoundError(
+ f"Could not find mkdocs.yml in the directory tree starting from {start_path}"
+ )
+
+
+def process_files(files: list[ProcessFile], project_root: Path):
+ for file in files:
+ source_path = project_root / file.root_path
+ target_path = file.docs_path
+
+ if not source_path.exists():
+ raise FileNotFoundError(
+ f"Source file {source_path} does not exist for copying into docs "
+ f"directory at {target_path}"
+ )
+
+ content = source_path.read_text(encoding="utf-8")
+
+ # Only add frontmatter if title or weight are set
+ if file.title is not None or file.weight is not None:
+ frontmatter = "---\n"
+ if file.title is not None:
+ frontmatter += f"title: {file.title}\n"
+ if file.weight is not None:
+ frontmatter += f"weight: {file.weight}\n"
+ frontmatter += "---\n\n"
+ content = frontmatter + content
+
+ with mkdocs_gen_files.open(target_path, "w") as file_handle:
+ file_handle.write(content)
+
+ mkdocs_gen_files.set_edit_path(target_path, source_path)
+
+
+def migrate_developer_docs():
+ project_root = find_project_root()
+ files = [
+ ProcessFile(
+ root_path=Path("CODE_OF_CONDUCT.md"),
+ docs_path=Path("developer/code-of-conduct.md"),
+ title="Code of Conduct",
+ weight=-10,
+ ),
+ ProcessFile(
+ root_path=Path("CONTRIBUTING.md"),
+ docs_path=Path("developer/contributing.md"),
+ title="Contributing Guide",
+ weight=-8,
+ ),
+ ProcessFile(
+ root_path=Path("DEVELOPING.md"),
+ docs_path=Path("developer/developing.md"),
+ title="Development Guide",
+ weight=-6,
+ ),
+ ]
+ process_files(files, project_root)
+
+
+def migrate_examples():
+ project_root = find_project_root()
+ examples_path = project_root / "examples"
+ files = []
+
+ # Find all README.md files 2 levels down (examples/EXAMPLE_NAME/README.md)
+ for example_dir in examples_path.iterdir():
+ if not example_dir.is_dir() or not (readme_path := example_dir / "README.md").exists():
+ continue
+
+ example_name = example_dir.name
+ files.append(
+ ProcessFile(
+ root_path=readme_path.relative_to(project_root),
+ docs_path=Path(f"examples/{example_name}.md"),
+ title=None,
+ weight=None,
+ )
+ )
+
+ process_files(files, project_root)
+
+
+migrate_developer_docs()
+migrate_examples()
diff --git a/docs/scripts/mathjax.js b/docs/scripts/mathjax.js
new file mode 100644
index 000000000..7e48906af
--- /dev/null
+++ b/docs/scripts/mathjax.js
@@ -0,0 +1,19 @@
+window.MathJax = {
+ tex: {
+ inlineMath: [["\\(", "\\)"]],
+ displayMath: [["\\[", "\\]"]],
+ processEscapes: true,
+ processEnvironments: true
+ },
+ options: {
+ ignoreHtmlClass: ".*|",
+ processHtmlClass: "arithmatex"
+ }
+};
+
+document$.subscribe(() => {
+ MathJax.startup.output.clearCache()
+ MathJax.typesetClear()
+ MathJax.texReset()
+ MathJax.typesetPromise()
+})
diff --git a/docs/stylesheets/style.css b/docs/stylesheets/style.css
new file mode 100644
index 000000000..e69de29bb
diff --git a/mkdocs.yml b/mkdocs.yml
new file mode 100644
index 000000000..48acc5e48
--- /dev/null
+++ b/mkdocs.yml
@@ -0,0 +1,113 @@
+site_name: LLM Compressor Docs
+site_description: Documentation for LLM Compressor, an easy-to-use library for compressing large language models for deployment with vLLM.
+site_url: https://docs.vllm.ai/projects/llm-compressor
+repo_url: https://github.com/vllm-project/llm-compressor
+edit_uri: https://github.com/vllm-project/llm-compressor/tree/main/docs
+
+theme:
+ name: material
+ font:
+ text: Roboto
+ code: Roboto Mono
+ language: en
+ logo: assets/llmcompressor-icon-white.png
+ favicon: assets/llmcompressor-icon-white.png
+ features:
+ - content.action.edit
+ - content.code.annotate
+ - content.code.copy
+ - content.code.select
+ - navigation.footer
+ - navigation.indexes
+ - navigation.instant
+ - navigation.path
+ - navigation.top
+ - navigation.tracking
+ - search.highlight
+ - search.share
+ - search.suggest
+ - toc.follow
+ palette:
+ # Palette toggle for automatic mode
+ - media: "(prefers-color-scheme)"
+ toggle:
+ icon: material/brightness-auto
+ name: Switch to light mode
+
+ # Palette toggle for light mode
+ - media: "(prefers-color-scheme: light)"
+ scheme: youtube
+ toggle:
+ icon: material/brightness-7
+ name: Switch to dark mode
+
+ # Palette toggle for dark mode
+ - media: "(prefers-color-scheme: dark)"
+ scheme: slate
+ toggle:
+ icon: material/brightness-4
+ name: Switch to system preference
+
+markdown_extensions:
+ - abbr
+ - admonition
+ - attr_list
+ - def_list
+ - footnotes
+ - md_in_html
+ - pymdownx.arithmatex:
+ generic: true
+ - pymdownx.blocks.caption
+ - pymdownx.details
+ - pymdownx.emoji:
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
+ - pymdownx.highlight:
+ anchor_linenums: true
+ line_spans: __span
+ pygments_lang_class: true
+ - pymdownx.inlinehilite
+ - pymdownx.mark
+ - pymdownx.smartsymbols
+ - pymdownx.snippets
+ - pymdownx.superfences:
+ custom_fences:
+ - name: mermaid
+ class: mermaid
+ format: !!python/name:pymdownx.superfences.fence_code_format
+ - pymdownx.tabbed:
+ alternate_style: true
+ - pymdownx.tasklist:
+ custom_checkbox: true
+ - pymdownx.tilde
+ - tables
+
+plugins:
+ - api-autonav:
+ modules: ['src/llmcompressor']
+ - gen-files:
+ scripts:
+ - docs/scripts/gen_files.py
+ - minify:
+ minify_html: true
+ - mkdocs-nav-weight
+ - mkdocstrings:
+ default_handler: python
+ handlers:
+ python:
+ options:
+ docstring_style: sphinx
+ - search
+ - section-index
+ - social
+ - tags
+
+extra:
+ generator: false
+
+extra_css:
+ - stylesheets/style.css
+
+extra_javascript:
+ - scripts/mathjax.js
+ - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
diff --git a/setup.py b/setup.py
index 04de6484d..88fa55223 100644
--- a/setup.py
+++ b/setup.py
@@ -155,6 +155,17 @@ def localversion_func(version: ScmVersion) -> str:
"flake8~=7.0.0",
# pre commit hooks
"pre-commit",
+ # docs
+ "mkdocs",
+ "mkdocs-material[imaging]",
+ "markdown",
+ "pymdown-extensions",
+ "mkdocs-section-index",
+ "mkdocs-minify-plugin",
+ "mkdocs-api-autonav",
+ "mkdocstrings-python",
+ "mkdocs-gen-files",
+ "mkdocs-nav-weight",
]
},
entry_points={