Layer 2 · intelligence
model
What a model is and how it is reached. A provider offers models; a model has capabilities, a context window and a price per token class; an endpoint is where one model is served; a route is a name that resolves to one endpoint and model, and says how it authenticates and how it is billed. An inference is one request on a route with its usage, latency and outcome. A retired route accepts no new inference.
Depends on
- shared · layer 0 · 18 references
Used by
- gateway · layer 2 · 14 references
- agent · layer 4 · 5 references
- harness · layer 4 · 22 references
- process · layer 5 · 5 references
- work · layer 5 · 5 references
- runtime · layer 8 · 5 references
Entities
Endpoint
Where one model is served, an address and the protocol it speaks.
Identified by endpoint_id (EndpointId).
| field | type | meaning |
|---|---|---|
model_id | ModelId | |
address | string | |
wire | Wire | |
hosting | Hosting | |
start_wait_seconds | optional integer | How long a Managed or Local server takes from a start until it answers; absent for one that is always up. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
modelreferences Model (one, bymodel_id)
Lifecycle of Endpoint
Closed.Inference
One request on one route. Started when the request is accepted, Finished when it ended, with the usage, the latency and how it ended. Content is never held: the request is a digest and a length.
Identified by inference_id (InferenceId).
| field | type |
|---|---|
route_id | RouteId |
request | Content |
usage | optional Usage |
latency | optional Latency |
| outcome | optional InferenceOutcome |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
routereferences Route (one, byroute_id)
Lifecycle of Inference
Finished.Model
One model of one provider, with what it can do, how much it reads and what a token costs.
Identified by model_id (ModelId).
| field | type | meaning |
|---|---|---|
provider_id | ProviderId | |
name | Name | |
capabilities | list of Capability | |
context_window | integer | Tokens the model reads at once, input and output together. |
price | TokenPrice |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Always holds: context_window > 0.
Lifecycle of Model
Retired.Provider
Who offers models, a vendor API, a cloud platform, or a model host the owner runs.
Identified by provider_id (ProviderId).
| field | type |
|---|---|
name | Name |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
modelsowns Model (many, byprovider_id)
Lifecycle: one state, Registered; a recorded Provider does not change.
Route
A name that resolves to one endpoint and the model it serves. Callers name routes, never endpoints.
Identified by route_id (RouteId).
| field | type | meaning |
|---|---|---|
name | Name | |
endpoint_id | EndpointId | |
model_id | ModelId | |
auth | RouteAuth | How the route authenticates to its endpoint. |
billing | RouteBilling | How a call on the route is paid for. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
endpointreferences Endpoint (one, byendpoint_id)modelreferences Model (one, bymodel_id)
Lifecycle of Route
Retired.Commands
CloseEndpoint
Close an endpoint.
Called by: Model operator.
| field | type |
|---|---|
endpoint_id | EndpointId |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
closed | otherwise | moves the Endpoint Open → Closed; emits Endpoint |
wrong-state refused | the Endpoint is in a state that does not allow it | Endpoint: The endpoint is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
DeclareModel
Declare a model.
Called by: Model operator.
| field | type |
|---|---|
model_id | ModelId |
provider_id | ProviderId |
name | Name |
capabilities | list of Capability |
context_window | integer |
price | TokenPrice |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
unknown-provider refused | no Provider for provider_ | Unknown: No provider of this identity is registered. |
declared | context_ | creates a Model in Current; emits Model |
invalid-window refused | otherwise | Invalid: The context window is not a positive number of tokens. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
DefineRoute
Define a route.
Called by: Model operator.
| field | type |
|---|---|
route_id | RouteId |
name | Name |
endpoint_id | EndpointId |
model_id | ModelId |
auth | optional RouteAuth |
billing | optional RouteBilling |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
auth-missing refused | not (defined(auth)) | Route: A route names how it authenticates; a route without it is not defined. |
billing-missing refused | not (defined(billing)) | Route: A route names how it is billed; a route without it is not defined. |
unknown-endpoint refused | no Endpoint for endpoint_ | Unknown: No endpoint of this identity is open or closed; none was ever opened. |
unknown-model refused | no Model for model_ | Unknown: No model of this identity is declared. |
endpoint-closed refused | the Endpoint of endpoint_ has state == Closed | Endpoint: The endpoint is closed; no route may point at it. |
model-retired refused | the Model of model_ has state == Retired | Model: The model is retired; nothing new is served from it. |
model-not-served refused | the Endpoint of endpoint_ has model_ | Model: The endpoint serves another model than the one named. |
defined | otherwise | creates a Route in Active; emits Route |
More columns: swipe horizontally, or focus the table and use the arrow keys.
FinishInference
Finish an inference.
Called by: Caller.
| field | type |
|---|---|
inference_id | InferenceId |
| outcome | InferenceOutcome |
usage | Usage |
latency | Latency |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
finished | otherwise | moves the Inference Started → Finished; emits Inference |
wrong-state refused | the Inference is in a state that does not allow it | Inference: The inference is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
OpenEndpoint
Open an endpoint.
Called by: Model operator.
| field | type |
|---|---|
endpoint_id | EndpointId |
model_id | ModelId |
address | string |
wire | Wire |
hosting | Hosting |
start_wait_seconds | optional integer |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
unknown-model refused | no Model for model_ | Unknown: No model of this identity is declared. |
model-retired refused | the Model of model_ has state == Retired | Model: The model is retired; nothing new is served from it. |
opened | otherwise | creates a Endpoint in Open; emits Endpoint |
More columns: swipe horizontally, or focus the table and use the arrow keys.
RegisterProvider
Register a provider.
Called by: Model operator.
| field | type |
|---|---|
provider_id | ProviderId |
name | Name |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
registered | otherwise | creates a Provider in Registered; emits Provider |
More columns: swipe horizontally, or focus the table and use the arrow keys.
RetireModel
Retire a model.
Called by: Model operator.
| field | type |
|---|---|
model_id | ModelId |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
retired | otherwise | moves the Model Current → Retired; emits Model |
wrong-state refused | the Model is in a state that does not allow it | Model: The model is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
RetireRoute
Retire a route.
Called by: Model operator.
| field | type |
|---|---|
route_id | RouteId |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
retired | otherwise | moves the Route Active → Retired; emits Route |
wrong-state refused | the Route is in a state that does not allow it | Route: The route is not in a state this command acts from. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
StartInference
Start an inference.
Called by: Caller.
| field | type |
|---|---|
inference_id | InferenceId |
route_id | RouteId |
request | Content |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
unknown-route refused | no Route for route_ | Unknown: No route of this identity is defined. |
route-retired refused | the Route of route_ has state == Retired | Route: The route is retired; an inference on it is refused. |
started | otherwise | creates a Inference in Started; emits Inference |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Events
| event | fields | emitted by |
|---|---|---|
EndpointClosed | endpoint_ EndpointId | Close |
EndpointOpened | endpoint_ EndpointId, model_ ModelId, address string, wire Wire, hosting Hosting | Open |
InferenceFinished | inference_ InferenceId, outcome InferenceOutcome, usage Usage, latency Latency | Finish |
InferenceStarted | inference_ InferenceId, route_ RouteId, request Content | Start |
ModelDeclared | model_ ModelId, provider_ ProviderId, name Name, context_ integer | Declare |
ModelRetired | model_ ModelId | Retire |
ProviderRegistered | provider_ ProviderId, name Name | Register |
RouteDefined | route_ RouteId, name Name, endpoint_ EndpointId, model_ ModelId, auth RouteAuth, billing RouteBilling | Define |
RouteRetired | route_ RouteId | Retire |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Views
| view | rows | fields |
|---|---|---|
EndpointsEndpoints | each Endpoint | endpoint_ EndpointId, model_ ModelId, address string, wire Wire, hosting Hosting, start_ optional integer, state State |
InferencesInferences | each Inference | inference_ InferenceId, route_ RouteId, request Content, usage optional Usage, latency optional Latency, outcome optional InferenceOutcome, state State |
ModelsModels | each Model | model_ ModelId, provider_ ProviderId, name Name, context_ integer, capabilities list of Capability, price TokenPrice, state State |
RoutesRoutes | each Route | route_ RouteId, name Name, endpoint_ EndpointId, model_ ModelId, auth RouteAuth, billing RouteBilling, state State |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Types
| type | is | values or fields |
|---|---|---|
CapabilityWhat a model can do beyond reading and writing text. | one of | Text, Vision, Audio, Tool, Reasoning, Structured, Embedding |
HostingWho runs what serves an endpoint. Vendor is a provider's API, always up. Managed is a server the owner starts and stops on rented compute, so a call may wait for it to start and its start costs money before any token (agentic.runtime holds its instances and their phase). Local is a server on the owner's own machine. | one of | Vendor, Managed, Local |
InferenceOutcomeHow one inference ended. Refused is the model or its provider declining the request; it is not the gateway's admission, which is agentic.gateway. | one of | Ok, Refused, Rate, Error |
Latency | a record | total_ integer, first_ optional integer |
RouteAuthHow a route authenticates to its endpoint: not at all (a local server), with a provider's API key, with an OAuth token of a person's subscription login, or with the identity of a cloud workload (a role or service account, no stored secret). The secret itself is the sandbox's or the gateway's, never the route's. | one of | None, Api, O, Cloud |
RouteBillingHow a call on a route is paid for: per token at the model's price, under a flat subscription with limits of its own, by the time of a rented server (Managed hosting, agentic.runtime), or not at all (a server on the owner's own machine). | one of | Per, Subscription, Compute, Free |
TokenPricePrice of one million tokens of each class, as Money in micro-USD. The classes are those of agentic.shared.Usage. | a record | input Money, cache_ Money, cache_ Money, output Money |
WireThe request protocol an endpoint speaks. | one of | Messages, Chat, Responses, Native |
More columns: swipe horizontally, or focus the table and use the arrow keys.
KPIs
5 KPIs from the KPI catalogue. A gate must be zero for a variant of an architecture to count.
Completeness
| KPI | unit | better | gate | status |
|---|---|---|---|---|
priced_message_shareShare of model messages whose model has a known price. How: ModelTurnRecorded events with a priced model divided by all of them. The rest are the unpriced messages left out of the cost, so a cost figure over a low share is incomplete. | share | higher | – | computed today source: docs/kpis.md |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Quality
| KPI | unit | better | gate | status |
|---|---|---|---|---|
cost_usdCost of the model messages at the list price of their model. How: Per message, tokens by class (input, cache read, cache write, output) times the model's price, summed over ModelTurnRecorded events. The simulator sums priced tokens per inference. | usd | lower | – | computed and simulated source: docs/kpis.md |
cost_per_task_usdCost of the model messages divided by tasks done. How: cost_usd of a window divided by TaskCompleted events of the same window. Tasks not done still cost, so a failing system shows a higher value. | usd | lower | – | simulated source: design |
cache_hit_shareShare of input tokens served from the prompt cache. How: Cache read tokens divided by cache read plus cache write plus uncached input tokens, summed over ModelTurnRecorded events (reported as hit_permille). | share | higher | – | computed today source: docs/kpis.md |
cache_bust_countModel turns that wrote most of the context to the cache again. How: Turns that read under half of the previous turn's context from the cache and wrote over half again, contexts over 20,000 tokens only, by cause (compacted, model_changed, ttl_expired, unexplained). | count | lower | – | computed today source: docs/kpis.md |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Settings
The settings a part of this block carries in an architecture document. agenticspec sim check refuses any other setting (setting_unknown) and a value outside its type (setting_invalid), and a part that lacks a setting marked required in the default column; the contract copies a setting into the ports it narrows. The last rows of each table are the settings every part takes. What no setting here types (a file, a path, an audience, the use of a model) goes into the part's notes, a map with free keys and values that the check takes as written and nothing reads.
A part model:
| setting | type | unit | default | contract | what |
|---|---|---|---|---|---|
route | string | model. | The route of the model, priced by the behaviour profile; a part that sets price is priced by it instead. | ||
via | string | The endpoint of the architecture (endpoints:) the model is reached through, a gateway the binding addresses: a deployment asks egress to the endpoint, not to the model. | |||
hosting | enum Hosting: vendor, managed, local | vendor | Who runs what serves the model: a provider's API (vendor), a server the owner runs on rented compute (managed) or on its own machine (local). With billing, where the model's price comes from. | ||
billing | enum: subscription, metered, none | metered | How the model is paid for: a fixed subscription, metered per token at the part's price or else the route's, or none (nothing per call, as a local model). | ||
price | price | The price of the model's tokens, USD per million tokens of each class (input, cache_read, cache_write, output), the classes of agentic.model.TokenPrice: a metered call to the part is priced by it, not by its route's price in the profile. The search keeps it fixed under optimize: all. | |||
count | integer of at least 1 | 1 | How many copies of the part run. | ||
per | part | One copy of the part for each copy of the named part. | |||
notes | notes | Free notes on the part, a map with keys and values of any kind: what no setting of its block types. The check takes any map; the simulator, the search and the contract never read it. |
More columns: swipe horizontally, or focus the table and use the arrow keys.