Sub topic 2
What llms.txt Is For
This chapter assumes you understand how websites are served over HTTP, can read Markdown, and can read a simple web server access log.
What llms.txt is for
llms.txt is a proposed plain-text file placed at the root of a website, at /llms.txt. It gives a language model a short, curated map of the site: what it covers and which pages matter most. A sitemap lists every URL for search engines. llms.txt points to a small set of clean Markdown pages that fit into a model's context window.
llms.txt is a convention, not an enforced standard. No crawler is required to read it, and no browser enforces it.
Writing an llms.txt file
The format is simple. It starts with one H1 title, then a short summary line, then H2 sections that contain lists of Markdown links. Each link can have a short description after a colon. A section named Optional holds material that a reader can skip when context is short.
# Example Docs
Documentation for the Example library, a Python client for the Example API.
## Docs
- [Quickstart](https://example.com/docs/quickstart.md): Install the library and make a first request
- [API reference](https://example.com/docs/api.md): Endpoints, parameters and error codes
## Optional
- [Changelog](https://example.com/changelog.md): Release historyllms-full.txt and Markdown versions of pages
Some sites also publish llms-full.txt, a single file that concatenates the full text of their documentation. Some sites also serve a Markdown copy of each page, such as page.md beside page.html. Both formats leave out navigation menus and scripts, which consume tokens without adding information.
What llms.txt does not do
llms.txt is not access control. A crawler that ignores it can still fetch every page. The file does not guarantee that a model reads it, ranks your pages higher, or cites your site. If you need to restrict access, use server-side controls.
Sitemaps, structured data and clean HTML still do the heavy lifting
Search engines and AI systems still depend on a sitemap for discovery, on structured data for meaning, and on clean HTML for extraction. Improve these first. llms.txt adds a curated shortcut on top of them.
Exercise
A colleague says that adding llms.txt blocks GPTBot from reading the docs. Is this correct, and what should be used instead?
Show answer
No. llms.txt is advisory and blocks nothing. To ask GPTBot to stay out, add a robots.txt rule with "User-agent: GPTBot" followed by "Disallow: /". Stopping a crawler that ignores robots.txt requires server-side controls, such as WAF rules or bot verification.