How to Create an llms.txt File: Template and Examples

Create an llms.txt file in 15 minutes: the required sections, a copy-paste template, real examples from documentation sites and how to validate the result.

· BugViso Team

15 min read

How to create llms.txt: write a Markdown file that starts with an H1 naming your site, add a one-line blockquote summary, then list your most useful pages under H2 headings as - [Title](https://url): description lines, and serve it as plain text at /llms.txt. The H1 is the only part the llms.txt proposal requires; everything else makes the file worth reading.

It's a proposal, not a standard. In our crawl of 219 random homepages in October 2026, 12.8 % served a valid llms.txt, and no major AI search engine has confirmed it reads the file for ranking or citation. Treat it as cheap, optional hygiene after crawler access and server-rendered content are fixed.

By the end you'll have a template for your type of site, server and build setups that keep the file current, and a script that validates it and scores it out of 100.

What an llms.txt File Must Contain, in Order

The proposal defines five parts in a fixed order, and only the first is required.

  1. An H1 with the project or site name. # Acme Analytics. One H1, on the first line.
  2. A blockquote summary (optional). One or two sentences with the context a model needs to read the rest: what the product is, who it's for.
  3. Detail sections (optional). Paragraphs or lists, but no headings, explaining the project or how to use the links.
  4. File-list sections (optional). Each starts with an H2 and contains list items in the form - [name](url), optionally followed by : notes.
  5. An ## Optional section (by convention). Secondary links "an agent can skip when a shorter context is needed".

Three rules that aren't in the bullet list but trip people up:

  • The link is required in every list item. A bare line like - Pricing page is malformed.
  • Use absolute https:// URLs. The proposal doesn't forbid relative ones, but a tool that copies one line into a prompt loses the host.
  • The file can live below the root. The proposal allows /docs/llms.txt, covering URLs under that path, and says agents should use the most specific file. Put one at the root anyway; it's where tools look first.

The proposal also suggests a Markdown copy of each important page at the same URL plus .md (/docs/setup.md), linked with rel="alternate" type="text/markdown". That's a bigger job; the index file comes first.

Copy-Paste llms.txt Templates

Pick the template closest to your site, then replace every line; a template left half-edited is worse than no file.

Template 1: SaaS product

markdown
# Acme Analytics

> Acme Analytics is a product analytics tool for B2B SaaS teams. It tracks feature adoption and retention from your existing event data, with plans from $49/month.

Acme is used by product managers and growth teams. Pricing, limits and integrations below are current; the changelog lists what changed and when.

## Product
- [Pricing and plans](https://acme.example/pricing): Plan prices, seat and event limits, and what the free trial includes.
- [Features](https://acme.example/features): Funnels, retention cohorts, feature adoption and alerts, with what each plan covers.
- [Integrations](https://acme.example/integrations): Supported data sources (Segment, Snowflake, BigQuery) and setup time for each.

## Docs
- [Quickstart](https://acme.example/docs/quickstart): Send the first event and see it in a dashboard.
- [Data model](https://acme.example/docs/data-model): Events, users, accounts and how they join.

## Optional
- [Changelog](https://acme.example/changelog): Dated release notes.
- [Security](https://acme.example/security): Data handling, retention and sub-processors.

The summary states the facts AI answers get wrong most often: what it is, who it's for, the starting price. If those live only in a pricing widget, the file is where a tool can still find them.

Template 2: Technical blog or publisher

markdown
# Example Engineering Blog

> Engineering tutorials on distributed systems, databases and web performance, written by the platform team.

## Guides
- [Distributed caching patterns](https://example.com/blog/distributed-caching-patterns): Cache-aside, write-through and Redis clustering, with failure cases.
- [Connection pooling](https://example.com/blog/database-connection-pooling): PgBouncer modes and pool sizing for serverless functions.
- [Page speed checklist](https://example.com/blog/page-speed-checklist): Front-end and server fixes in order of impact.

## Case studies
- [Scaling to 100k requests per second](https://example.com/cases/scaling-100k-rps): Post-mortem of a traffic spike and the changes that followed.

Template 3: Open-source library

markdown
# FastSchema

> Zero-dependency runtime schema validation for JavaScript and TypeScript.

## Docs
- [Installation](https://example.com/docs/installation): npm, pnpm and yarn install, and supported runtimes.
- [Core API](https://example.com/docs/core-api): Validators for strings, numbers, objects and arrays.
- [Type inference](https://example.com/docs/type-inference): Generating static types from runtime schemas.

## Optional
- [Full documentation](https://example.com/llms-full.txt): Every docs page in one Markdown file.

Should You Also Publish llms-full.txt?

Only if you have documentation a developer would paste into a coding assistant. llms-full.txt isn't part of the proposal; it's a convention some documentation platforms adopted: every docs page concatenated into one Markdown file, so a tool can load it in one request.

It helps when the reader is a developer working against your API in an editor with an AI assistant. It does little for a marketing site. If you publish one, generate it at build time from the same source as your docs, link it from the ## Optional section, and keep it in sync; a stale full-text file gives an assistant outdated code with no warning.

How to Create llms.txt and Serve It Correctly

Save the file in your web root, serve it as UTF-8 plain text with a 200, and check it from outside.

  1. Save it where your server or framework serves static files from the root, for example public/llms.txt.
  2. Set the headers. Content-Type: text/plain; charset=utf-8 (or text/markdown), no redirect, and a short cache so edits show up.
  3. Make sure robots.txt doesn't block it. A broad Disallow: /*.txt$ blocks it for every crawler that follows RFC 9309. Our guide on checking AI crawler access in robots.txt shows how to test the path.
  4. Test it: curl -sI https://example.com/llms.txt should show 200 and a text/plain content type.

Nginx

nginx
# .txt already maps to text/plain in mime.types; add the charset and a short cache.
location = /llms.txt {
    charset utf-8;
    add_header Cache-Control "public, max-age=3600";
    add_header Access-Control-Allow-Origin "*";   # lets browser-based tools fetch it
}

Don't add a second Content-Type with add_header: Nginx would send two, and some clients reject that. The charset directive appends charset=utf-8 to the existing type instead.

Next.js App Router, generated at build time

typescript
// app/llms.txt/route.ts
import { getAllArticles } from "@/lib/content";

export const dynamic = "force-static"; // render once at build; works with output: 'export'

export async function GET() {
  const articles = await getAllArticles();
  const lines = [
    "# Example Engineering Blog",
    "",
    "> Engineering tutorials on distributed systems, databases and web performance.",
    "",
    "## Guides",
    ...articles.map((a) => `- [${a.title}](https://example.com/blog/${a.slug}): ${a.summary}`),
  ];
  return new Response(lines.join("\n") + "\n", {
    headers: { "Content-Type": "text/plain; charset=utf-8" },
  });
}

Generating the file from your content source is the only reliable way to keep it from going stale. The full pattern, including the Pages Router, is in our dynamic llms.txt generator for Next.js.

Curate, Don't Dump Your Sitemap

An llms.txt is an editor's index, not a sitemap. Your sitemap lists every indexable URL for search engines; llms.txt lists the pages that answer the questions people ask about you.

  • Include: pricing, product and feature pages, docs entry points, the guides that define your topic, policies people ask about.
  • Leave out: tag and category archives, paginated lists, near-duplicate pages, URLs with tracking parameters, anything behind a login.
  • Size: keep the index small enough to read in one go. BugViso's check flags files over roughly 8,000 tokens (about 32 KB of text); most good files are a fraction of that.

Write each description as a fact, not a slogan. "Plan prices, seat limits and what the trial includes" tells a model when to open the page. "Discover our flexible pricing" doesn't. More on what the file is for in what llms.txt is and isn't, and how it differs from robots.txt in llms.txt vs robots.txt.

Validate and Score Your llms.txt in One Script

A published file isn't automatically useful: a malformed link list, a redirect or a block in robots.txt makes it useless to any tool that does read it. This script checks the format against the proposal, tests every linked URL, and scores the file out of 100. It uses only the Python standard library.

python
#!/usr/bin/env python3
"""llms_txt_audit.py: validate and score an llms.txt file out of 100.

Usage: python3 llms_txt_audit.py https://example.com [--max-links 50]
Fetches /llms.txt from the site root, checks it against the llmstxt.org format,
tests every linked URL, and checks robots.txt lets AI crawlers read the file.
Exit code 1 below 70 points.
"""
import re, ssl, sys, urllib.error, urllib.request
from urllib.parse import urljoin, urlsplit

UA = "Mozilla/5.0 (compatible; llms-txt-audit/1.0)"
CTX = ssl.create_default_context()
LINK = re.compile(r"^\s*[-*+]\s+\[([^\]]+)\]\(([^)\s]+)\)(?:\s*:\s*(.*))?$")
AI_BOTS = ["OAI-SearchBot", "Claude-SearchBot", "PerplexityBot", "GPTBot", "ClaudeBot"]

def get(url, method="GET"):
    req = urllib.request.Request(url, method=method, headers={"User-Agent": UA})
    try:
        with urllib.request.urlopen(req, timeout=15, context=CTX) as r:
            body = r.read(2_000_000).decode("utf-8", "replace") if method == "GET" else ""
            return r.status, r.headers.get("Content-Type", ""), body, r.geturl()
    except urllib.error.HTTPError as e:
        return e.code, "", "", url
    except Exception as e:
        return type(e).__name__, "", "", url

def robots_blocks(robots, bot, path):
    """Minimal RFC 9309 check: the bot's own group (else '*'), longest matching rule wins."""
    groups, agents, rules, last_agent = [], [], [], False
    for raw in robots.splitlines():
        line = raw.split("#", 1)[0].strip()
        if ":" not in line:
            continue
        k, v = (s.strip() for s in line.split(":", 1))
        if k.lower() == "user-agent":
            if not last_agent and agents:
                groups.append((agents, rules)); agents, rules = [], []
            agents.append(v.lower()); last_agent = True
        elif k.lower() in ("allow", "disallow") and agents:
            rules.append((k.lower() == "allow", v)); last_agent = False
    if agents:
        groups.append((agents, rules))
    mine = [r for a, rs in groups if bot.lower() in a for r in rs]
    if not any(bot.lower() in a for a, _ in groups):
        mine = [r for a, rs in groups if "*" in a for r in rs]
    best = None
    for allow, pat in mine:
        rx = re.escape(pat).replace(r"\*", ".*").replace(r"\$", "$")
        if pat and re.match(rx, path) and (best is None or len(pat) > best[0] or (len(pat) == best[0] and allow)):
            best = (len(pat), allow)
    return best is not None and not best[1]

def audit(site, max_links=50):
    root = f"{urlsplit(site).scheme}://{urlsplit(site).netloc}"
    status, ctype, text, final = get(root + "/llms.txt")
    checks = []  # (points, max, label)
    def add(ok, pts, label):
        checks.append((pts if ok else 0, pts, label))
    add(status == 200 and text.strip(), 15, f"/llms.txt answers 200 (got {status})")
    if status != 200 or not text.strip():
        return checks
    add(final.rstrip("/") == root + "/llms.txt", 5, "served without a redirect")
    add(ctype.startswith(("text/plain", "text/markdown")), 5, f"text content type ({ctype or 'none'})")
    lines = [l for l in text.splitlines() if l.strip()]
    one_h1 = len(re.findall(r"(?m)^#\s+\S", text)) == 1
    add(bool(lines) and re.match(r"^#\s+\S", lines[0]) and one_h1, 15, "starts with a single H1 (the only required section)")
    add(len(lines) > 1 and lines[1].startswith(">"), 10, "blockquote summary right after the H1")
    add(bool(re.search(r"(?m)^##\s+\S", text)), 5, "links grouped under H2 sections")
    items = [m for m in (LINK.match(l) for l in text.splitlines()) if m]
    loose = [l for l in text.splitlines() if re.match(r"^\s*[-*+]\s+", l) and not LINK.match(l)]
    add(items and not loose, 10, f"{len(items)} list links in [name](url) form, {len(loose)} malformed")
    add(items and all(m.group(3) for m in items), 5, "every link has a ': description'")
    urls = [urljoin(root + "/", m.group(2)) for m in items]
    add(items and all(m.group(2).startswith("https://") for m in items), 5, "absolute https URLs")
    broken, redirected = [], []
    for u in urls[:max_links]:
        s, _, _, f = get(u, "HEAD")
        if s in (403, 405):
            s, _, _, f = get(u)
        if s != 200:
            broken.append((s, u))
        elif f.rstrip("/") != u.rstrip("/"):
            redirected.append(u)
    add(urls and not broken, 15, f"{len(urls[:max_links])} links checked, {len(broken)} not 200")
    for s, u in broken[:5]:
        print(f"      broken: {s} {u}")
    add(not redirected, 5, f"{len(redirected)} links redirect")
    rs, _, robots, _ = get(root + "/robots.txt")
    blocked = [b for b in AI_BOTS if rs == 200 and robots_blocks(robots, b, "/llms.txt")]
    add(not blocked, 5, "robots.txt lets AI crawlers fetch /llms.txt" + (f" (blocked: {', '.join(blocked)})" if blocked else ""))
    print(f"  ~{len(text) // 4} tokens, {len(text.encode())} bytes")
    return checks

if __name__ == "__main__":
    if len(sys.argv) < 2:
        sys.exit(__doc__)
    n = int(sys.argv[sys.argv.index("--max-links") + 1]) if "--max-links" in sys.argv else 50
    print(sys.argv[1])
    results = audit(sys.argv[1], n)
    for got, pts, label in results:
        print(f"  {'✓' if got else '✗'} {got:>2}/{pts:<2} {label}")
    score = sum(g for g, _, _ in results)
    print(f"  score: {score}/100")
    sys.exit(0 if score >= 70 else 1)

Real output for bugviso.com on 9 November 2026:

text
$ python3 llms_txt_audit.py https://bugviso.com
https://bugviso.com
  ~1129 tokens, 4523 bytes
  ✓ 15/15 /llms.txt answers 200 (got 200)
  ✓  5/5  served without a redirect
  ✓  5/5  text content type (text/plain; charset=utf-8)
  ✓ 15/15 starts with a single H1 (the only required section)
  ✓ 10/10 blockquote summary right after the H1
  ✓  5/5  links grouped under H2 sections
  ✓ 10/10 26 list links in [name](url) form, 0 malformed
  ✗  0/5  every link has a ': description'
  ✓  5/5  absolute https URLs
  ✓ 15/15 26 links checked, 0 not 200
  ✓  5/5  0 links redirect
  ✓  5/5  robots.txt lets AI crawlers fetch /llms.txt
  score: 95/100

Our own file loses 5 points: some links have no description. That's the kind of gap the score is for.

How the 100 points are weighted

The weights are our editorial choice, not part of the proposal. They put the most weight on what makes the file unusable, and little on polish.

AreaChecksPoints
Reachability200 at /llms.txt, no redirect, text content type25
Required structureA single H1 first, blockquote summary, H2 sections30
Link format[name](url) items, descriptions, absolute https:// URLs20
Link healthEvery linked URL answers 200, none redirect20
Crawler accessrobots.txt lets AI crawlers fetch /llms.txt5

Read the result in three bands. Below 70 (the script exits 1): something makes the file unusable, usually a missing file, a redirect or broken links. 70–89: usable, with format gaps worth an hour. 90 or more: leave it, and spend the time on the pages it links to.

How BugViso Checks Your llms.txt

Every BugViso scan includes an llms.txt check in its AI Search Readiness engine: it looks for /llms.txt, validates the H1 title, the presence of links and standard sections, estimates the token count, tests the linked URLs for broken links, and notes an /llms-full.txt when it finds one. It also finds a manifest at a non-standard path and suggests a root redirect or a link tag.

That's the format and link-health part of the script above, run on every audit and combined with RFC 9309 crawler access, extractability and indexability into a 0–100 GEO citability score. The report and PDF also include an AI-written llms.txt draft for your site, so a missing file has a starting point.

Every check is listed on the AI search readiness feature page.

5 Mistakes That Make an llms.txt Useless

  1. Relative or tracked URLs. A link to /docs/setup loses the host once a line is quoted; ?utm_source= links point models at a non-canonical copy. Use clean absolute URLs.
  2. Broken and redirected links. A 404 or a redirect chain in the file sends the reader nowhere. Run the script after each release, and see how to fix redirect chains for the cause.
  3. No summary. Without the blockquote, a model has a list of links and no idea what the site is.
  4. A sitemap dump. Hundreds of near-identical links hide the ten pages that matter.
  5. A file that's never updated. Prices, plan names and docs paths change. Generate it from your content source, or audit it whenever you publish.

Frequently Asked Questions

No. It's a community proposal, and no major AI search engine has confirmed it uses the file for ranking or citation. Crawler access and content in the raw HTML matter far more. It's cheap, though, and useful to coding assistants and agents that do fetch it.

Do I need both llms.txt and llms-full.txt?

No. llms-full.txt is a convention outside the proposal. Add it when developers will load your documentation into an AI assistant, and generate it at build time so it stays in sync.

Where should I host llms.txt on a site with subdomains?

At the root of each host whose content you want covered, such as https://example.com/llms.txt and https://docs.example.com/llms.txt. The proposal also allows a file under a path like /docs/llms.txt for that section.

How do AI tools find my llms.txt file?

Tools that support it request /llms.txt directly. There's no discovery mechanism every engine follows. The proposal suggests a rel="describedby" link to it from pages that have Markdown versions; a footer link doesn't hurt.

What is a good llms.txt score?

On the weighting above, 90 or more means the file is in good shape and your time is better spent elsewhere. Below 70 means the file can't do its job yet, almost always because of a missing file, a redirect or broken links.

How often should I audit my llms.txt?

Whenever you publish, rename or remove pages it links to, and at least monthly. If the file is generated at build time, run the script as a CI step after deploy.

Does llms.txt replace Schema.org structured data?

No. JSON-LD describes entities inside your HTML for search engines; llms.txt is a separate Markdown index for language-model tools. They don't overlap.

Write the Ten Lines That Matter First

Start with the H1, a two-sentence summary and links to your pricing, main feature and setup pages, each with a factual description. Validate it with the script, wire it into your build, and move on to the checks that carry more weight; a BugViso scan runs the llms.txt check alongside crawler access and extractability.

Written by

· BugViso Team

Kazi writes BugViso’s guides on website audits, Core Web Vitals, technical SEO, accessibility and AI search. The data in them comes from audits BugViso runs in a real Chromium browser, including our 219-site study of website health.

Found this useful? Share it.

Summarise with AI

Open this guide in your assistant.

Follow BugViso

New guides and audit data as we publish them.

AI visibility tracker

Is your brand in AI answers?

See how often AI assistants mention you, cite your site and rank you against your competitors.

  • ChatGPT
  • Gemini
  • Perplexity
  • Claude
  • AI Overviews
See how it works

See where your site stands

Run a free BugViso audit for SEO, speed, accessibility and AI search readiness — with fixes you can ship today.