okineadev/vitepress-plugin-llms

πŸ“œ A VitePress plugin for generating LLM-friendly documentation

TypeScript

403

468 commits

updated Sep 18, 2026

See the code

README

Is this plugin useful for your site? Consider sponsoring the developer to support the project's development 😺

Banner

πŸ“œ vitepress-plugin-llms

NPM Downloads NPM Version Tests Status Built with Bun Formatted with oxfmt sponsor

πŸ› Report bug β€’ Request feature ✨

πŸ“¦ Installation

npm install vitepress-plugin-llms --save-dev

πŸ› οΈ Usage

Add the Vite plugin to your VitePress configuration (.vitepress/config.ts):

import { defineConfig } from 'vitepress'
import llmstxt from 'vitepress-plugin-llms'

export default defineConfig({
  vite: {
    plugins: [llmstxt()],
  },
})

Now, thanks to this plugin, the LLM version of the website documentation is automatically generated

[!NOTE]

For repositories with documentation in other languages: Please do not use this plugin, only English documentation is enough for LLMs.


[!TIP] You can add πŸ“‹ Copy as Markdown and πŸ“₯ Download as Markdown buttons for each page so that visitors can copy the page in Markdown format with just one click!

Screenshot

First, register a global component with buttons in docs/.vitepress/theme/index.ts:

import DefaultTheme from 'vitepress/theme'
import type { Theme } from 'vitepress'
import CopyOrDownloadAsMarkdownButtons from 'vitepress-plugin-llms/vitepress-components/CopyOrDownloadAsMarkdownButtons.vue'

export default {
  extends: DefaultTheme,
  enhanceApp({ app }) {
    app.component('CopyOrDownloadAsMarkdownButtons', CopyOrDownloadAsMarkdownButtons)
  },
} satisfies Theme

And tell VitePress to use an additional Markdown plugin that will insert them:

import { defineConfig } from 'vitepress'
import { copyOrDownloadAsMarkdownButtons } from 'vitepress-plugin-llms'

export default defineConfig({
  // ...
  markdown: {
    config(md) {
      md.use(copyOrDownloadAsMarkdownButtons)
    },
  },
})

If you want to build your own UI instead of using the bundled Vue component, you can consume the shared composable directly:

import { useCopyOrDownloadAsMarkdownButtons } from 'vitepress-plugin-llms/vitepress-components'

Localizing the buttons

The bundled CopyOrDownloadAsMarkdownButtons component reads its labels from VitePress's themeConfig.llms. Add this configuration to .vitepress/config.ts after setting up the component above.

All properties are optional strings:

PropertyDefault valuePurpose
copyTextCopy pageMain copy button
copiedTextCopiedConfirmation after a successful copy
viewMarkdownTextView as MarkdownDropdown item for viewing raw Markdown
openInAITextOpen in {provider}Dropdown items for opening an AI provider

Keep the literal {provider} placeholder in openInAIText: the component replaces it with the provider name, such as ChatGPT or Claude.

For a single-language site, set themeConfig.llms at the top level. For a multilingual site, set locales.<locale>.themeConfig.llms for each language using VitePress's internationalization configuration. For example:

import { defineConfig } from 'vitepress'

export default defineConfig({
  // Keep your existing plugin and Markdown configuration.
  themeConfig: {
    llms: {
      copyText: 'Copy page',
      copiedText: 'Copied',
      viewMarkdownText: 'View as Markdown',
      openInAIText: 'Open in {provider}',
    },
  },
  locales: {
    root: {
      label: 'English',
      lang: 'en',
    },
    es: {
      label: 'EspaΓ±ol',
      lang: 'es',
      themeConfig: {
        llms: {
          copyText: 'Copiar pΓ‘gina',
          copiedText: 'Copiado',
          viewMarkdownText: 'Ver como Markdown',
          openInAIText: 'Abrir en {provider}',
        },
      },
    },
  },
})

To add or update a translation, edit the corresponding locale's themeConfig.llms. VitePress merges locale-specific theme settings with the top-level themeConfig, and the component updates its labels when the active locale changes. Any label that is missing or empty in the resolved configuration falls back to the English default above.


βœ… Good practices

1. Use description in the pages frontmatter

Typically, the list of pages in llms.txt is generated like this:

- [Tailwind v4](/docs/tailwind-v4.md)

As you can see, it's not very clear what's on this page and what it's for

But you can insert description in frontmatter in the docs/tailwind-v4.md file:

---
description: How to use shadcn-vue with Tailwind v4.
---

...

And the link in the generated llms.txt will display the page description:

- [Tailwind v4](/docs/tailwind-v4.md): How to use shadcn-vue with Tailwind v4.

Plugin Configuration

[!NOTE] In most cases you don't need any additional configuration because everything works out of the box, but if you do need to customize it, please see your IDE hints or see src/types.d.ts or Ask DeepWiki

Extended markup for content management

Embedding content specifically for LLMs with <llm-only> tag

You can add a content that will be visible in files for LLMs, but invisible to humans, this can be useful for setting special instructions like "Refer to #basic-queries for demonstrations", "NEVER do ....", "ALWAYS use ... in case of ..." etc.

To do this, you need to wrap content with the <llm-only> tag:

<llm-only>

## Section for LLMs

This content appears only in the generated LLMs files without the `<llm-only>` tag
</llm-only>

Or

Check out the Plugins API Guide for documentation about creating plugins.

<llm-only>Note for LLM...</llm-only>

Excluding content for LLMs with the <llm-exclude> tag

You can add a content that will be visible in files for humans, but invisible to LLMs, opposite of <llm-only>:

<llm-exclude>
## Section for humans

This content will not be in the generated files for LLMs
</llm-exclude>

Or

Check out the Plugins API Guide for documentation about creating plugins.

<llm-exclude>Note only for humans</llm-exclude>

πŸ” Validating the deployed output

This plugin generates a correct llms.txt at build time, but serving-layer config can break it in production: host redirect rules, domain migrations, and docs restructures all bite after the build goes green.

llms-txt-check verifies the deployed file against what your site actually serves (it resolves this plugin's relative URLs against your site's origin automatically):

- run: npx llms-txt-check https://your-docs-site.com

It exits nonzero when the file or any listed URL stops serving, so the deploy that breaks a route goes red.

πŸš€ Why vitepress-plugin-llms?

LLMs (Large Language Models) are great at processing text, but traditional documentation formats can be too heavy and cluttered. vitepress-plugin-llms generates raw Markdown documentation that LLMs can efficiently process

The file structure in .vitepress/dist folder will be as follows:

πŸ“‚ .vitepress/dist
β”œβ”€β”€ ...
β”œβ”€β”€ llms-full.txt            // A file where all the website documentation is compiled into one file
β”œβ”€β”€ llms.txt                 // The main file for LLMs with all links to all sections of the documentation for LLMs
β”œβ”€β”€ markdown-examples.html   // A human-friendly version of `markdown-examples` section in HTML format
└── markdown-examples.md     // A LLM-friendly version of `markdown-examples` section in Markdown format

βœ… Key Features

  • ⚑️ Easy integration with VitePress
  • βœ… Zero config required, everything works out of the box
  • βš™οΈ Customizable
  • πŸ€– An LLM-friendly version is generated for each page
  • πŸ“ Generates llms.txt with section links
  • πŸ“– Generates llms-full.txt with all content in one file

πŸ“– llmstxt.org Standard

This plugin follows the llmstxt.org v2 standard, which defines the best practices for LLM-friendly documentation.

This plugin is used by the most popular projects including Vite, Vue.js, Vitest, Rolldown and many other incredible projects that won't fit on this list

Dependents

Early adopters

Here is a list of less popular but no less cool projects that were the first to pick up this plugin, thereby helping others discover this plugin

Also big thanks to @yyx990803 who agreed to integrate this plugin into all projects of the VoidZero ecosystem, Vue.js and shared about this plugin with the world on X, thanks to which this plugin has gained such popularity πŸ’

❀️ Support

If you like this project, consider supporting it by starring ⭐ it on GitHub, sharing it with your friends, or buying me a coffee β˜•

🀝 Contributing

You can read the instructions for contributing here - CONTRIBUTING.md

πŸ“œ License

MIT License Β© 2025-present Yurii Bogdan

πŸ‘¨β€πŸ­ Contributors

Thank you to everyone who helped with the project!

Contributors

Sponsors

documentation
llmstxt
vite
vite-plugin
vitepress

Contributors

okineadev

353 commits

renovate[bot]

18 commits

okineadev/vitepress-plugin-llms

πŸ“œ A VitePress plugin for generating LLM-friendly documentation

TypeScript

403

468 commits

updated Sep 18, 2026

See the code

README

Is this plugin useful for your site? Consider sponsoring the developer to support the project's development 😺

Banner

πŸ“œ vitepress-plugin-llms

NPM Downloads NPM Version Tests Status Built with Bun Formatted with oxfmt sponsor

πŸ› Report bug β€’ Request feature ✨

πŸ“¦ Installation

npm install vitepress-plugin-llms --save-dev

πŸ› οΈ Usage

Add the Vite plugin to your VitePress configuration (.vitepress/config.ts):

import { defineConfig } from 'vitepress'
import llmstxt from 'vitepress-plugin-llms'

export default defineConfig({
  vite: {
    plugins: [llmstxt()],
  },
})

Now, thanks to this plugin, the LLM version of the website documentation is automatically generated

[!NOTE]

For repositories with documentation in other languages: Please do not use this plugin, only English documentation is enough for LLMs.


[!TIP] You can add πŸ“‹ Copy as Markdown and πŸ“₯ Download as Markdown buttons for each page so that visitors can copy the page in Markdown format with just one click!

Screenshot

First, register a global component with buttons in docs/.vitepress/theme/index.ts:

import DefaultTheme from 'vitepress/theme'
import type { Theme } from 'vitepress'
import CopyOrDownloadAsMarkdownButtons from 'vitepress-plugin-llms/vitepress-components/CopyOrDownloadAsMarkdownButtons.vue'

export default {
  extends: DefaultTheme,
  enhanceApp({ app }) {
    app.component('CopyOrDownloadAsMarkdownButtons', CopyOrDownloadAsMarkdownButtons)
  },
} satisfies Theme

And tell VitePress to use an additional Markdown plugin that will insert them:

import { defineConfig } from 'vitepress'
import { copyOrDownloadAsMarkdownButtons } from 'vitepress-plugin-llms'

export default defineConfig({
  // ...
  markdown: {
    config(md) {
      md.use(copyOrDownloadAsMarkdownButtons)
    },
  },
})

If you want to build your own UI instead of using the bundled Vue component, you can consume the shared composable directly:

import { useCopyOrDownloadAsMarkdownButtons } from 'vitepress-plugin-llms/vitepress-components'

Localizing the buttons

The bundled CopyOrDownloadAsMarkdownButtons component reads its labels from VitePress's themeConfig.llms. Add this configuration to .vitepress/config.ts after setting up the component above.

All properties are optional strings:

PropertyDefault valuePurpose
copyTextCopy pageMain copy button
copiedTextCopiedConfirmation after a successful copy
viewMarkdownTextView as MarkdownDropdown item for viewing raw Markdown
openInAITextOpen in {provider}Dropdown items for opening an AI provider

Keep the literal {provider} placeholder in openInAIText: the component replaces it with the provider name, such as ChatGPT or Claude.

For a single-language site, set themeConfig.llms at the top level. For a multilingual site, set locales.<locale>.themeConfig.llms for each language using VitePress's internationalization configuration. For example:

import { defineConfig } from 'vitepress'

export default defineConfig({
  // Keep your existing plugin and Markdown configuration.
  themeConfig: {
    llms: {
      copyText: 'Copy page',
      copiedText: 'Copied',
      viewMarkdownText: 'View as Markdown',
      openInAIText: 'Open in {provider}',
    },
  },
  locales: {
    root: {
      label: 'English',
      lang: 'en',
    },
    es: {
      label: 'EspaΓ±ol',
      lang: 'es',
      themeConfig: {
        llms: {
          copyText: 'Copiar pΓ‘gina',
          copiedText: 'Copiado',
          viewMarkdownText: 'Ver como Markdown',
          openInAIText: 'Abrir en {provider}',
        },
      },
    },
  },
})

To add or update a translation, edit the corresponding locale's themeConfig.llms. VitePress merges locale-specific theme settings with the top-level themeConfig, and the component updates its labels when the active locale changes. Any label that is missing or empty in the resolved configuration falls back to the English default above.


βœ… Good practices

1. Use description in the pages frontmatter

Typically, the list of pages in llms.txt is generated like this:

- [Tailwind v4](/docs/tailwind-v4.md)

As you can see, it's not very clear what's on this page and what it's for

But you can insert description in frontmatter in the docs/tailwind-v4.md file:

---
description: How to use shadcn-vue with Tailwind v4.
---

...

And the link in the generated llms.txt will display the page description:

- [Tailwind v4](/docs/tailwind-v4.md): How to use shadcn-vue with Tailwind v4.

Plugin Configuration

[!NOTE] In most cases you don't need any additional configuration because everything works out of the box, but if you do need to customize it, please see your IDE hints or see src/types.d.ts or Ask DeepWiki

Extended markup for content management

Embedding content specifically for LLMs with <llm-only> tag

You can add a content that will be visible in files for LLMs, but invisible to humans, this can be useful for setting special instructions like "Refer to #basic-queries for demonstrations", "NEVER do ....", "ALWAYS use ... in case of ..." etc.

To do this, you need to wrap content with the <llm-only> tag:

<llm-only>

## Section for LLMs

This content appears only in the generated LLMs files without the `<llm-only>` tag
</llm-only>

Or

Check out the Plugins API Guide for documentation about creating plugins.

<llm-only>Note for LLM...</llm-only>

Excluding content for LLMs with the <llm-exclude> tag

You can add a content that will be visible in files for humans, but invisible to LLMs, opposite of <llm-only>:

<llm-exclude>
## Section for humans

This content will not be in the generated files for LLMs
</llm-exclude>

Or

Check out the Plugins API Guide for documentation about creating plugins.

<llm-exclude>Note only for humans</llm-exclude>

πŸ” Validating the deployed output

This plugin generates a correct llms.txt at build time, but serving-layer config can break it in production: host redirect rules, domain migrations, and docs restructures all bite after the build goes green.

llms-txt-check verifies the deployed file against what your site actually serves (it resolves this plugin's relative URLs against your site's origin automatically):

- run: npx llms-txt-check https://your-docs-site.com

It exits nonzero when the file or any listed URL stops serving, so the deploy that breaks a route goes red.

πŸš€ Why vitepress-plugin-llms?

LLMs (Large Language Models) are great at processing text, but traditional documentation formats can be too heavy and cluttered. vitepress-plugin-llms generates raw Markdown documentation that LLMs can efficiently process

The file structure in .vitepress/dist folder will be as follows:

πŸ“‚ .vitepress/dist
β”œβ”€β”€ ...
β”œβ”€β”€ llms-full.txt            // A file where all the website documentation is compiled into one file
β”œβ”€β”€ llms.txt                 // The main file for LLMs with all links to all sections of the documentation for LLMs
β”œβ”€β”€ markdown-examples.html   // A human-friendly version of `markdown-examples` section in HTML format
└── markdown-examples.md     // A LLM-friendly version of `markdown-examples` section in Markdown format

βœ… Key Features

  • ⚑️ Easy integration with VitePress
  • βœ… Zero config required, everything works out of the box
  • βš™οΈ Customizable
  • πŸ€– An LLM-friendly version is generated for each page
  • πŸ“ Generates llms.txt with section links
  • πŸ“– Generates llms-full.txt with all content in one file

πŸ“– llmstxt.org Standard

This plugin follows the llmstxt.org v2 standard, which defines the best practices for LLM-friendly documentation.

This plugin is used by the most popular projects including Vite, Vue.js, Vitest, Rolldown and many other incredible projects that won't fit on this list

Dependents

Early adopters

Here is a list of less popular but no less cool projects that were the first to pick up this plugin, thereby helping others discover this plugin

Also big thanks to @yyx990803 who agreed to integrate this plugin into all projects of the VoidZero ecosystem, Vue.js and shared about this plugin with the world on X, thanks to which this plugin has gained such popularity πŸ’

❀️ Support

If you like this project, consider supporting it by starring ⭐ it on GitHub, sharing it with your friends, or buying me a coffee β˜•

🀝 Contributing

You can read the instructions for contributing here - CONTRIBUTING.md

πŸ“œ License

MIT License Β© 2025-present Yurii Bogdan

πŸ‘¨β€πŸ­ Contributors

Thank you to everyone who helped with the project!

Contributors

Sponsors

documentation
llmstxt
vite
vite-plugin
vitepress

Contributors

okineadev

353 commits

renovate[bot]

18 commits

Languages

TypeScript

96.4%

Vue

3.5%