Nandai AI
Sign In

Engineering /llms.txt, /llms-full.txt & Per-Route Markdown Mirrors for Zero-Noise AI Ingestion

How static sites serve byte-budgeted Markdown documentation endpoints that eliminate HTML navigation boilerplate for coding agents and answer engines.

Learn the llmstxt.org specification: curating crisp /llms.txt indices, exposing /llms/<slug>.md mirrors, and cutting LLM fetch token waste dramatically.

~826 wordsTechArticle + HowTo + Speakable JSON-LDZero-Upload Client RAM
Execution Pipeline ArchitectureLocal Browser RAM & Apple Silicon
01Curate /llms.txtPublish structured Markdownroot directory02Emit .md MirrorsRender /llms/<slug>.md perindexable route03Link AlternateAdd <link rel="alternate"type="text/markdown">04Exclude NoindexBlock auth/trap paths fromMarkdown index
  1. Step 01 · Curate /llms.txt

    Publish structured Markdown root directory. Fetching raw HTML pages wastes 70–90% of an AI agent’s context window on Tailwind stylesheets, inline SVGs, navbar dropdowns, and footer grids.

  2. Step 02 · Emit .md Mirrors

    Render /llms/<slug>.md per indexable route. A disciplined /llms.txt root index follows the llmstxt.org Markdown hierarchy: H1 title, blockquote summary, core facts, and grouped `[Title](URL): description` links.

  3. Step 03 · Link Alternate

    Add <link rel="alternate" type="text/markdown">. Advertising `<link rel="alternate" type="text/markdown" href="/llms/[slug].md">` inside `<head>` enables compliant coding agents to jump straight to noise-free Markdown.

  4. Step 04 · Exclude Noindex

    Block auth/trap paths from Markdown index. Never expose noindex utility or trap routes (/login, /account, /404, /slotting) inside /llms.txt or /llms-full.txt—maintain identical indexability hygiene as XML sitemaps.

1. Why Raw HTML Scraping Burns LLM Agent Context Windows

When a coding agent inside an IDE or a research assistant fetches a modern documentation or SaaS webpage via curl, it frequently downloads 60 to 150 kilobytes of HTML. Inside that payload, navigation menus, theme toggle scripts, footer links, SVG icon paths, and serialized JSON state routinely occupy 75% to 90% of the byte volume. Even after naive tag stripping, menus and sidebar lists leak thousands of irrelevant tokens into the prompt.

Those wasted tokens carry two real engineering costs: latency (longer prefill TTFT and higher cloud token charges) and retrieval degradation ("lost in the middle" attention distraction across irrelevant footer terms). Providing purpose-built Markdown endpoints solves the problem at the origin server rather than forcing every downstream client to write brittle HTML scrapers.

# Header Discovery Tag on Indexable HTML Pages:
<link rel="alternate" type="text/markdown" href="https://nandai.org/llms/blog-example.md" />

# /llms.txt Root Spec Structure:
# Brand Name
> Concise 1-sentence identity + scope
## Core Endpoints
- [Title](https://nandai.org/llms/slug.md): Exact purpose summary

2. Following the llmstxt.org Format Without Turning /llms.txt Into Link Spam

The llmstxt.org specification enforces a deliberately lightweight Markdown grammar designed to be readable identically by humans and regex/AST parsers: one H1 heading naming the project, one concise blockquote (`>`) summarizing identity, domain, and product boundaries, brief factual sections, and H2-grouped bulleted lists (`- [Name](URL): short context note`).

Avoid stuffing 4,000 raw URLs into the root `/llms.txt` file. An overgrown 500 KB `/llms.txt` defeats its own purpose by exhausting small agent context windows on the very first GET request. Instead, keep `/llms.txt` tightly curated (roughly 10–35 KB linking flagship hubs, primary tool specs, and `/llms-full.txt`), while generating individual per-route Markdown endpoints under `/llms/[slug].md` discovered via `<link rel="alternate" type="text/markdown">`.

Three-Tier Markdown Serving Architecture for Large Static Sites
Endpoint PathTarget Byte BudgetPrimary Consumer & Purpose
/llms.txt~8–30 KB compact indexTriage directory linking flagship docs & tools
/llms/<slug>.md~3–15 KB per individual routeOn-demand deep specification for any single URL
/llms-full.txtComplete canonical catalogOffline ingestion into 256K–1M local RAG stores
/sitemap.xmlXML URL inventory (4,000+ routes)Search crawler indexing + lastmod tracking

3. Linking /llms/[slug].md From <head> With Strict Indexability Parity

Wiring `<link rel="alternate" type="text/markdown" href="/llms/{slug}.md">` inside your shared layout component lets any compliant agent discover the Markdown equivalent of whatever article, guide, or tool page a developer pasted into chat. Crucially, the route map driving valid `.md` mirrors must share the exact same noindex exclusions as your XML sitemap.

Specifically, authenticated portals, checkout states, 404 pages, and internal staging routes must emit neither `llms/*.md` links nor XML sitemap `<loc>` entries. Maintaining one single-source-of-truth route ledger (`ROUTE_SEO_META` in TypeScript) ensures canonical HTML, JSON-LD, XML sitemaps, and `.md` mirrors stay mathematically synchronized across builds.

Actionable Checklist
  • Serve /llms.txt and /llms/*.md with Content-Type: text/markdown; charset=utf-8.
  • Never emit alternate Markdown links on pages bearing <meta name="robots" content="noindex">.
  • Mirror exact canonical URLs, formulas, and benchmark numbers between HTML and .md files.
  • Include explicit brand entity disambiguation inside /llms.txt blockquote to prevent entity drift.

4. Edge Caching, ETag Validators & Content-Type Hygiene

Because Astro pre-renders `/llms.txt`, `/llms-full.txt`, and `/llms/[slug].md` as static files inside `dist/` at build time, serving them from nginx or any CDN takes sub-millisecond read latency with zero runtime application servers. Configure `text/markdown; charset=utf-8` MIME types explicitly alongside RFC 9110 `ETag` and Brotli/gzip compression so repeated agent fetches validate with lightweight HTTP `304 Not Modified` responses.

Pay close attention to caching headers and Brotli compression levels on `/llms-full.txt` specifically. Because `/llms-full.txt` consists purely of dense UTF-8 prose, URLs, and Markdown tables, Brotli level 11 compresses multi-megabyte full-corpus dumps by roughly 75–85% over the wire—delivering an entire 150,000-word technical knowledge base in under 300 KB compressed transfer.

Pair static MIME configuration with explicit UTF-8 charset declaration (`Content-Type: text/markdown; charset=utf-8`) rather than `application/octet-stream`, which causes strict browser sandboxes and Python HTTP clients to treat `.md` endpoints as opaque binary downloads instead of readable plain text.

5. Continuous Verification With Local Agents & /seo-engine

Test your Markdown pipeline regularly using a local 256K–1M model (such as Qwen 4 35B-A3B running offline) fed solely with `/llms.txt` and targeted `/llms/<slug>.md` URLs: confirm the model can accurately reconstruct pricing tiers, hardware requirements, API parameters, and canonical route paths without hallucinating deprecated endpoints. Run /seo-engine or /tools/seo-aeo-auditor on live pages to verify `<link rel="alternate" type="text/markdown">` resolution end-to-end.

Track parity continuously between HTML updates and Markdown endpoint outputs: whenever new tools, GGUF profiles, or blog monographs ship, generate `/llms/<slug>.md` directly from the exact same canonical TypeScript data objects (`BLOG_POSTS`, `GGUF_MODEL_GUIDES`, `ACADEMY_TRACKS`) rather than maintaining hand-edited duplicate Markdown files that drift out of date.

Remember also that coding agents rely on clear structural boundaries inside `.md` mirrors: keep fenced code blocks tagged with explicit language identifiers (`bash`, `json`, `ts`), write mathematical bounds in plain ASCII/UTF-8 notation, and conclude every `.md` mirror with canonical links pointing straight back to the interactive browser workspace.

When deploying across global CDNs, also verify HTTP Vary and Accept-Encoding behavior for crawlers requesting `/llms.txt` without gzip support: plain curl probes and headless Python fetchers should receive cleanly uncompressed or standard gzip responses with accurate Content-Length and ETag metadata so incremental indexing cron jobs avoid redundant re-ingestion across 4,000+ mirrored documents.

AI Retrieval Token Efficiency: Raw HTML Scrape vs. Dedicated /llms/<slug>.md Mirrors

AI Retrieval Token Efficiency: Raw HTML Scrape vs. Dedicated /llms/<slug>.md Mirrors
Ingestion MetricRaw HTML Route FetchDedicated /llms/<slug>.md Endpoint
Typical Payload Size / Page45–120 KB (nav, SVG, CSS, scripts)4–12 KB pure semantic Markdown
Signal-to-Noise Token Ratio~15–25% core facts vs chrome~95%+ pure documentation & formulas
Multi-Page Agent Budget (32K)2–4 pages before hitting window cap15–25 full specs fit cleanly in 32K
Table & Code Block IntegrityRisks escaping / whitespace collapseFenced ``` code & GFM pipe tables preserved
Crawler Discovery MechanismGeneric HTML link crawl<link rel="alternate" type="text/markdown">

Connected Workflows & Technical References

Launch pre-configured interactive sandboxes or read paired Academy, Guide, and GGUF specifications.

Check llms.txt in SEO Spider →
FOUNDER_999_LOCK · 67% OFF ALL-IN-ONE PRO

Run Every Studio Unlimited at $9.99/mo (Web Cloud + 5 Apple Silicon Macs)

Consolidate $130+/mo of separate writing, PDF, citation, cutout, video, and 1-second charting subscriptions into one local-first workspace — backed by a 14-day refund window and 1-click cancel.

Publisher & Creator Partner Network
Embed Zero-Upload Tools & Earn 40% Recurring

Add our 1-line Shadow DOM widget to your blog or share your partner link for 40% monthly / 30% annual recurring revenue.

More in Local Apple Silicon AI, Zero-Upload Privacy & Post-Quantum Web Security (8 Sibling Playbooks)

All 84 Articles →
FAQ · DIRECT ANSWERS

Local Apple Silicon AI, Zero-Upload Privacy & Post-Quantum Web Security — FAQ

05 Questions
What is the difference between /llms.txt and /llms-full.txt?
/llms.txt is a concise curated index linking key hubs and summaries, whereas /llms-full.txt concatenates complete canonical documentation for bulk ingestion into large-context RAG stores.
How do agents discover per-page Markdown mirrors automatically?
Add <link rel="alternate" type="text/markdown" href="/llms/[slug].md" /> inside the HTML <head> alongside canonical links.
Should noindex routes appear in /llms.txt or /llms/*.md?
No. Routes marked noindex (login, account dashboards, 404s, utility states) must be excluded from both XML sitemaps and Markdown mirrors.
How much context budget does Markdown negotiation save?
Stripping navigation HTML, SVGs, inline styles, and scripts typically cuts payload bytes by 75–90%, fitting 5x–8x more specification documents inside a fixed LLM context window.
What Content-Type header should /llms/*.md return?
Serve static Markdown files with Content-Type: text/markdown; charset=utf-8 plus Brotli/gzip compression and ETag validators.
Founder Pro $9.99/mo · 67% Off1-tap Stripe Checkout · Instant ?ref= Free Months · 40% Recurring Partner Payouts
1. Subscribe in 1 TapFOUNDER_999_LOCK

Unlock All 19 Pro Studios + Mac App

Lock $9.99/mo Founder Pro (reg. $29.99 — 67% off), $119/yr Web Annual (-34%), or $299/yr 5-Mac + Web Pro.

Redeem Code
2. Get 6 Months FreeZERO OTP

Mint Your ?ref= Link Instantly

Give friends 67% off ($9.99/mo). Every paid friend adds 30 days of Pro free to your account (up to 6 months).

Dashboard: /refer · Rules

3. Creator & Publisher Cash90-DAY COOKIE

Earn 40% Monthly · 30% Annual

Earn 40% recurring monthly until cancel + 30% annual & every renewal, or embed our free tools with data-ref.