Creating and customizing an llms.txt file
The llms.txt file gives large language models (LLMs) and AI agents a curated, Markdown-formatted overview of your website's most important content. You can use the Fastly control panel to create and configure an llms.txt file. If you follow the instructions in this guide, Fastly will serve the llms.txt file from cache so the requests won't hit your origin.
Creating an llms.txt file
To create and configure your llms.txt file, follow the steps below:
- Log in to the Fastly control panel.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- Click Edit configuration and then select the option to clone the active version.
- Click Content.
- Click the llms.txt switch to enable the llms.txt response.
- In the TXT Response field, customize the response for the llms.txt file. The editor starts with a placeholder template that you should replace with a description of your site and links to the pages you want LLMs to know about.
- Click Save to save the response.
- From the Activate menu, select Activate on Production to deploy your configuration changes.
Manually creating and customizing an llms.txt file
If you need to customize the llms.txt response, you can follow the steps below to manually create the synthetic response and condition:
- Log in to the Fastly control panel.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- Click Edit configuration and then select the option to clone the active version.
- Click Content.
- Click Add advanced response.
- In the Name field, enter an appropriate name. For example
llms.txt. - Click the Attach a condition link.
- Fill out the Create a condition fields as follows:
- From the Type menu, select the desired condition (for example,
Request). - In the Name field, enter a meaningful name for your condition (e.g.,
LLMs). - In the Apply if field, enter the logical expression to execute in VCL to determine if the condition resolves as true or false. In this case, the logical expression would be the location of your llms.txt file (e.g.,
req.url.path == "/llms.txt").
- From the Type menu, select the desired condition (for example,
- Click Attach.
- Fill out the remaining Create a response fields as follows:
- Leave the Status menu set at its default
200 OK. - In the MIME Type field, enter
text/plain. - In the Response field, enter the Markdown content of your llms.txt file. For example, a top-level heading with your site name, a short description of the site, and a list of links to your most important pages.
- Leave the Status menu set at its default
- Click Create.
- From the Activate menu, select Activate on Production to deploy your configuration changes.
HINT: For an in-depth explanation of creating custom responses, check out our Responses Tutorial.