|
1 | 1 | # Providers: routing a model to a transport |
2 | 2 |
|
3 | | -`copilot`, `gateway`, `openrouter` and `azure` are one provider, |
4 | | -`internal/provider/routed`, given four different specs. A spec names a host, the headers to send, and how |
| 3 | +`copilot`, `gateway`, `openrouter`, `azure` and `rou2` are one provider, |
| 4 | +`internal/provider/routed`, given five different specs. A spec names a host, the headers to send, and how |
5 | 5 | to choose a transport for each model. `anthropic` (native OAuth) is separate. |
6 | 6 |
|
7 | 7 | ## Transports |
@@ -54,6 +54,7 @@ with no transport, a bad glob, or a spec with no way to route at all. |
54 | 54 | | `gateway` | default `chat`; credential optional | everything. `base_url` is required; `FIGARO_GATEWAY_BASE_URL` wins over the file. | |
55 | 55 | | `openrouter` | default `chat`; OpenRouter host; `anthropic/` model prefix | everything. | |
56 | 56 | | `azure` | default `chat`; credential from `AZURE_OPENAI_API_KEY`, a stored key, or a Microsoft Entra login | everything. `base_url` is required; `AZURE_BASE_URL` wins over the file. | |
| 57 | +| `rou2` | default `chat`; per-block cache markers, no top-level directive; credential from an Authelia login | everything. `base_url` is required and the login writes it; `ROU2_BASE_URL` wins over the file. | |
57 | 58 |
|
58 | 59 | ## Azure AI Foundry, signed in with Microsoft Entra |
59 | 60 |
|
@@ -84,6 +85,24 @@ tenant whose policy blocks the Azure CLI's client needs an app registration of |
84 | 85 | its own (a public client with the Cognitive Services delegated permission), |
85 | 86 | named by `client_id`. |
86 | 87 |
|
| 88 | +## rou2, the house gateway, signed in with Authelia |
| 89 | + |
| 90 | +```sh |
| 91 | +ROU2_BASE_URL=http://100.103.40.20:9110 figaro login rou2 # or answer the prompt |
| 92 | +figaro set system.provider rou2 |
| 93 | +figaro set system.model explabs/<model> # qualified: the routed door picks the upstream |
| 94 | +``` |
| 95 | + |
| 96 | +The login reads `/.well-known/rou2` for the issuer, client id and scopes, then |
| 97 | +the issuer's own OpenID discovery for the device and token endpoints; nothing |
| 98 | +about Authelia is compiled in. Endpoints off the issuer's origin are refused. |
| 99 | +hush holds the tokens and refreshes them with its default `refresh_token` |
| 100 | +grant. The login writes `base_url = "<rou2>/v1"` to `providers/rou2.toml`. |
| 101 | + |
| 102 | +`figaro decide` reaches jev through it with `provider = "rou2"`, |
| 103 | +`base_url = "<rou2>/v1"` and `model = "explabs/jev-latest"` in |
| 104 | +`providers/decisions.toml`. |
| 105 | + |
87 | 106 | ## Not a provider: decision models |
88 | 107 |
|
89 | 108 | A decision model (jev) is never an aria's `system.model`; setting one is |
|
0 commit comments