---
title: "LLMs Integration"
description: "Docus generate AI-ready content files using Nuxt LLMs module"
canonical_url: "https://docus.dev/en/ai/llms"
---
# LLMs Integration

> Docus generate AI-ready content files using Nuxt LLMs module

Docus 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.

<note to="https://docus.dev/llms.txt">

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

</note>

## 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` :

```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',
    },
  },
})
```

### Guiding agents

Your pages tell an agent what your product does. They rarely tell it *when* to reach for you, which is what an agent needs before recommending you. Two options cover that:

- `sections` adds a group of links on top of the generated page list, for resources that live outside your content (a repository, a package, an API reference)
- `notes` adds a `## Notes` block at the end of the document, the right place for when-to-use guidance

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  llms: {
    domain: 'https://your-site.com',
    sections: [
      {
        title: 'Developer Resources',
        description: 'Machine-readable entry points for this documentation.',
        links: [
          { title: 'Source on GitHub', description: 'Issues and releases.', href: 'https://github.com/your-org/your-repo' },
        ],
      },
    ],
    notes: [
      'When to use this library: you are building X and want Y.',
      'This library is not a replacement for Z. For that, use W instead.',
      'Reading this documentation as an agent: append `.md` to any page URL, or send `Accept: text/markdown`.',
    ],
  },
})
```

## Agent-friendly 404s

Instead of replying with a JSON error body, Docus replies with a short markdown document, listing the machine-readable entry points your site actually serves:

```bash
curl -H "Accept: text/markdown" https://docus.dev/en/does-not-exist
```

```md
---
title: "Page Not Found"
status: 404
---

# 404 Page Not Found

The page `/en/does-not-exist` does not exist on https://docus.dev.

## Where to look next

- [API catalog: every service document this site publishes](https://docus.dev/.well-known/api-catalog)
- [Sitemap (Markdown): every page on the site](https://docus.dev/sitemap.md)
- [MCP server card: MCP endpoint at https://docus.dev/mcp](https://docus.dev/.well-known/mcp/server-card.json)
- [MCP endpoint (streamable HTTP)](https://docus.dev/mcp)
- [llms.txt: index of the documentation for LLMs](https://docus.dev/llms.txt)
- [llms-full.txt: the full documentation as a single file](https://docus.dev/llms-full.txt)
- [Agent skills index: every skill published by this site](https://docus.dev/.well-known/skills/index.json)
- [Agent skill: create-docs](https://docus.dev/.well-known/skills/create-docs/SKILL.md)
- [Agent skill: review-docs](https://docus.dev/.well-known/skills/review-docs/SKILL.md)
- [Sitemap (XML): every page, with its last modification date](https://docus.dev/sitemap.xml)

## Fetching markdown

Any documentation page is available as markdown: append `.md` to its URL
or send `Accept: text/markdown`.
```

The links come from the same registry as the `Link` header of your homepage and `/.well-known/api-catalog`, so the document never points at a route that does not exist: the skills entries only appear when your site [publishes skills](https://docus.dev/en/ai/skills), and `/llms-full.txt` only when it is enabled.

The response keeps the `404` status and is served as `text/markdown; charset=utf-8` with `Vary: Accept, User-Agent`, so CDNs never mix it up with the HTML variant.

Only clients that clearly aren't rendering HTML get this document. Untouched:

- **Browsers**: any request accepting `text/html` still renders the theme error page
- **API clients**: requests accepting `application/json`, or under `/api/` and `/mcp`, keep the default JSON error body
- **fetch() and $fetch**: browser-initiated requests keep the default JSON error body, so `error.data` stays parseable

To restore the default error body:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  agentDiscovery: {
    errors: false,
  },
})
```

## Raw Markdown Access

Docus exposes a raw markdown endpoint so AI agents can fetch LLM-ready source files without going through the full rendering pipeline. This reduces token usage and improves response speed for AI-powered tools consuming your documentation.

### How it works

- **Endpoint**: `/raw/<content-path>.md`, the same path as the page URL with the `.md` extension
- **Content-Type**: `text/markdown; charset=utf-8`, with a `Link` header pointing back at the HTML page
- **Frontmatter**: every document opens with its `title`, `description` and `canonical_url`, and same-origin links are absolute, so a page still makes sense once it has been read away from your site
- **Sections**: a path naming a section rather than a page (`/raw/en/getting-started.md`) redirects to the first document of that section
- **LLMs.txt integration**: document links in `llms.txt` are automatically rewritten to the `/raw/...md` endpoint, so agents fetch compact markdown instead of full HTML

<note to="https://docus.dev/raw/en/ai/llms.md">

Try accessing the raw Markdown version of this page.

</note>

### Configuration

Every page has a markdown twin by default. To keep a part of your site out of it, a page tree without markdown or a standalone `.md` document you serve yourself, extend `excludePrefixes`. An excluded path never negotiates, is listed nowhere and answers a 404 on the raw endpoint:

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  agentDiscovery: {
    excludePrefixes: {
      extend: ['/admin'],
    },
  },
})
```

## Markdown Negotiation

Docus serves markdown to AI agents and CLI tools asking for it, on the same URL as the HTML page.

### Why?

Agents like Claude Code send `Accept: text/markdown` by default. Answering with raw Markdown saves a lot of data transfer and tokens in the process.

### How?

A request gets markdown when:

- its URL ends with `.md`: `/en/ai/llms.md` is the markdown twin of `/en/ai/llms`
- its `Accept` header prefers `text/markdown` over `text/html`
- its `User-Agent` is a known AI agent (`ClaudeBot`, `GPTBot`, `PerplexityBot` and the others from the [ai.robots.txt](https://github.com/ai-robots-txt/ai.robots.txt) list)

Then:

- **Root path**: `/` → `/raw/index.md`, your landing page when it is a content document or a generated index when it is a Vue page, both ending with the list of everything this site publishes for agents
- **Documentation pages**: `/{path}` → `/raw/{path}.md`

Negotiation runs in development and on every host through a Nitro middleware. On Vercel it also runs at the edge, so prerendered pages answer in markdown before the CDN cache sees the request. On other hosts a prerendered page is served ahead of the middleware and stays HTML: agents reach its markdown through the `.md` URL.

### Example Usage

```bash
# Get the agent index from the homepage
curl -H "Accept: text/markdown" https://docus.dev/

# Get raw markdown for a documentation page
curl -H "Accept: text/markdown" https://docus.dev/en/ai/llms

# Same page, through its markdown twin URL
curl https://docus.dev/en/ai/llms.md
```

All these commands will return markdown content instead of HTML.

### Caching

The same URL answers in HTML or markdown depending on the request, so every response carries `Vary: Accept, User-Agent`. Without it a CDN could serve the HTML variant to an agent asking for markdown, or the reverse, depending on which one landed in the cache first.

```bash
curl -sI -H "Accept: text/markdown" https://docus.dev/en/ai/llms | grep -i vary
# vary: Accept, User-Agent
```

## Discovery

An agent landing on your site can find everything it publishes without reading the docs:

- `/.well-known/api-catalog`: every service document this site publishes ([RFC 9727](https://www.rfc-editor.org/rfc/rfc9727)), also advertised in the `Link` header of your homepage
- `/openapi.json`: an OpenAPI document describing the markdown routes, the discovery documents and the MCP endpoint
- `/sitemap.md`: a markdown index of every page, grouped by section, one per locale on a multilingual site
- `/.well-known/mcp/server-card.json`: the [MCP server](https://docus.dev/en/ai/mcp) endpoint and the tools it exposes
- `/.well-known/skills/index.json`: the [agent skills](https://docus.dev/en/ai/skills) you publish
- `/robots.txt`: a group allowing each known AI agent, with a `Content-Signal` line

All of this is provided by the [`nuxt-agent-discovery`](https://github.com/benjamincanac/nuxt-agent-discovery) module and configured under the `agentDiscovery` key of your `nuxt.config.ts`.

<tip to="https://github.com/benjamincanac/nuxt-agent-discovery">

Checkout the nuxt-agent-discovery documentation for every option.

</tip>

<tip to="https://github.com/nuxt-content/nuxt-llms">

Checkout the nuxt-llms documentation for more information about the module.

</tip>


## Sitemap

See the full [sitemap](https://docus.dev/sitemap.md) for all pages.
