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

## Raw Markdown Access

When `nuxt-llms` is enabled, Docus also 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` — use the same path as the page URL, drop trailing `/index`, and keep the `.md` extension
- **Content-Type**: `text/markdown; charset=utf-8`
- **Auto-enrichment**: if the requested document is missing a top-level heading or description, the route automatically prepends the title and description to the markdown body
- **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="/raw/en/ai/llms.md">

Try accessing the raw Markdown version of this page.

</note>

### Configuration

You can customize the raw markdown behavior from your `nuxt.config.ts`:

```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 raw markdown access entirely:

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

## Markdown Redirection

<note>

This feature is only available when Docus is deployed on Vercel. We'll be able to make it agnostic once Nitro v3 supports global rewrites for multi vendors.

</note>

When deployed on Vercel, Docus 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, retuning raw Markdown is saving lots of data transfer and tokens in the process.

### How?

Docus 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}` → `/raw/{path}.md`

### Example Usage

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

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

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

All these commands will return markdown content instead of HTML.

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

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

</tip>
