> For the complete documentation index, see [llms.txt](https://docs.blockbrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blockbrain.ai/for-admins/ai-models/build-your-own-auto-router.md).

# Build Your Own Auto Router

An auto router sends each request to one of your models, depending on how demanding the request is. Simple questions go to a fast and inexpensive model, demanding ones to a stronger model.

{% hint style="info" %}
You need the Admin role to build auto routers. Your users then find the auto router in the model selection, like any other model.
{% endhint %}

#### How it works

Every request is first classified into one of four tiers. The auto router then calls the model you picked for that tier.

| Tier          | Typical requests                                           |
| ------------- | ---------------------------------------------------------- |
| **Simple**    | Greetings, short questions, simple rewording               |
| **Medium**    | Everyday tasks such as summaries and emails                |
| **Complex**   | Code, longer analyses, multi step tasks                    |
| **Reasoning** | Proofs, planning and tasks that need step by step thinking |

The **Default model** answers when a request cannot be classified.

Each request is billed at the model that answered it, so a simple request costs what the simple model costs.

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2FooVdt21QbpLjCOd6R85T%2Fc-auto-router-editor.jpg?alt=media&amp;token=5886a26a-be72-4db5-8731-89107770ba29" alt=""><figcaption></figcaption></figure>

#### Create an auto router

**To create an auto router:**

1. In the Admin Panel, go to **AI Models** and scroll to **Auto routers**.
2. Click **New auto router**.
3. Enter a **Name**. Use lowercase letters, digits and hyphens. The name becomes part of the model name your apps call, and cannot be changed later.
4. Optionally add a **Description**.
5. Pick a model for each tier: **Simple**, **Medium**, **Complex** and **Reasoning**.
6. Pick a **Default model**.
7. Choose a **Classifier**:
   * **Heuristic** decides instantly and makes no extra call.
   * **Language model** asks a model which tier the request needs. Pick the **Classifier model**.
8. Click **Save**.

To build an auto router for agents, tick **Only show agent-compatible models** before you pick the models.

#### Rules and warnings

When you save, Blockbrain checks that:

* every model is a chat model that is switched on for your organization
* no tier sends data to a wider region than the default model

The editor also shows warnings before you save. They do not stop you from saving:

* **Smallest context window:** longer requests fail when they are routed to that model, because the classifier does not look at length.
* **A capability is not reported** for a model, for example PDF input or web search. A request that needs it fails when it is routed there.
* **Agent compatible** tells you whether agents are offered this auto router. It is only the case when every tier and the default model may drive an agent.

#### Use, edit and delete

After saving, the auto router appears in the model selection of chats, bots and agents, with the Blockbrain logo.

* To change the models, click **Edit**, change the tiers and click **Save**. The name stays the same.
* To delete an auto router, click **Delete**. Apps that still call it get an error.

{% hint style="info" %}
You can also call your auto router through the LLM API, by its model name. See [LLM API](https://docs.blockbrain.ai/for-admins/llm-api.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.blockbrain.ai/for-admins/ai-models/build-your-own-auto-router.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
