gair model policy screen (per user)
How to block the gair models you do not want to use and pick a replacement model for each one. An unchecked model is not executed by your gair calls — the selected fallback model runs instead.
📋 Overview
This screen is where each user blocks the models gair must not run for them.
- Who can use it: you, once signed in. This screen shows only your own policy — you can neither see nor change anyone else's.
- What is the default: every model is checked (all allowed). With nothing saved, calls behave exactly as before.
- What happens when you uncheck a model: your gair calls do not run that model. The fallback model runs instead, and the substitution is recorded in the usage log.
- What about models blocked for the whole organization: they are a floor and cannot be re-enabled here. They show up as "blocked by the organization" and are locked. The organization policy is managed in the admin console.
🚀 Quick start
- Click Open my model policy on the gair introduction page (
/gair), or open the gair model policy entry on your profile page. - Uncheck the models you do not want to use.
- Choose a fallback model on that row (optional).
- Click Save.
📊 Details
1. The model list
| Item | Description |
|---|---|
| List | The models the gair router actually knows. It is produced by the same catalog function the router uses, so the screen list and the router list never drift apart. |
| Allowed | Checked — the model may be used (default). |
| Blocked for me | Unchecked — the model is not used by your gair calls. |
| Blocked by the organization | Blocked for the whole organization. It cannot be re-enabled (locked). |
| Fallback model | The model that runs instead of the blocked one. Choices are the other models in the list that the organization has not blocked. |
2. If you do not pick a fallback
Saving without a fallback model is fine. The router then picks an allowed model of the same kind automatically (for example, a code-oriented call falls back to a code model).
A designated fallback that is itself blocked is not an error either. The router walks one step further to that model's own fallback and keeps going until it finds an allowed model.
3. Where your setting is stored
Per user (usn) and their organization (csn).
| Item | Content |
|---|---|
| Storage | tGairUserModelPolicy — one row per blocked model per user |
| Key | (csn, usn, modelId) |
| Default | No row means the model is allowed (all allowed) |
4. How the organization policy and yours are combined
The router applies the organization policy first and your policy on top of it.
- A model the organization blocked stays blocked — your policy cannot re-enable it.
- A model you blocked is blocked; its fallback is the one you picked, or an automatic pick when you did not pick one.
- If both you and the organization block the same model and the organization also named a replacement, the organization's replacement is used.
5. How it affects a call
- The gair router decides the execution model for the request.
- If that model is on the blocked list, it is replaced with the fallback model.
- The substituted request still succeeds — the caller never gets an error.
- The usage log keeps the originally judged model, the model actually executed, and the policy layer that applied (organization / yours) separately.
That is why "requested model" and "executed model" can differ in the usage log.
6. When this screen does not apply
When a gair call arrives with a project secret key (SK), gair cannot identify the user — the SK carries no user information. In that case only the organization policy applies and the setting you chose here is not applied. Your setting applies to calls that arrive with your own session token.
❓ Troubleshooting
| Symptom | What to check |
|---|---|
| The list is empty | Check that you are signed in. Without a session the screen does not query. |
| Saving failed | Read the reason shown on screen. Saving is rejected when a model is not in the list or when a model is mapped to itself as fallback. |
| I want to re-enable a model the organization blocked | Not from this screen. The organization policy is managed in the admin console. |
| Saved, but calls are unchanged | Check whether those calls arrive with a project secret key (SK). The SK path applies the organization policy only. |
🔌 API reference
| Method | Path | Description |
|---|---|---|
| GET | /api/gair/v1/user/model-policy | Model list + your blocked list + fallback mapping + organization floor list |
| POST | /api/gair/v1/user/model-policy | Save your blocked list and fallback mapping |
Authentication uses your own session token (x-api-key header). Nobody else's policy can be read or written through this API — the server derives the user from the token. The secret key (SK) never passes through this screen.
📌 Metadata
| Item | Value |
|---|---|
| Screen path | /[locale]/settings/gair-model-policy |
| Entry points | gair introduction page (/gair) · profile page (/profile) |
| Related issue | giip #7283 |
| Server API | giipfaw giipAiUserModelPolicy · giipdb pApiGairUserModelPolicybyAK |
| Storage | tGairUserModelPolicy — (csn, usn, modelId) |
| Permissions | your own session only |