Overview
Docus automatically integratesnuxt-llms to prepare your documentation for Large Language Models (LLMs). This generates /llms.txt and /llms-full.txt files that provide AI-readable summaries and links to your documentation content.
All documentation pages are automatically indexed and included in the generated llms.txt files. No configuration required!
What is llms.txt?
Thellms.txt file is a standardized format for exposing documentation to LLMs. It provides:
- Site metadata - Title, description, and domain
- Page index - List of all documentation pages with titles and descriptions
- Direct links - URLs to each page for the LLM to fetch and read
View the live example: docus.dev/llms.txt
Generated Files
Docus generates two files:/llms.txt
A compact version with essential information:/llms-full.txt
An extended version with additional metadata and more detailed descriptions. This is useful for LLMs that can handle larger context windows.Default Configuration
Docus automatically extracts information from yourpackage.json and deployment environment:
| Field | Source | Example |
|---|---|---|
domain | Deployment platform or NUXT_SITE_URL env var | https://docs.example.com |
title | package.json name | My Documentation |
description | package.json description | A comprehensive guide... |
full.title | package.json name | My Documentation (Full) |
full.description | package.json description | Complete documentation... |
Custom Configuration
Override default values innuxt.config.ts:
nuxt.config.ts
Raw Markdown Access
Whennuxt-llms is enabled, Docus exposes a raw markdown endpoint that provides LLM-optimized content without HTML rendering. This reduces token usage and improves response speed for AI tools.
How It Works
Endpoint pattern:/raw/<content-path>.md
- Use the same path as the page URL
- Drop trailing
/index - Keep the
.mdextension
| Page URL | Raw Markdown URL |
|---|---|
/en/getting-started | /raw/en/getting-started.md |
/en/ai/assistant | /raw/en/ai/assistant.md |
/configuration | /raw/configuration.md |
- Content-Type:
text/markdown; charset=utf-8 - Auto-enrichment: Missing titles/descriptions are automatically prepended
- LLMs.txt integration: Links in
llms.txtpoint to raw markdown by default
Try it: Visit
/raw/en/ai/llms-txt.md to see the raw markdown content.Configuration
Customize raw markdown behavior:nuxt.config.ts
Disable Raw Markdown
To disable raw markdown access entirely:nuxt.config.ts
Markdown Redirection (Vercel)
When deployed on Vercel, Docus automatically configures intelligent routing to serve markdown content to AI agents and CLI tools.Why?
AI agents like Claude Desktop useAccept: text/markdown headers by default. Serving raw markdown instead of rendered HTML saves significant data transfer and token costs.
Detection Methods
Docus detects AI agents and command-line tools using HTTP headers:- Accept header:
Accept: text/markdown→ redirect to markdown - User-agent:
curl/.*→ redirect to markdown
Redirect Rules
| Original Request | Redirects To |
|---|---|
/ | /llms.txt |
/{locale} | /llms.txt |
/{path} | /raw/{path}.md |
Example Usage
Implementation Details
The markdown redirection is configured through Vercel’s routing system during build time. Themarkdown-rewrite module:
- Detects Vercel deployment
- Reads the generated
llms.txtfile - Extracts all documentation URLs
- Creates Vercel routing rules
- Writes rules to
config.json
Advanced Configuration
Custom Content Filtering
Control which pages appear in llms.txt:nuxt.config.ts
Custom URL Generation
Customize how URLs are generated in llms.txt:nuxt.config.ts
Multiple Language Support
For multi-language documentation, llms.txt automatically includes pages from all locales:Integration with AI Assistant
The llms.txt files work seamlessly with Docus’s built-in AI assistant:- Initial Discovery: When an AI tool connects to your docs, it reads
llms.txtto understand structure - Raw Markdown Access: The assistant fetches pages via
/raw/*.mdendpoints for efficient processing - MCP Integration: The MCP server provides programmatic access to the same content
Testing Generated Files
Verify your llms.txt files are generated correctly:Best Practices
Descriptive Titles
Use clear, descriptive page titles that help LLMs understand content at a glance.
Comprehensive Descriptions
Write detailed page descriptions in frontmatter - these appear in llms.txt and help with discovery.
Logical Structure
Organize documentation hierarchically so LLMs can navigate relationships between topics.
Keep Content Updated
The llms.txt files regenerate on each build, ensuring AI tools always see current content.
Troubleshooting
llms.txt Not Generated
If llms.txt isn’t being generated:- Verify
nuxt-llmsis installed (it’s included by default in Docus) - Check that you have content in
content/directory - Run
npm run buildto generate static files - Check build output for any errors
Missing Pages
If some pages aren’t appearing:- Verify pages are in a content collection (not in
public/) - Check that pages have frontmatter with
title - Ensure pages aren’t excluded by custom filters
- Rebuild the site after adding new pages
Raw Markdown 404 Errors
If raw markdown URLs return 404:- Verify
contentRawMarkdownisn’t set tofalse - Check the path matches the content structure
- Ensure the page exists and has been built
- Try accessing the rendered HTML version first
Further Reading
nuxt-llms
Official nuxt-llms module documentation
MCP Server
Learn about the MCP server that complements llms.txt
AI Assistant
See how the assistant uses llms.txt for context
LLMs.txt Standard
Learn about the llms.txt format specification