Prompts
Overview
Saved, versioned prompts that a router applies to every request it serves.
A prompt in Multi-Router is a saved set of instructions, such as a system prompt or a set of example messages, that is stored once and attached to a router. Every request through that router carries the prompt, so applications send only their own messages and the instructions are changed in one place, with no change to application code or API keys. Each prompt keeps a history of revisions, and a router either follows the latest revision or is pinned to one, so a prompt change is released to a router deliberately and can be rolled back by pinning an earlier revision.
Where prompts live
A prompt's source is the place its content is written and versioned. Multi-Router has two sources, and both produce prompts that bind to routers in the same way:
| Source | Id prefix | Written in | Revisions | Changed by |
|---|---|---|---|---|
| Inline prompt | ip_ | The dashboard or the API | Numbered 1, 2, 3 and onward | Saving a new revision in the dashboard or the API |
| GitHub prompt | pf_ | A .md or .json file in a connected GitHub repository | Git commits | Pushing a commit to the tracked branch |
Inline prompts suit teams that edit prompts in the dashboard. GitHub prompts suit teams that review prompt changes in pull requests and want the repository to stay the source of truth; a GitHub prompt is read-only in Multi-Router and updates when a commit lands on the tracked branch. See Inline Prompt and GitHub Prompt.
Text and chat prompts
A prompt's type decides how its content joins a request. A text prompt is a single block of instructions that becomes the system message. A chat prompt is an ordered list of system, user and assistant messages, such as worked examples, that is placed in front of the caller's conversation. The type of an inline prompt is chosen when it is created; the type of a GitHub prompt follows its file extension, with .md files as text and .json files as chat. See Prompt Type.
Variables
A variable is a named placeholder written as {{customer_name}} that each request fills in with its own value through the prompt_variables field. Variables let one prompt serve many requests that differ only in a few values, such as a customer's name, a product or a language. A request that leaves out a variable the prompt uses is rejected. See Prompt Variables.
Binding a prompt to a router
A prompt binding attaches one prompt to a static router. The binding names the prompt, chooses whether the router follows the latest revision or a pinned revision, and sets Prompt composition, which decides how a text prompt combines with a system message the caller sends. Fallback and weighted routers apply the binding of whichever member serves the request. An Adaptive Router holds named bindings that its rules or the request choose. Claude, Codex and Gemini Proxies forward a coding agent's own prompts and carry no binding. See Prompt Binding.
How a request uses a prompt
A request through a router with a bound prompt is handled in this order:
- Multi-Router resolves the router from the request, and reads its prompt binding.
- It loads the bound revision: the latest revision when the binding tracks latest, or the pinned revision or commit.
- It fills each variable with the matching value from
prompt_variables, and rejects the request when a value is missing. - It combines the prompt with the caller's messages: a text prompt according to Prompt composition, and a chat prompt placed before the caller's messages.
- It sends the combined request to the router's model and provider, and records the prompt and revision in Traffic.
The caller sends only its own messages, and the provider receives the complete request. A change to a prompt that a router tracks at latest applies from the next request, and the router itself stays unchanged.
Example
A support team saves an inline text prompt named support-triage with the content below, and binds it to the static router rt_9Hk3Ws7PzQ tracking latest with Prompt composition set to Merge:
The application sends only the customer's message and the two variable values:
The provider receives the filled-in prompt as the system message, followed by the customer's message:
When the team saves revision 4, the router uses it from the next request. If revision 4 performs worse, pinning the binding to revision 3 restores the earlier prompt for every caller at once.
Prompts in Traffic
Traffic records the prompt each request used, so any response can be traced to the exact prompt content that produced it. The request detail shows a Prompt binding section with the Prompt ID and the Revision; for a GitHub prompt it also shows the Repository and File path, and the revision is the commit that was served, with a link to the file at that commit on GitHub. A binding that tracks latest is recorded with the concrete revision number or commit in use at the time of the request. See Observability.
Related topics
| Page | Covers |
|---|---|
| Inline Prompt | Creating, editing and versioning prompts in the dashboard and the API. |
| GitHub Prompt | Connecting GitHub, tracking files, syncing and file status. |
| Prompt Type | Text and chat prompts, their content and the rules for chat messages. |
| Prompt Variables | Placeholder syntax, supplying values and missing-variable errors. |
| Prompt Binding | Attaching a prompt to a router, revisions and Prompt composition. |
| Managing Prompts | The Prompts page, access, limits and the prompt API. |
| Router Settings | The other settings a router applies to each request. |