> ## Documentation index
> Fetch the complete documentation index at: https://docs.heurastudios.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Train a model from a blank notebook to a downloaded LoRA adapter, scored on held-out tests before and after.

Source: https://docs.heurastudios.com/quickstart/

This walkthrough builds **Quarry**, a model that turns questions about a store's orders into SQL. Swap in your own job as you go: every step is the same for a case coach, a support classifier or a domain analyst.

**Step 1. Create an account**

Sign up at [app.heurastudios.com](https://app.heurastudios.com/signup) and verify your email. Every account starts with a workspace of its own; nothing you add is visible to anyone else until you share it.

**Step 2. Start a notebook**

Press **New notebook**. It opens on `script.md` in the middle, with **Data**, **Tests**, **Output** and **Session** in the sidebar. The model's name comes from its script, so start there.

**Step 3. Write the script**

Write who the model is, in your own words, one sentence per line. The editor marks each line as it reads it: identity, voice, a rule or a fact.

```md title="script.md"
Your name is Quarry.
You were made by Fernbrook's data team to turn questions about orders into SQL.
You talk like a careful analyst: short, exact, no filler.
You always return one PostgreSQL query, then one line on what it counts.
You never invent a table or a column.
Revenue counts when an order ships, not when it's placed.
```

See [Write the script](https://docs.heurastudios.com/build/script/) for what each kind of line does.

**Step 4. Add examples**

Examples are questions paired with the exact answer you want. Open the **examples** tab and add them one by one, or import a two-column CSV (`question,answer`). For Quarry, start from the **Write SQL from plain English** set in the [Datasets](https://docs.heurastudios.com/build/datasets/) library and add 20 to 30 rows in your own schema.

A run needs at least 5 examples and fixes to train.

**Step 5. Write tests**

Open **tests** and add the questions people will actually ask, each with what a passing answer must include and must not include.

| Test question | Must include | Must not include |
| --- | --- | --- |
| How many orders shipped last month? | `count`, `shipped_at` | `created_at` |
| Which customer spent the most this year? | `sum`, `order by`, `limit 1` | |
| What was revenue in March? | `shipped_at` | `created_at` |

Tests that no example asks are **held out**. Those are the ones the release gate decides on.

**Step 6. Check it before training**

Press **Save without training**, then open **Chat** and ask it a few questions. It already answers from your script, rules and examples as reference. Press **Keep** on an answer that's right and **Fix** on one that's wrong: both become lessons.

**Step 7. Train**

Press **Train → v1**. The run answers your tests first, trains LoRA rounds on Heura Arche, checks every lesson after each round, and answers the tests again. Watch it live in the console's **log** tab. When it ends, Tests shows the score before and after, question by question.

**Step 8. Fix and train again**

Ask it more in Chat, fix what it gets wrong, and press **Train → v2**. The new version goes live only if it fixed at least as many held-out tests as it broke. Otherwise v1 stays live and v2 waits in Output.

**Step 9. Ship it**

Call it from your apps through the [OpenAI-compatible API](https://docs.heurastudios.com/ship/api-endpoint/), put it on your website with [one script tag](https://docs.heurastudios.com/ship/website-agent/), or open **Output** and press **Download LoRA** to take the adapter with you.

## Call it from code

The model's **api** tab has its key and model id. Any OpenAI client works:

**Python**

```python
from openai import OpenAI

client = OpenAI(base_url="https://app.heurastudios.com/v1", api_key="hs_...")
reply = client.chat.completions.create(
    model="quarry-3f9a1c2b7d",
    messages=[{"role": "user", "content": "How many orders shipped last month?"}],
)
print(reply.choices[0].message.content)
```

**cURL**

```bash
curl https://app.heurastudios.com/v1/chat/completions \
  -H "Authorization: Bearer $HEURA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "quarry-3f9a1c2b7d", "messages": [{"role": "user", "content": "How many orders shipped last month?"}]}'
```

## Next steps

- [How it works](https://docs.heurastudios.com/how-it-works/): The architecture behind a run, a version and an answer.
- [Evals](https://docs.heurastudios.com/build/evals/): Write tests that measure learning, not memorization.
- [Training runs](https://docs.heurastudios.com/build/training-runs/): Rounds, the replay mix and train until right.
- [Agent mode](https://docs.heurastudios.com/agents/overview/): Have Claude Code run this whole loop for you.
