---
title: "ClikaRT::runtime::ContainedModel"
sidebar_label: "ContainedModel"
description: "The runtime drives a Model through these contained entry points."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--struct">struct</span>

**Header:** `ClikaRT/runtime/model.h`

The runtime drives a [`Model`](./Model.md) through these contained entry points. You never build this; [`Executor::create`](./Executor.md#create) / [`Pipeline::create`](./Pipeline.md#create) build it from your [`Model`](./Model.md) (see `detail::contain`), wrapping each override in caller-side throw containment so a thrown [`ClikaRT::Error`](../Error.md) becomes a failure [`Result`](../Result.md) that the engine fails the session with; it never unwinds into the engine. (Same mechanism as [`http`](../http/index.md)'s `detail::contain` and the [`RequestCallbacks`](./RequestCallbacks.md) forwarder: the catch is compiled in your translation unit, only data crosses the boundary.)

## Data members

### schema {#schema}

<div class="api-signature">

[`ModelSchema`](./ModelSchema.md) **`schema`**

</div>

The model's I/O contract (copied out of [`schema()`](./ContainedModel.md#schema)).

<div class="api-declared">

Declared in `ClikaRT/runtime/model.h`, line 113

</div>

### phases {#phases}

<div class="api-signature">

`std::vector<`[`PhaseSpec`](./PhaseSpec.md)`>` **`phases`**

</div>

The model's phases, in order.

<div class="api-declared">

Declared in `ClikaRT/runtime/model.h`, line 115

</div>

### make\_state {#make_state}

<div class="api-signature">

`std::function<`[`Result`](../Result.md)`<`[`ModelState`](./ModelState.md) `*>(`[`Stream`](../Stream.md)`)>` **`make_state`**

</div>

<div class="api-declared">

Declared in `ClikaRT/runtime/model.h`, line 116

</div>

### Phase\_RunOnce {#Phase_RunOnce}

<div class="api-signature">

`std::function<`[`Result`](../Result.md)`<void>(const` [`PhaseSpec`](./PhaseSpec.md) `&,` [`PhaseContext`](./PhaseContext.md) `&)>` **`Phase_RunOnce`**

</div>

<div class="api-declared">

Declared in `ClikaRT/runtime/model.h`, line 117

</div>

### Phase\_Iterate {#Phase_Iterate}

<div class="api-signature">

`std::function<`[`Result`](../Result.md)`<`[`StepBatchOut`](./StepBatchOut.md)`>(const` [`PhaseSpec`](./PhaseSpec.md) `&,` [`StepContext`](./StepContext.md) `&)>` **`Phase_Iterate`**

</div>

<div class="api-declared">

Declared in `ClikaRT/runtime/model.h`, line 118

</div>

### evict {#evict}

<div class="api-signature">

`std::function<void(`[`ModelState`](./ModelState.md) `&)>` **`evict`**

</div>

<div class="api-declared">

Declared in `ClikaRT/runtime/model.h`, line 119

</div>

### capacity\_units {#capacity_units}

<div class="api-signature">

`std::function<std::int64_t()>` **`capacity_units`**

</div>

<div class="api-declared">

Declared in `ClikaRT/runtime/model.h`, line 120

</div>

### project\_units {#project_units}

<div class="api-signature">

`std::function<`[`UnitProjection`](./UnitProjection.md)`(const` [`NamedTensors`](../NamedTensors.md) `&)>` **`project_units`**

</div>

<div class="api-declared">

Declared in `ClikaRT/runtime/model.h`, line 121

</div>
