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

# Prompt Management

> What prompt management is, why prompts belong outside your application code, and how to11 versions them.

Prompt management is the practice of treating the prompts you send to a model the way you already treat code that ships to production: keep them in one place, version every change, and know which version is live. to11 does this for the prompts your project owns: you author them in the dashboard, and your application renders the newest version at runtime through an SDK.

## Why prompts don't belong in your code

Most LLM features start with the prompt written inline, right next to the call to the model:

```ts TypeScript theme={null}
// The prompt is buried in the application.
const messages = [
  { role: "system", content: "You are a helpful weather assistant." },
  { role: "user", content: `I'm in ${city}. ${question}` },
];
const completion = await openai.chat.completions.create({ model: "gpt-4o", messages });
```

```python Python theme={null}
# The prompt is buried in the application.
messages = [
    {"role": "system", "content": "You are a helpful weather assistant."},
    {"role": "user", "content": f"I'm in {city}. {question}"},
]
completion = openai.chat.completions.create(model="gpt-4o", messages=messages)
```

That works until it doesn't. The prompt is the part of an AI feature you tune most often, yet burying it in code means:

* **Every wording change is a code change**: a pull request, a build, a deploy, all for a tweak a product manager could have made in a text box.
* **There's no history.** You can't see what the prompt said last Tuesday, who changed it, or why the quality dropped after the change.
* **You can't compare two versions** without digging through commits.
* **Only engineers can touch it,** even though the people who understand the prompt best often aren't engineers.

Prompt management pulls the prompt out of the binary and puts it behind a versioned surface. The same feature now renders its prompt:

```ts TypeScript theme={null}
// The prompt lives in to11. The app renders its newest version.
const rendered = await to11.prompts.render("weather-concierge", {
  variables: { city: "New York", user_message: "Do I need a jacket?" },
});
```

```python Python theme={null}
# The prompt lives in to11. The app renders its newest version.
rendered = to11.prompts.render(
    "weather-concierge",
    variables={"city": "New York", "user_message": "Do I need a jacket?"},
)
```

The application no longer contains a single line of prompt text. Changing the prompt (fixing a phrasing, adding an example, tightening a rule) is now an edit-and-publish in the dashboard, not a redeploy. See [Rendering prompts](https://to11.ai/docs/platform/prompts/rendering.md) for the full runtime side.

## How to11 models a prompt

A **prompt** is a named, versioned template that a [project](https://to11.ai/docs/platform/projects.md) owns, alongside that project's skills, environments, and sessions. It has a stable slug (`weather-concierge`) your application renders by, and a history of versions behind it.

> [!NOTE]
>
> There are **two kinds of prompt**. This page describes a **chat prompt**, which your application renders into messages and sends to a model. The other kind is a **[skill](https://to11.ai/docs/skills/concepts.md)** — a folder of files delivered to a developer's machine, where a coding agent reads it. Both use the same versions, the same `latest` label and the same history; what differs is what they carry and who they are handed to. A prompt's kind is chosen when it is created and never changes. Skills have their own section, starting at [Skills](https://to11.ai/docs/skills/overview.md).

A **version** is one immutable snapshot of the template. It carries everything needed to render the messages the model sees:

| Part | What it is |
| - | - |
| **Blocks** | The ordered messages (`system`, `developer`, `user`, `assistant`, and tool-result turns) that make up the conversation, each optionally gated by a condition. See [Authoring](https://to11.ai/docs/platform/prompts/authoring.md#blocks). |
| **Variables** | The `{{ placeholders }}` your application fills in at render time. Each is [renderable](https://to11.ai/docs/platform/prompts/authoring.md#renderable-variables) or, when renderable is off, used only in conditions and never shown. See [Variables](https://to11.ai/docs/platform/prompts/authoring.md#variables). |
| **Tools** | The tool definitions the model may call, plus a tool-choice directive. See [Tool definitions](https://to11.ai/docs/platform/prompts/authoring.md#tool-definitions). |
| **Model config** | The model id and generation settings (temperature, token limit) authored alongside the template. |

Authoring happens on a **draft**. Publishing freezes the draft into a read-only version, moves the prompt's one label, `latest`, to it, and starts a fresh draft from the same blocks, so what's live never changes underneath you. See [Versions](https://to11.ai/docs/platform/prompts/versions.md).

### Message roles

Each block is a message with a **role** that tells the model who is speaking and how much authority the message carries. `system` and `developer` are the author's roles, and they outrank the end user's `user` messages, so a rule you set isn't overridden by what a user types. `assistant` blocks and tool-result blocks stand in for earlier turns in the conversation. The [Authoring](https://to11.ai/docs/platform/prompts/authoring.md#blocks) page describes what each role is for; how a `developer` block reaches a model that doesn't accept that role is covered under [Rendering](https://to11.ai/docs/platform/prompts/rendering.md#the-developer-role).

## to11 serves the prompt; your code sends the call

to11 keeps the prompt and hands it to your application; it is not part of the model call itself:

* **to11** (the dashboard and the SDK's `prompts.*` methods, backed by the to11 API) is where you author and publish versions, and where your application renders one.
* **Your provider client** (the OpenAI or Anthropic SDK, or any other) sends the rendered messages, tools, and model settings to the provider, with your own provider key.

So the version you published is exactly the version your application renders, and adopting prompt management changes where the prompt comes from, not how you call your model. The SDK shapes the rendered prompt for the OpenAI and Anthropic clients so it can be passed straight in; see [Rendering prompts](https://to11.ai/docs/platform/prompts/rendering.md#send-it-to-the-model).

## The lifecycle

1. **Author.** Build the version's blocks, variables, tools, and config in the editor. See [Authoring](https://to11.ai/docs/platform/prompts/authoring.md).
2. **Publish.** Freeze the draft into an immutable version; `latest` moves to it. See [Versions](https://to11.ai/docs/platform/prompts/versions.md#versioning-and-publishing).
3. **Render.** Your application renders `latest`, which is always the newest version. See [Rendering prompts](https://to11.ai/docs/platform/prompts/rendering.md).

## Next steps

> [card] [Authoring prompts](https://to11.ai/docs/platform/prompts/authoring.md)
>
> Blocks, variables, conditions, tool definitions, and model config.

> [card] [Versions](https://to11.ai/docs/platform/prompts/versions.md)
>
> Publish immutable versions; `latest` follows the newest.

> [card] [Rendering prompts](https://to11.ai/docs/platform/prompts/rendering.md)
>
> Render a prompt's newest version from your application at runtime.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.