Skip to content

Generate llms files with rocm_docs_generate_llms - #105

Open
neon60 wants to merge 1 commit into
ROCm:mainfrom
neon60:llm_comp_sol
Open

Generate llms files with rocm_docs_generate_llms#105
neon60 wants to merge 1 commit into
ROCm:mainfrom
neon60:llm_comp_sol

Conversation

@neon60

@neon60 neon60 commented Aug 11, 2026

Copy link
Copy Markdown

Motivation

Enable llms.txt / llms-full.txt generation for the Network Operator docs, so the site publishes machine-readable documentation following the llms.txt standard (https://llmstxt.org/). This aligns the project with the shared approach used across the Instinct documentation set (k8s-device-plugin, container-toolkit, gpu-operator, gpu-cluster-networking, amdgpu-docs, instinct-docs), using the built-in support in rocm-docs-core.

Technical Details

  • Enable generation via rocm_docs_generate_llms = True in docs/conf.py, which produces both llms.txt and llms-full.txt from the resolved doctree at build time.
  • Add use_download_button: True to html_theme_options for the per-page Markdown download button.
  • Pin rocm-docs-core to 1.38.0 and add the [llms] extra in docs/sphinx/requirements.in (previously unpinned, resolving to 1.26.0); regenerate requirements.txt (Python 3.12, matching the existing lockfile header), which pulls in sphinx-markdown-builder. Existing pins (sphinx-reredirects, sphinx-tags) are preserved.

The rocm-docs-core dependency is now pinned rather than floating: the [llms] extra requires a version that ships the generator, and an unpinned spec would resolve to the latest 1.39.0, whose published wheel has a malformed projects.yaml that breaks the build (already fixed upstream on develop, pending a patch release). Pinning to 1.38.0 avoids that.

Test Plan

  • Regenerated docs/sphinx/requirements.txt with pip-compile under Python 3.12; confirmed the [llms] extra and existing dependencies resolve.
  • Ran a full sphinx-build -b html in a clean python:3.13-slim container (matching the .readthedocs.yaml build Python) with the pinned requirements.
  • Verified llms.txt and llms-full.txt are generated and inspected their content.

Test Result

Build succeeds (build succeeded, 23 warnings) and logs Wrote llms.txt and llms-full.txt. Generated llms.txt (2 KB) has the correct # Network Operator header and indexes all pages; llms-full.txt (157 KB) has correct per-page sections with prose filtering. The 23 warnings are pre-existing, unrelated to this change.

Submission Checklist

Enable llms.txt and llms-full.txt generation from the resolved doctree
via rocm_docs_generate_llms, and add the per-page Markdown download
button. Pin rocm-docs-core to 1.38.0 with the llms extra.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@@ -1,3 +1,3 @@
rocm-docs-core
rocm-docs-core[llms]==1.38.0

@neon60 neon60 Aug 11, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The latest (1.39.0) rocm docs core has some problems. I will try to ask for a fixed release.

@yuva29 yuva29 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR, LGTM! @neon60

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enables generation of llms.txt / llms-full.txt for the Network Operator documentation site using rocm-docs-core’s built-in llms support, and updates the docs build dependencies accordingly.

Changes:

  • Pin rocm-docs-core to 1.38.0 and enable the [llms] extra to pull in sphinx-markdown-builder.
  • Enable rocm_docs_generate_llms = True so Sphinx builds emit llms.txt and llms-full.txt.
  • Enable use_download_button in the docs theme options.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
docs/sphinx/requirements.txt Locks dependency set including rocm-docs-core[llms]==1.38.0 and the new sphinx-markdown-builder dependency.
docs/sphinx/requirements.in Pins rocm-docs-core to 1.38.0 and enables the [llms] extra.
docs/conf.py Turns on llms file generation and enables the per-page download button.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/conf.py
Comment on lines +35 to +39
# Generate llms.txt and llms-full.txt after each build (the llms.txt standard,
# https://llmstxt.org/). See the rocm-docs-core guide:
# https://rocm.docs.amd.com/projects/rocm-docs-core/en/latest/user_guide/llms.html
rocm_docs_generate_llms = True

@yuva29

yuva29 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

@neon60 Please check the copilot review comments, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants