Skip to content

Conversation

aireilly
Copy link
Collaborator

@aireilly aireilly commented Aug 29, 2025

  1. Updated mkdocs.yml with the following changes:

    • Added pymdownx.magiclink extension - automatic URL linking

    • Excluded utility modules (llmcompressor.version, llmcompressor.typing) from auto-generated docs

    • Updated mkdocstrings config with new options:

      • docstring_section_style: list - Added list section formatting
      • filters: ["!^_"] - Hide private/internal methods from docs
      • merge_init_into_class: true - Merge class documentation
      • separate_signature: true - Function signature display
      • show_root_heading: true - Clear module headers
      • show_signature_annotations: true - Type hint visibility
      • show_symbol_type_heading: true - Clear type indicators
      • summary: true - Include summary sections

      https://mkdocstrings.github.io/python/reference/api/

  2. Added high level doc strings to most modules.

    Note: Used Claude to summarize and create new docstrings.

Preview:
https://vllm--1787.org.readthedocs.build/projects/llm-compressor/en/1787/

Copy link

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

@aireilly aireilly marked this pull request as draft August 29, 2025 16:18
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @aireilly, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on significantly improving the project's API documentation. It achieves this by updating the documentation generation configuration to use a more detailed and standardized docstring style, and by adding descriptive summaries to core Python modules. The aim is to make the API reference more informative and easier to navigate for developers.

Highlights

  • Documentation Configuration Update: The MkDocs configuration file (mkdocs.yml) has been updated to refine how API documentation is generated. This includes excluding the 'llmcompressor.version' module from automatic navigation and switching the docstring style to 'numpy' for better readability and detail.
  • Enhanced API Docstring Rendering: Numerous options have been enabled within the mkdocstrings plugin in mkdocs.yml to provide a more comprehensive and structured display of API elements, such as showing symbol types, separate signatures, and detailed parameter headings.
  • Module-Level Docstrings Added: Descriptive module-level docstrings have been added to several key init.py files and the typing.py file across the 'llmcompressor' package. These docstrings provide high-level summaries for each module, improving the overall clarity and completeness of the generated API documentation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to improve the API documentation by adding module-level docstrings and updating the mkdocs.yml configuration. The added docstrings are clear and descriptive. However, there is a critical issue in the mkdocs.yml configuration where the docstring_style is set to numpy, while the codebase predominantly uses the sphinx style. This mismatch will lead to incorrectly rendered documentation. I've provided a suggestion to correct this.

@aireilly aireilly force-pushed the update-api-docs branch 7 times, most recently from 50cf834 to e889ef1 Compare September 1, 2025 11:06
@aireilly aireilly marked this pull request as ready for review September 1, 2025 11:32
@dsikka dsikka added the ready When a PR is ready for review label Sep 2, 2025
@rahul-tuli
Copy link
Collaborator

Hi @aireilly Thanks for doing this, I have a ask though, since we don't have Module level docstrings for most of our modules, would it be possible to ignore them for the time being?

Screenshot 2025-09-02 at 6 14 22 PM

Copy link
Collaborator

@brian-dellabetta brian-dellabetta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few comments, but otherwise lgtm

@aireilly
Copy link
Collaborator Author

aireilly commented Sep 5, 2025

Hi @aireilly Thanks for doing this, I have a ask though, since we don't have Module level docstrings for most of our modules, would it be possible to ignore them for the time being?

I tried with this in the the mkdocs.yml but it didn't work. Perhaps we could just add the missing docstrings? This PR is open let's strike while the iron is hot WDYT @rahul-tuli @brian-dellabetta

filters:
- "!docstring"
- "!^_"

edit: hmm. maybe we can use https://mkdocstrings.github.io/python/usage/configuration/docstrings/#show_if_no_docstring

@aireilly aireilly force-pushed the update-api-docs branch 9 times, most recently from 826cf9f to 5fb6b75 Compare September 5, 2025 16:47
@aireilly
Copy link
Collaborator Author

aireilly commented Sep 5, 2025

OK. Not going to add more docstrings than are already reviewed. I do have a git stash of more maybe can add them in later PR.

I did add show_if_no_docstring to mkdocs.yml. This hides modules from the API docs if they have no docstrings, and provided they don't have child classes or functions that have docs. Not quite what you are looking for @rahul-tuli. We could manually hide modules in the mkdocs.yml but that wouldn't be great either. WDYT?

Signed-off-by: Aidan Reilly <[email protected]>
@@ -85,6 +86,9 @@ markdown_extensions:
plugins:
- api-autonav:
modules: ['src/llmcompressor']
exclude:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rahul-tuli We can exclude more modules like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready When a PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants