---
title: Docs eval
subtitle: Write down what readers ask and what a correct answer says, let AI answer from the docs alone, and know before you publish whether it gets it right.
description: Docs eval in ButterIX — writing evals.yml, answering and grading with your own model key using biti eval, a pass mark in CI, questions from what readers asked, and the history of results in the dashboard.
---

The more often docs change, the easier it is to lose a sentence that matters. Docs eval guards them like a test suite: questions are kept with the docs, AI answers them from the docs alone after every change, and each point is checked. For a wrong answer you see which point is missing and whether search found the page it should have.

## Write questions

Create `evals.yml` next to `docs.yml`:

```yaml title="evals.yml"
pass: 80
questions:
  - id: refund-time
    question: How long does a refund take?
    expect:
      - It arrives within three business days
      - It goes back to the original payment method
    avoid:
      - It can be paid to another account
    pages: [/guides/refund]

  - question: How do I get an invoice?
    expect:
      - Request it under Billing in the dashboard
```

<ParamField path="pass" type="number" default="80">Pass mark: the share of questions answered correctly, in percent.</ParamField>
<ParamField path="questions[].question" type="string" required>The question, in the words readers use.</ParamField>
<ParamField path="questions[].expect" type="string[]" required>Points a correct answer makes; all of them have to be there. One fact each.</ParamField>
<ParamField path="questions[].avoid" type="string[]">What the answer must not say.</ParamField>
<ParamField path="questions[].pages" type="string[]">Pages the answer should come from. For diagnosis only; doesn't affect the result.</ParamField>
<ParamField path="questions[].id" type="string">Name of the question, for `--only`. `q1`, `q2`… by default.</ParamField>
<ParamField path="questions[].locale" type="string">Language of the question; the site's default language if left out.</ParamField>
<ParamField path="questions[].draft" type="boolean">A draft isn't asked. Neither are questions without points.</ParamField>

## Run it

Run [`biti login`](../reference/cli.mdx#biti-login) first (or set `BITI_TOKEN`): the questions are answered from the docs as the platform renders them for readers. Answering and grading use your own model key.

```bash
export DEEPSEEK_API_KEY=sk-…
biti eval
```

Questions are answered the way [Ask AI](./ask-ai.mdx) answers readers: search the docs, then answer from what was found only, with `ai.system-prompt` applied. Each question takes 3 model calls: search terms, the answer, and grading. They are billed to your own key; the tokens used are shown at the end.

<ParamField path="--provider" type="string">`anthropic`, `deepseek` or `openrouter`; by default the one whose key is set.</ParamField>
<ParamField path="--model" type="string">Model that answers.</ParamField>
<ParamField path="--judge-model" type="string">Model that grades; the same one by default.</ParamField>
<ParamField path="--min" type="number">Pass mark, in place of `pass` in `evals.yml`.</ParamField>
<ParamField path="--only" type="string">Ask these questions only; separate several `id`s with commas.</ParamField>
<ParamField path="--concurrency" type="number" default="4">Questions at a time, up to 16.</ParamField>
<ParamField path="--report" type="string">Write the result as Markdown.</ParamField>
<ParamField path="--json" type="boolean">Machine-readable output.</ParamField>
<ParamField path="--site" type="string">Upload the result to this site.</ParamField>

The exit code is 1 below the pass mark, or when a question couldn't be graded.

<Note>
  Models don't answer the same way every time, and grading is done by a model too. Don't set the pass mark to 100%, and write points that are specific and can be checked. [Custom answers](./ask-ai.mdx#custom-answers) and [content sources](./ask-ai.mdx#content-sources) from the dashboard aren't used: this tests the docs themselves.
</Note>

## In CI

```yaml title=".github/workflows/docs.yml"
- run: biti check docs
  env:
    BITI_TOKEN: ${{ secrets.BITI_TOKEN }}
- run: biti eval docs --site acme-docs --report eval.md
  env:
    DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
    BITI_TOKEN: ${{ secrets.BITI_TOKEN }}
```

## Questions from readers

```bash
biti eval --import --site acme-docs --days 30 --limit 20
```

Adds what readers asked most to `evals.yml` as drafts, skipping questions that are already there. Write the points and remove `draft` to include them. In the dashboard you can also select **Copy as an eval question** next to a question under **Ask AI → Conversations**, and paste it under `questions`.

<Warning>
  Readers wrote these questions, and they may contain personal data. Check them before you commit the file.
</Warning>

## History

Results uploaded with `--site` are under **Ask AI → Docs eval** in the dashboard: the score over time, each question's result, missing points, the answer, and its sources. The last 100 runs of a site are kept; you can also read them through the [API](/api-reference/ai/list-evals).
