---
title: "build_llm"
---

[< Back to Reference](../reference.qmd) | [View source](https://usrbinr.codeberg.page/qrtdown//src/branch/main/R/build-llm.R#L29)

# `build_llm()`

Build LLM-Optimized Documentation

## Usage

```r
build_llm(pkg = ".", filename = "llms.txt", quiet = FALSE)
```

## Arguments

| Argument | Description |
|----------|-------------|
| `pkg` | Path to package root |
| `filename` | Output filename (default: "llms.txt") |
| `quiet` | Suppress messages |

## Value

Invisibly returns the path to the created file

## Description

Generates a single text file containing all package documentation,
optimized for consumption by Large Language Models (LLMs). This file
can be used to provide context about your package to AI assistants.

The output includes:

- Package metadata (name, title, description, version)

- README content

- Function reference documentation

- Articles content

- Changelog/NEWS

## Examples

```r
## Not run: 
# Generate llms.txt in package root
build_llm()

# Custom filename
build_llm(filename = "docs-for-llm.txt")

## End(Not run)
```

