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

# Model Hub

> Connect subscriptions and API keys once, then control which source each Agent model uses and how it recovers.

Model Hub is Avibe's default local model gateway. It keeps upstream credentials and routing on your machine, lets several Agent backends share the same source, and moves a request to the next configured source when the current one can recoverably no longer serve it.

Open **Models > Sources & gateway**. The page has two parts:

* **Sources** lists the subscriptions and API keys you own. It is an inventory, not a priority list.
* **Gateway** shows each Agent backend and the exact Route chain configured for each model.

## Choose gateway or direct mode

Gateway mode is the default on a fresh installation. An existing installation with no Model Hub configuration stays in **Direct** mode until you switch each backend from the Models page.

The choice is per backend and reversible. Switching back to Direct keeps your Sources and Route chains, but that backend resumes using its own native configuration. A **Native** hop inside a Gateway Route chain is still Gateway mode: Avibe owns fallback and recovery for that chain.

## Add a Source

### Add a subscription

1. In **Sources**, select **Add subscription** and choose the vendor.
2. Choose where the credential stays.
3. Select **Sign in** and complete the vendor flow.

The recommended choice depends on the vendor:

* **Claude:** **Use natively** is recommended. Claude Code uses its local login. You can explicitly choose **Sign in as a gateway source** to supply other Agents, but Avibe shows the account-restriction warning before sign-in.
* **ChatGPT:** **Sign in as a gateway source** is recommended. It makes usage, quota, and takeover visible. Native Codex sign-in remains supported, but quota exhaustion will not trigger Gateway takeover and its usage stays outside Model Hub.

Each backend can have only one Native Source because its official CLI exposes one current login. Add additional accounts as gateway-held Sources. You can keep both channels by adding them one at a time.

### Add an API key

1. Select **Add API key**.
2. Enter an optional name, a Base URL, and the API key. A custom Base URL can point to a relay, aggregator, or self-hosted compatible service.
3. Select **Add**. Avibe connects once, authenticates, identifies the interface, and fetches the model list before saving.

**Fetch models** runs the same check without saving anything. If Avibe connects but cannot identify the interface, choose a one-time interface hint and retry. The hint only changes probe order; Avibe still requires a successful response before it can save the Source. The identified interface is fixed after save. To change it, create a new Source.

If the interface is identified but the model list does not return, you can retry or select **Add anyway**. The Source is saved without a discovered inventory, and you can add models manually from Source details.

### Maintain the model list

After a Source is added, Avibe opens **Source details > Models**. From there you can:

* Select **Refetch** to test the saved Source, update its health, and refresh discovered models. This is the only saved-Source refresh action.
* Add a model manually when discovery cannot find it.
* Edit the exact reasoning tiers accepted by any discovered or manual model. No tier is selected or filled by default.
* Remove models you added manually. Models reported by the upstream are managed by refetch instead.

Refetch preserves manual models and the reasoning tiers you edited. If the new inventory would invalidate configured hops, Avibe shows exactly which hops and models would lose supply before it lets you continue. A failed fetch keeps the last list the page actually read.

## Arrange a Route chain

In **Gateway**, choose a backend and open the model you want to configure. That model owns one ordered Route chain. Every hop is an exact pair: a Source and the upstream model it should call.

In the Route chain editor you can:

* add or remove a hop;
* reorder hops;
* change a hop's explicit upstream model mapping; and
* save the resulting chain.

The first runnable hop is used. Avibe walks the remaining hops when a hop is already blocked, or when it hits a fallback-eligible quota, rate, upstream, or network failure before output begins. Blocked hops stay visible in their configured positions, and Avibe never silently reorders them or substitutes another model.

When you add a Source, Avibe matches its discovered models once and appends each exact match to the eligible Route chains. If no unambiguous match exists, the Source is still saved, but you add its hop manually.

<Note>
  **Source order** is separate from a model's Route chain. Changing a backend's Source order does not change any Route chain already configured. Edit the model's Route chain when you want to change live request order.
</Note>

## Read the status

Source rows use these states:

| What you see                                                                             | What it means                                                                                    |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| **In use**                                                                               | The Source is configured into at least one route.                                                |
| **Standby**                                                                              | The Source is healthy but is not currently supplying a configured route.                         |
| **Unavailable · retrying automatically after ...**                                       | Quota, rate, or network trouble put the Source in cooldown. Avibe retries after the shown delay. |
| **Sign in again**, **Out of balance**, **Credential revoked**, or **Account restricted** | The Source needs your action and will not recover by waiting.                                    |
| **Error**                                                                                | Avibe could not classify the failure. It will not clear automatically.                           |

Each Gateway backend shows one supply status for its selected model:

| What you see                               | What it means                                                                         |
| ------------------------------------------ | ------------------------------------------------------------------------------------- |
| **Gateway · Healthy**                      | The intended first hop is serving.                                                    |
| **Gateway · Degraded**                     | A later hop is serving, or part of the chain is blocked. Requests can still complete. |
| **Gateway · All sources are cooling down** | No hop is runnable yet, but every blocker will retry automatically.                   |
| **Gateway · No source is available**       | The chain is empty or at least one blocker needs action.                              |
| **Gateway · No model selected**            | The backend is in Gateway mode but has no selected model to summarize.                |

**Taken over** appears only when a recoverably unavailable first hop has handed the request to a later hop. A successful takeover is silent in the conversation. The Models page shows the current Source, the paused path, and the temporary replacement; the next turn returns to the first hop after it recovers, without changing your saved order.

## Understand errors and recover

### Messages on the Models page

| Message                                                                                 | What to do                                                                                                            |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| **Gateway component not installed · click to install**                                  | Open the confirmation, then install and start the component. No backend changes mode unless you switch it separately. |
| **Gateway not started · click to start** or **Gateway not running**                     | Start the Gateway, then retry the action. Derived route information remains unknown until the Gateway answers again.  |
| **Could not read the source list · the gateway itself is fine**                         | Select **Retry**. Only the Source list failed; other Gateway state remains valid.                                     |
| **Could not read this backend's supply · the gateway itself is fine**                   | Select **Retry** for that backend. Do not add a Source merely because this read failed.                               |
| **Authentication failed: 401 Unauthorized**                                             | Check or replace the API key, then retry.                                                                             |
| **Wrong address: 404 Not Found** or **Network unreachable: connection timed out**       | Correct the Base URL or network path, then retry.                                                                     |
| **Connected and authenticated — but we cannot tell which interface it speaks**          | Choose an interface hint and retry. Nothing is saved until a real response proves the interface.                      |
| **The interface is identified — but its model list did not come back this time**        | Retry, or choose **Add anyway** and maintain the list manually.                                                       |
| **Sign-in did not complete. You can retry.**                                            | Retry the vendor sign-in. Closing the dialog cancels the flow Avibe is tracking.                                      |
| **The fetch did not come back. The list below is the last one this page actually read** | Keep working from the retained list or select **Try again**.                                                          |

### Messages in a turn

| Situation                                            | What Avibe reports                                                                                                                                                | Recovery                                                                               |
| ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| The Route chain is empty                             | The requested model has no configured route and points you to Models.                                                                                             | Add a hop to that model's Route chain.                                                 |
| Every hop is cooling down                            | A waiting message with the next recovery time.                                                                                                                    | Wait. Avibe retries automatically.                                                     |
| No hop can run and at least one blocker needs action | An interrupted message with the classified blockers.                                                                                                              | Repair the named Source, or edit the Route chain.                                      |
| The request itself is incompatible                   | **This request is incompatible; switching Sources will not help.**                                                                                                | Change the request, tools, parameters, or model rather than reordering Sources.        |
| The local Gateway stops during a request             | A Gateway-down error; if output had started, Avibe also says the output may be incomplete.                                                                        | Restore the Gateway and retry. Avibe does not replay partial output or blame a Source. |
| A Source fails after output has started              | If another hop is now current: **The next turn has switched Sources; retry.** Otherwise Avibe shows the same waiting or interrupted result as an exhausted chain. | Retry as a new turn. Avibe never replays a partially streamed turn.                    |
| You cancel the turn                                  | The normal canceled-turn message, with no Model Hub supply message.                                                                                               | Start another turn when ready.                                                         |

### Recovery by cause

* **Cooldown or takeover:** wait for the displayed retry time. Recovery and the return to the first hop are automatic and do not change the chain.
* **Expired subscription login:** follow **Sign in again** for that Source.
* **Exhausted balance:** top up with the vendor, then open Source details and select **Refetch**.
* **Revoked API key:** replace the key in the existing Source, then refetch. The Source identity and every Route position stay intact.
* **Restricted account:** follow the vendor remedy or move the affected model to another Source.
* **Unclassified Error:** fix the suspected upstream problem, then use **Refetch**. A successful current check clears the blocker.
* **Model no longer supported:** refetch if the upstream should still expose it; otherwise edit or remove that exact hop.
* **Source missing:** edit the Route chain. Adding a new Source does not repair a hop that refers to the removed Source.
* **Native CLI unavailable:** restore the backend's local CLI and login, then retry.
* **Need an immediate escape hatch:** switch only the affected backend to **Direct**. Your Sources and Route chains remain saved for when you switch back.
