# Teach Your LLM to Use Maverick

```{note}
This page is about teaching LLMs to use Maverick. If you are interested in creating LLM-based players, take a look at this example: {doc}`LLM as Player <examples/llm_as_player>`.
```

Maverick provides LLM-friendly documentation so that AI tools like Cursor, Windsurf, GitHub Copilot, ChatGPT, and Claude can understand and work with the library. Every page in this documentation has a Markdown equivalent generated by the [sphinx-llm](https://github.com/NVIDIA/sphinx-llm) extension, following the [llms.txt standard](https://llmstxt.org/).

There are three ways to feed Maverick's documentation to an LLM, each suited to a different situation.

## Option 1: Full documentation bundle (`llms-full.txt`)

`llms-full.txt` is the entire documentation concatenated into a single Markdown file. Use this when:

- You want to ask broad questions that span multiple parts of the library (e.g. "how does the event system interact with player actions?").
- You are working in a chat interface where you paste context manually.
- You want a self-contained snapshot that doesn't require the LLM to make additional requests.

The drawback is size — it's a large file and might consume an unreasonable portion of your models' context window.

```{raw} html
<a href="_llms-full.txt"
   download="llms-full.txt"
   style="display:inline-block; padding:0.5em 1.2em; background:#1a73e8;
          color:white; border-radius:4px; text-decoration:none;">
  ⬇ Download llms-full.txt
</a>
```

## Option 2: The index file (`llms.txt`)

`llms.txt` is a lightweight index listing every documentation page with its title and a short description, plus links to the per-page Markdown files. Use this when:

- You are using an agentic AI tool (Cursor, Windsurf, Copilot Workspace) that can fetch URLs and decide which pages to read.
- You want the LLM to always reference the latest published documentation rather than a stale downloaded snapshot.
- Your query is focused enough that the LLM only needs to read a few pages rather than the entire library.

Point the tool at:

```text
https://pymaverick.readthedocs.io/en/latest/llms.txt
```

The LLM can use the descriptions in the index to identify which pages are relevant, then fetch those individual `.html.md` files.

**Example prompt:**

```text
Read https://pymaverick.readthedocs.io/en/latest/llms.txt to get an overview of the
Maverick poker library documentation. Then fetch whichever pages are relevant and help
me write a custom player that folds pre-flop unless it holds a pocket pair.
```

```{note}
As of today, these files cannot be natively leveraged by LLM frameworks or IDEs. Alternatively, a [MCP server](https://modelcontextprotocol.io/docs/getting-started/intro) can be implemented to properly parse the llms.txt file.
```

## Option 3: Per-page Markdown

Every page in this documentation has a Markdown twin at the same URL with `.md` appended (e.g. `api_reference.html.md`). Use this when:

- Your question is about a specific class, concept, or feature and a single page covers it.
- You want to keep context usage minimal.
- You are building a retrieval pipeline and want to index individual pages rather than the full bundle.

The easiest way to get the Markdown for the page you are currently reading is the **download dropdown** in the article header at the top of every page — click the download icon and select `.md`.
