Expand description
ModelFactory — how a wire protocol gets built from configuration.
Model is open: anyone can implement another protocol. Constructing one
was not. The composition root matched on the protocol name and knew exactly two
answers, so a third protocol could be written but never reached — the only
way to configure it was to edit the match, in the kernel, in a release.
§What is registered, and by what key
The key is a provider’s api string from settings.json, not the
[ApiType] enum. That enum names the protocols the engine itself
implements and is what a Model reports about itself; the registry is
about what a host can add, and a host adding a protocol has no way to
add a variant to an enum in this crate. A third-party model reports
whichever ApiType describes its wire shape most closely, which affects
how it is labeled in telemetry and nothing else.
§Unknown means unknown at startup
ModelFactoryRegistry::build fails for an api nobody claimed,
and it fails where provider config is read — at startup — rather than on
the first call that happens to route there. A typo in a provider name
should cost a clear error at launch, not a mid-conversation failure in
whichever session first uses that task type.
Structs§
- Model
Factory Registry - Every wire protocol this process can construct.
Traits§
- Model
Factory - Builds a live model from one provider’s configuration.