Skip to main content
The llms.txt format is a standardized way to represent website content for Large Language Model consumption. This guide explains the specification and how the llms.txt Generator implements it.

What is llms.txt?

llms.txt is a lightweight, human-readable format for describing website content in a way that’s optimized for LLM understanding. It’s similar in spirit to robots.txt or sitemap.xml, but designed specifically for AI consumption. Learn more at llmstxt.org

Format Overview

An llms.txt file is a Markdown document with a specific structure:
Structure

Specification Components

1. Header Section

Implementation Details:
1

Extract site title

The generator uses the homepage <title> tag as the site name.
formatter.py:75-84
If the title is generic (“Home”, “Welcome”), it derives a title from the domain name.
2

Generate site description

The description comes from the homepage’s meta description or OpenGraph tags.
formatter.py:86-88
Fallback priority:
  1. <meta name="description">
  2. <meta property="og:description">
  3. First paragraph of body text
  4. “No description available”

2. Section Organization

Content is organized into sections based on URL structure:
Section Example
Implementation Details:
1

Extract sections from URLs

Sections are derived from the first path segment:
formatter.py:124-128
Examples:
  • https://example.com/docs/intro → “docs” section
  • https://example.com/api/users → “api” section
  • https://example.com/about → “about” section
2

Clean section names

Section names are formatted for readability:
formatter.py:90-103
Transformations:
  • api-reference → “API Reference”
  • getting_started → “Getting Started”
  • faq → “FAQ”
3

Separate primary and secondary content

Secondary content (privacy, terms, etc.) is grouped into an “Optional” section:
formatter.py:7-14

3. Page Entries

Each page is represented as a list item with:
  • Title (linked to URL)
  • Description
  • Optional tags
Page Entry Format
Implementation Details:
1

Format URLs

URLs are cleaned and prefer Markdown versions when available:
formatter.py:16-31
The generator checks if .md versions exist via HEAD requests and prefers them for better LLM parsing.
2

Extract and truncate descriptions

Descriptions are extracted from page metadata and truncated:
formatter.py:69-73
Default truncation:
  • Section descriptions: 150 characters
  • Site summary: 200 characters
3

Assign content tags

Tags are automatically assigned based on page content:
tagger.py:4-23
Tag categories:
  • Content Type: API, Guide, Reference, Example, SDK, CLI, Blog, Changelog
  • Complexity: Beginner, Advanced
  • Topic: Security, Performance, Integration, Troubleshooting

4. Optional Section

Secondary pages are grouped at the end without descriptions:
Optional Section
Implementation:
formatter.py:146-173

Complete Example

llms.txt

Specification Compliance

The generator adheres to the official llmstxt.org specification:
All output is valid Markdown that can be parsed by standard Markdown processors.
  • Uses standard heading syntax (#, ##)
  • Uses standard link syntax ([text](url))
  • Uses standard list syntax (-)
  • Uses standard blockquote syntax (>)
Content is organized in a clear hierarchy:
  1. Site title (H1)
  2. Site description (blockquote)
  3. Sections (H2)
  4. Pages (list items)
Pages are grouped logically:
  • Primary content by URL structure
  • Secondary content in “Optional” section
  • Alphabetically sorted within sections
URLs are normalized and cleaned:
  • Query parameters removed
  • Fragments removed
  • Prefers .md versions when available
  • Uses HTTPS when available
Descriptions are truncated at semantic boundaries:
  • Truncates at word boundaries (not mid-word)
  • Adds ellipsis when truncated
  • Configurable length limits
Pages include contextual metadata:
  • Content type tags (API, Guide, etc.)
  • Complexity tags (Beginner, Advanced)
  • Topic tags (Security, Performance, etc.)

Best Practices

Keep Descriptions Concise

Descriptions should be 100-200 characters. The generator enforces this automatically.

Use Semantic Sections

Organize content by user journey (Getting Started, Guides, API Reference) rather than technical structure.

Include Key Pages

Prioritize documentation, guides, and API references over marketing pages.

Update Regularly

Use auto-update to keep llms.txt synchronized with website changes.

Customization

While the specification is standardized, you can customize the generator’s behavior:

Section Patterns

Modify secondary content detection:
formatter.py:7-14

Tag Patterns

Add custom tag detection:
tagger.py:4-23

Truncation Limits

Adjust description lengths:
formatter.py:135-136

Validation

Validate your llms.txt file:
1

Check Markdown syntax

Validate with markdownlint
2

Verify link accessibility

Check links
3

Test LLM parsing

Ask an LLM to summarize your llms.txt:

FAQ

Markdown is:
  • Human-readable and editable
  • LLM-friendly (models train on Markdown)
  • Version control friendly
  • Simpler than structured formats
Sitemaps are for search engine crawlers. llms.txt is optimized for LLM understanding:
  • Includes descriptions and context
  • Organized by user journey
  • Includes content type hints
  • Filters out irrelevant pages
Yes! The generator provides a starting point. You can:
  • Reorder sections
  • Edit descriptions
  • Add/remove pages
  • Customize tags
Consider using auto-update with caution if you make manual edits.
No. Focus on content valuable to LLMs:
  • Documentation and guides
  • API references
  • Conceptual content
  • Examples and tutorials
Exclude:
  • Marketing pages
  • Legal pages (or put in Optional)
  • Duplicate content
  • Internal tools/admin pages

Resources

llmstxt.org

Official specification and guidelines

Example Sites

Real-world llms.txt implementations

Formatter Code

Implementation details in the codebase

Web Interface

Generate your own llms.txt file

Next Steps

Generate Your First File

Create an llms.txt file in minutes

API Usage

Integrate programmatically

Configuration

Customize the generator behavior

Development

Contribute to the project