Skip to main content

Crate cerno_host

Crate cerno_host 

Source
Expand description

The seam between cerno and whatever runs the model.

A host knows nothing about Noul, Choice or Score beyond the Shape of what was offered, which only a host that takes questions rather than prompts reads. It answers exactly one question: given a prompt, what is the probability distribution over the first token the model would generate? All primitive logic lives in cerno-core and therefore holds for every host equally.

Three adapters cover the runtimes: OllamaHost for Ollama’s native API, OpenAiCompatHost for everything speaking /v1/chat/completions, and SystemOneHost for Ollama’s /v1/systemone, which writes its own prompt for its decision models. connect picks one from a HostKind; for HostKind::Ollama it builds an OllamaRouter over the two Ollama adapters, which sends each model to the endpoint made for it.

Structs§

FirstTokenDistribution
The distribution over the first generated token.
FirstTokenRequest
One prompt, one token, full distribution.
HostCapabilities
What a host can and cannot do. cerno-core reads this to size its label alphabet.
Offer
What the model was asked, before it was rendered into a prompt.
OllamaHost
OllamaRouter
OpenAiCompatHost
SystemOneHost
UnknownHostKind

Enums§

Flavour
Which OpenAI-compatible runtime is on the other end.
HostError
HostKind
Which runtime a server talks to. One per process.
Shape
How the offered options relate to each other.

Traits§

ModelHost

Functions§

connect
Build the adapter for kind. Ollama takes no API key; the others send it as a bearer token.