TockDocs LogoTockDocs
AI

LLMs Integration

TockDocs generate AI-ready content files using Nuxt LLMs module

TockDocs integrates nuxt-llms by default to prepare your content for Large Language Models (LLMs). All your documentation pages are injected and /llms.txt and /llms-full.txt files are automatically generated and pre-rendered.

Have a check at the /llms.txt file generated for TockDocs documentation itself.

Defaults

Here are the default values use to generate the /llms.txt file:

  • domain → computed based on your deployment platform (or by using NUXT_SITE_URL env variable)
  • title → extracted from your package.json
  • description → extracted from your package.json
  • full.title → extracted from your package.json
  • full.description → extracted from your package.json

Customize

You can override your LLMs data from the nuxt.config.ts :

nuxt.config.ts
export default defineNuxtConfig({
  llms: {
    domain: 'https://your-site.com',
    title: 'Your Site Name',
    description: 'A brief description of your site',
    full: {
      title: 'Your Site Name',
      description: 'A brief description of your site',
    },
  },
})

Raw Markdown Access

When nuxt-llms is enabled, TockDocs exposes the original source markdown/MDC through canonical .md page URLs, so AI tools can avoid the verbose post-processed output.

How it works

  • Direct page alias: append .md to supported documentation page URLs to open the original pre-processed markdown/MDC source, for example /docs/manual/en/ai/llms.md or /en/getting-started/installation.md
  • Canonical markdown URL: append .md to a page route to get the original markdown/MDC source
  • Compatibility aliases: /source/<page-route>.md and /raw/<content-path>.md still resolve to the same original source markdown for older integrations
  • Content-Type: text/markdown; charset=utf-8
  • LLMs.txt integration: document links in llms.txt are automatically rewritten to .md page URLs, so agents fetch the original markdown/MDC instead of full HTML
Examples for this page:
  • Direct URL alias: /docs/manual/en/ai/llms.md
  • Compatibility source alias: /source/docs/manual/en/ai/llms.md
  • Compatibility raw alias: /raw/docs/manual/en/ai/llms.md

Configuration

You can customize the legacy nuxt-llms raw endpoint from your nuxt.config.ts:

nuxt.config.ts
export default defineNuxtConfig({
  llms: {
    contentRawMarkdown: {
      // Prevent specific page collections from being exposed
      excludeCollections: ['landing', 'landing_en', 'landing_fr'],
      // Keep llms.txt links pointing to rendered pages instead of raw markdown
      rewriteLLMSTxt: false,
    },
  },
})

To disable the legacy raw endpoint entirely:

nuxt.config.ts
export default defineNuxtConfig({
  llms: {
    contentRawMarkdown: false,
  },
})

Markdown Redirection

Direct .md page URLs work in every environment. This section is only about the automatic header-based markdown redirects that TockDocs adds on Vercel.

When deployed on Vercel, TockDocs automatically configures intelligent routing to serve markdown content to AI agents and CLI tools.

Why?

Agents like Claude Code use Accept: text/markdown headers by default, so returning source Markdown saves lots of data transfer and tokens in the process.

How?

TockDocs detects requests from AI agents and command-line tools using HTTP headers:

  • Accept header: Requests with Accept: text/markdown are automatically redirected
  • User-agent detection: curl requests as agents are automatically redirected

Redirect Rules

  • Root path: //llms.txt
  • Documentation pages: /{path}/{path}.md

Example Usage

# Open the source markdown directly with the page URL
curl https://tockdocs.dev/docs/manual/en/ai/llms.md

# Get llms.txt from homepage
curl -H "Accept: text/markdown" https://tockdocs.dev/

# Get llms.txt from locale homepage
curl -H "Accept: text/markdown" https://tockdocs.dev/en

# Get source markdown for a documentation page
curl -H "Accept: text/markdown" https://tockdocs.dev/docs/manual/en/ai/llms

All these commands will return markdown content instead of HTML.

Check out the nuxt-llms documentation for more information about the module.
Copyright © 2026