ADR-331: A default configuration's adapter is built from its model record
- Status
-
Accepted (the criteria-mode limit is lifted — see ADR-332; a criteria-mode default is returned without a model — see ADR-333)
- Date
-
2026-11-29
- Amended
- Authors
-
Netresearch DTT GmbH
Context
Without a pinned provider, vision, embed and
Document fall back to the default
configuration, or for document analysis to the configuration a site names. All
three then took the provider record's ADAPTER TYPE (anthropic,
custom) and used it as a key into Keyed. That
registry is keyed by Provider, the adapter's
own name: claude for the adapter type anthropic, openai for
custom, together, fireworks and perplexity. The two are
different namespaces, so vision and the document probe on an Anthropic
default failed with Provider "anthropic" not found, and embed on
an OpenAI-compatible default with Provider "custom" not found (or the
type it names). This is the follow-up to
#873, which had
handed the registry the record's row identifier and was fixed by switching to
the adapter type.
Where the names happen to match (openai, gemini, mistral,
groq, openrouter, ollama), the call did run,
but on the keyed adapter. That adapter is configured from the extension
configuration, not from the provider record's vault key and endpoint, so a
matching key was a second defect, not a correct path.
chat never had the problem: chat builds the
adapter from the model record the configuration resolves to, through
Provider.
ADR-055 put embeddings on that configuration path for a named
configuration; the default-configuration branch of embed did not use it.
Document is an @api final class. It holds
Llm, which offers no way to build the adapter of
a model record, so the service cannot reach the right adapter without a new
dependency. The owner decided on 2026-11-29 to give it one as an optional
trailing constructor argument.
Decision
1. A default configuration's adapter is built from its model record, as
chat builds it. embed hands a resolved default configuration
to Llm. vision resolves
the model on each attempt through
Configuration, so a fallback sibling resolves
its own, and builds the adapter with
Provider. A model named
by the caller is kept. A pinned provider is a keyed name and is still looked up
in the keyed registry.
2. DocumentAnalysisService takes an optional trailing
?Provider constructor
argument. The container injects it. With it, the capability probe
(probe) builds the adapter of the configuration's model record;
without it, or for a pinned provider, the probe asks the keyed registry as
before. A trailing parameter with a default is additive on the constructor of
a final class (Classes/, API stability): no caller
breaks and nothing can override it. The API snapshot
(Tests/) records the new signature, and the
change has an added changelog fragment.
Consequences
- ●●
visionand the document probe work for a default configuration on an Anthropic provider;() visionand() embedwork for a default configuration on a Custom, Together, Fireworks or Perplexity provider, and on an Azure OpenAI provider, whose adapter the keyed registry never held (() Azurecarries noOpen Ai Provider #of its own).[As Llm Provider] embedon an Anthropic default reports that Claude does not support embeddings instead of() Provider "anthropic" not found. - ● A default configuration on an OpenAI, Gemini, Mistral, Groq, OpenRouter or
Ollama provider now runs
visionand() embedwith the provider record's own API key and endpoint, as() chatdoes, instead of the adapter configured from the extension configuration. An installation that relied on the extension configuration's key for these two calls now uses the record's key.() - ◐ No public signature breaks; the release raises only the last version number.
- ◑ A
Documentconstructed by hand without the new argument keeps the keyed lookup, and with it the old failure for an Anthropic configuration. Nothing warns about that.Analysis Service - ✕ Known limit, unchanged by this decision: a criteria-mode configuration
named by a site still fails in
Document. Such a configuration has no directly assigned model (Analysis Service:: probe Provider () getis null; it resolves its model at call time, ADR-066), so the probe falls through to the keyed lookup with no key, andLlm Model () KeyedthrowsProvider Registry:: get Provider () No provider specified and no default provider configured. The default configuration is not affected, because the resolver only returns a default that has a model. ADR-332 lifts this limit: the probe selects the model of such a configuration. Since ADR-333 the resolver also returns a criteria-mode default without a model.
Net Score: +2.5
Alternatives considered
Downcast to Llm and call
get. Rejected: the service holds the interface.
A decorator or a test double of Llm fails the
instanceof check, and the probe would silently fall back to the keyed
lookup, which is the defect this record removes.
A new method on Llm that returns the
adapter of a configuration. Rejected: a new method on an @api interface
is a breaking change (API stability), which during 0.x raises the
middle version number and makes every dependent extension widen its
constraint, for a bug fix.
Translate the adapter type into the keyed identifier (anthropic to
claude, custom to openai). Rejected: the keyed adapter is
configured from the extension configuration, so the call would still run
without the provider record's key and endpoint.