# llms.txt file format: syntax and rules

> The llms.txt format under v2 of the proposal: the one required heading, the order of parts, link lists, files in subpaths, Markdown page versions, and what is left out

Page: https://llms-full-txt.ru/en/specification/format/
Site index: https://llms-full-txt.ru/en/llms.txt

`llms.txt` is a Markdown file that lives on a site and helps agents and language models find the content they need. An agent scans the file, picks the links that fit and follows them. The file itself stays small; the details sit behind the links.

It is a proposal by one author, not an IETF or W3C standard. The file does not control access: that is the job of `robots.txt`.

- Edition: v2, August 10, 2026
- Author: Jeremy Howard, Answer.AI
- Format: Markdown
- Required part: the H1 heading only

What changed since the first edition is on the [Changes in v2](https://llms-full-txt.ru/en/specification/changes/) page.

## How an agent uses the file

- From a question to the right page
- Site
- publishes the file at a known address
- llms.txt
- /llms.txt
- name, description, lists of links
- Agent
- picks links for its question
- Markdown page
- /docs/page.md
- clean text without layout
- Context
- only what the answer needs

## A minimal file

One line with a heading is enough to conform to the proposal. In practice the minimum looks like this:

```markdown title="llms.txt"
# Project name

> One or two sentences: what it is and who it is for

## Documentation

- [Quick start](https://example.com/quickstart.md): first steps in five minutes
```

## What the file consists of

The parts come in a strict order. Only the first one is required.

- llms.txt
- five parts in order
- H1 heading

```
# FastHTML
```

- The name of the project or site. Without it the file does not conform to the proposal. There is one heading.
- Description

```
> FastHTML is a Python library for
> server-rendered web apps built on HTMX.
```

- A blockquote with a short description: what the rest of the file cannot be understood without.
- Details

```
Important:
- the syntax is not compatible with FastAPI
- React, Vue and Svelte are not supported
```

- Any Markdown blocks except headings: paragraphs, lists, code.
- Section with links

```
## Documentation
- [Quick start](https://example.com/quickstart.md): first steps
- [API reference](https://example.com/api.md)
```

- An H2 heading and a list. An item is a link and an optional note after a colon.
- Optional section

```
## Optional
- [Changelog](https://example.com/changelog.md)
```

- A convention for secondary links: an agent may skip them when it needs a shorter context.

:::note
There must be no headings between the description and the first H2 section. The `Optional` section has no special mechanical meaning in the [second edition](https://llmstxt.org/). More in [Sections and structure](https://llms-full-txt.ru/en/specification/sections/).
:::

Links should lead to content that suits a model: Markdown versions of pages first of all. External addresses are fine when they help to understand the material.

## Where the file lives

The file can sit in the site root or in any subpath. The second edition defines what that means.

- llms.txt covers the whole site
- docs/
  - **llms.txt** covers everything in /docs/
  - guide.html
  - api/
    - **llms.txt** covers everything in /docs/api/
    - users.html
- blog/
  - post.html

- Which file an agent takes
- Page
- /docs/api/users.html
- Three files apply
- root, /docs/ and /docs/api/
- The most specific one wins
- /docs/api/llms.txt
- Page
- /blog/post.html
- One file applies
- /blog/ has no file of its own
- The root file is used
- /llms.txt

The author of the proposal rejected a `/.well-known/` address: such addresses exist only at the domain root, while `llms.txt` describes the path it sits in.

## Markdown versions of pages

The proposal suggests serving a clean Markdown version of a page next to the regular one. Two address forms are allowed.

| Page | First form | Second form |
|---|---|---|
| `/page.html` | `/page.html.md` | `/page.md` |
| `/docs/` | `/docs/index.html.md` | `/docs/index.md` |

## How an agent finds the files

The second edition recommends two standard relations. The first leads from a page to its Markdown version, the second to the `llms.txt` that covers the page.

- Two relations for discovery
- rel="alternate"
- type text/markdown
- HTML page
- /docs/page.html
- Markdown version
- /docs/page.html.md
- rel="describedby"
- HTML page
- /docs/page.html
- llms.txt of the section
- /docs/llms.txt

The relations can be sent in the page markup or in a response header. The second way also works for files that are not HTML.

**HTML**

```html title="page.html"
<link rel="alternate" type="text/markdown" href="/docs/page.html.md">
<link rel="describedby" href="/docs/llms.txt">
```

**HTTP header**

```http title="Server response"
Link: </docs/page.html.md>; rel="alternate"; type="text/markdown", </docs/llms.txt>; rel="describedby"
```

**nginx**

```nginx title="nginx.conf"
location = /docs/page.html {
    add_header Link '</docs/page.html.md>; rel="alternate"; type="text/markdown", </docs/llms.txt>; rel="describedby"';
}
```

## What the proposal does not include

Many sites publish `llms-full.txt` and `llms-small.txt`, and it is a useful practice. But the proposal cannot be cited as its source.

- The index and the full text
- llms.txt
- a map: where to go
- name -> description -> links
- Described in the proposal
- Small: fits into the context as a whole
- The content sits behind the links
- llms-full.txt
- a corpus: everything in one file
- page -> page -> page
- Not in the proposal: a practice of docs platforms
- Can be very large: 67 MB at Cloudflare
- Handy when the whole text is needed without hops

| What | Status |
|---|---|
| `llms-small.txt` | not in the proposal; a shortened version of the full text |
| `llms-ctx.txt`, `llms-ctx-full.txt` | were tied to the `llms_txt2ctx` tool; removed from the second edition |
| Access control | the file forbids nothing; `robots.txt` does that |
| Security rules | the proposal text has none; the question is discussed in the repository |

## A full example

```markdown title="llms.txt" {1} {3-4} {13-15}
# FastHTML

> FastHTML is a Python library for server-rendered web apps
> built on HTMX.

Important:

- the syntax is not compatible with FastAPI
- React, Vue and Svelte are not supported

## Documentation

- [Quick start](https://example.com/quickstart.md): first steps in five minutes
- [API reference](https://example.com/api.md): all methods and parameters

## Optional

- [Changelog](https://example.com/changelog.md)
- [Contributing](https://example.com/contributing.md)
```

Three places are highlighted, the ones an agent looks at first: the name, the description and the main links.

## Parsing the file

The format is made for simple processing: regular expressions are enough.

```python title="parse_llms_txt.py"
import re

def parse_llms_txt(content: str) -> dict:
    result = {'title': '', 'description': '', 'sections': {}}

    h1 = re.search(r'^# (.+)$', content, re.MULTILINE)
    if h1:
        result['title'] = h1.group(1)

    quote = re.search(r'^> (.+)$', content, re.MULTILINE)
    if quote:
        result['description'] = quote.group(1)

    section = None
    for line in content.split('\n'):
        if line.startswith('## '):
            section = line[3:].strip()
            result['sections'][section] = []
        elif line.startswith('- [') and section:
            link = re.match(r'- \[(.+?)\]\((.+?)\)(?:: (.+))?', line)
            if link:
                result['sections'][section].append({
                    'title': link.group(1),
                    'url': link.group(2),
                    'notes': link.group(3) or '',
                })

    return result
```

## Validation

1. The file opens at its address with status 200 and is served as text, not as an HTML page.
2. The first heading is H1, and there is only one.
3. There are no headings between the description and the first section.
4. Every link opens.
5. Links lead to content that suits a model.

A detailed list and typical mistakes are in [Best practices](https://llms-full-txt.ru/en/guides/best-practices/).
