# Optional small models

There are six places where a small model may add something to a deterministic answer. The API calls
each place a `seam`. Each has a deterministic default that needs no network and no weights, a fixed
rule for the day the selected model cannot run, and a plain statement of what a model there may not do.

Nothing here is on by default. An organization gets the default on every seam until one of its
owners enables a model, and a model that has not been enabled never sees the organization's content.

## The table

| Seam | Default | Models | A model may | When the model cannot run |
| --- | --- | --- | --- | --- |
| `forecast` | `seasonal`: the hour-of-week median and MAD profile the anomaly detector already learns | `chronos2`, `toto2` | publish a forecast value with its interval; it never fires a rule | the seasonal series stands, and the answer says `model: unavailable` |
| `anomaly_second_opinion` | `none` | `tspulse` | add an advisory label beside a deterministic verdict; the verdict is returned unchanged | the deterministic verdict stands alone, labelled `secondOpinion: unavailable` |
| `sentiment` | `none` | `roberta_local` | label survey text | no label; the survey shows scores and counts only |
| `embed` | `none` | `local_open_weight` | cluster what fingerprints left over | fingerprints and template mining only; `embeddings: unavailable` |
| `pii_detect` | `regex`: the scrub's own rules and the entropy rule | `presidio_local` | add a finding or a redaction, never remove one | the regex layer stands; `ner: unavailable`, and a name finding is `not_measured`, never "no names found" |
| `injection_classify` | `none`: the deterministic scanner decides | `deberta_injection_v2` | quarantine more strings, never release one | the scanner alone decides; `classifier: unavailable` |

The fallback rules differ on purpose, one per seam: each was chosen for what that seam's answer is
used for.

## What a model never does

A model never decides membership, fires an alert, resolves an issue, pages anyone or signs anything.
Every output above is data: a number with an interval, a label beside a verdict, a finding added to a
set. A forecast reaches a rule only as a stored value with its provenance; the rule's condition is a
deterministic threshold over it.

`pii_detect` and `injection_classify` are **one-way**. Whatever a model returns, the answer a caller
reads is the union of the deterministic layer's findings and the model's, and the more severe of the
two verdicts. A model that says "this is fine" about a string the scanner held changes nothing; a
model that says "quarantine" about a string the scanner passed raises it. This applies to every
model on those two seams, with no exception.

## Where a model runs

Models run in Bucker's background processing, never in the API, the MCP server or on an ingest
request. A model that is selected but refused there is treated like one that cannot run: the seam's
fallback answers, and the run is recorded as `refused`. The deterministic defaults and the stand-ins run anywhere.

## Open weights, behind a licence allow-list

Only unmodified open weights, and only under a licence on the allow-list: Apache-2.0, MIT or
OpenMDW-or-Apache. A deny list (TimesFM 3.0, Moirai, TiRex v1, Timestral, TabPFN-2.5 and
`ibm-research` copies) wins over the allow-list. A provider whose licence is still `?` has not had
its model card read, and cannot be enabled. Today `chronos2`, `toto2` and `tspulse` carry a licence
on the allow-list; `roberta_local`, `local_open_weight`, `presidio_local` and `deberta_injection_v2`
carry `?`.

Every model provider has a fixed contract: an input schema, an output schema, a timeout, a cost
estimate, the weights file it reads and the SHA-256 that file must have. No model weights are
installed on Bucker's hosted service yet, so today every seam there answers with its deterministic
default even after an owner enables a model. If the weights are not installed, the file's hash is not the pinned one, or no inference runtime is available, the
provider is unusable and the seam's fallback answers. Nothing is ever downloaded.

A provider that would send customer content to a hosted model is unusable until Bucker publishes an
egress contract for it ([AI data use](ai-data-use.md)). None of the six does.

## Enabling a model

`POST /orgs/:orgSlug/model-providers` with `{ "seam", "provider" }` enables a model on one seam;
`DELETE /orgs/:orgSlug/model-providers/:seam` switches it off. Both are human-only and need the
organization's `org:admin`, which only an owner holds: an agent, a service principal and a delegated
OAuth client are refused. Each writes one audit row and alerts the organization's owners.
`GET /orgs/:orgSlug/model-providers` shows every seam, its providers with licence and state, and the
last 24 hours of runs. A provider's `ready` is `null` (unknown) when Bucker cannot confirm from where you asked that the
weights and runtime are present; the run counts are then the evidence, not a guess.

## Provenance

Every call is recorded as one model run: seam, provider, model id, licence, weights hash, digests of
the input and output, latency and an estimated cost, and a status (`ok`, `unavailable`, `refused` or
`error`). The record holds digests, never content. When a model's output appears in evidence the
evidence also carries a `model_output` claim naming the run; a degraded answer is marked so a
stand-in is never read as a model.
