# The system prompt

> How the model learns the format. The API builds the prompt from your catalog and puts it before your own messages; you can also build it yourself.

The model learns the format from a system prompt built from the catalog: the components your app allows, their attributes, and the rules that keep answers valid. It's the same catalog the core checks answers against, so the two can't disagree.

## Through the API

The API builds the prompt for you. It goes first, and your own messages, system messages included, follow unchanged:

```json
{
  "model": "deepseek/deepseek-v4.1-flash",
  "messages": [
    { "role": "system", "content": "You are Lisbon Trams' trip planner. Answer in British English." },
    { "role": "user", "content": "Plan a weekend for two" }
  ],
  "morphscreen": { "packs": ["data"] }
}
```

Your system message says who the assistant is and what it knows. Ours says how to answer. You don't need to describe the components yourself.

## Building it yourself

To run a model of your own, outside the API, build the same prompt with the core and send it as the first system message.

In the browser or Node, with the web SDK:

```ts
const prompt = core.prompt(["data"], [shop]); // packs, then your own packs
```

On the command line:

```bash
mscore prompt --packs data
```

Then check what comes back with the core yourself: a `Session` from `core.session(packs, custom)` reads the text as it streams and gives you the verdict ([the web SDK reference](/docs/reference/web)). The API does that, and the repair, for you.

## What it costs

With the core alone the prompt is about 1,400 tokens, and with every pack about 2,900: about 22 tokens a component. The prompt's version is a hash recorded with every call, so the dashboard and the benchmark can tell which prompt an answer came from.
