Skip to content

Interface: ForkModelRoutingBuilder<TParentIn, TReq> ​

Defined in: builders/fork-model-routing-builder.ts:15

Fluent sub-builder for downward fork model routing ($f.modelRouting($m => ...)).

Configures conditional inheritance of the parent actor's model when KV-cache break-even predicates hold, falling back to .otherwisePool(modelOrPool) otherwise.

Type Parameters ​

Type ParameterDefault typeDescription
TParentInunknownParent actor input payload type.
TRequnknownFork tool call request payload type.

Methods ​

inheritParentWithEffort() ​

ts
inheritParentWithEffort(effort, options): ForkModelRoutingBuilder<TParentIn, TReq>;

Defined in: builders/fork-model-routing-builder.ts:26

Inherits the parent actor's model with a specified reasoning effort when options.when(parentInput, req) returns true.

Preserves KV-cache prefix reuse on 'clone-transcript' or 'shared-prefix-only' forks when the predicate matches.

Parameters ​

ParameterTypeDescription
effort"low" | "medium" | "high"Reasoning effort level on the inherited parent model.
options{ when: (parentInput, req) => boolean; }Break-even predicate evaluated before dispatching the child fork.
options.when(parentInput, req) => boolean-

Returns ​

ForkModelRoutingBuilder<TParentIn, TReq>

New immutable model routing builder.


otherwisePool() ​

ts
otherwisePool(modelOrPool): ForkModelRoutingBuilder<TParentIn, TReq>;

Defined in: builders/fork-model-routing-builder.ts:40

Binds the fallback model or model pool used when inheritParentWithEffort is not matched.

Required before .toAST() can compile a valid ForkModelRoutingConfig.

Parameters ​

ParameterTypeDescription
modelOrPool| MaybeBuilder<ModelASTNode> | MaybeBuilder<PoolNode<ModelASTNode>>Fallback model or pool AST node.

Returns ​

ForkModelRoutingBuilder<TParentIn, TReq>

New immutable model routing builder.


toAST() ​

ts
toAST(): ForkModelRoutingConfig<TParentIn, TReq>;

Defined in: builders/fork-model-routing-builder.ts:51

Compiles the model routing configuration into a frozen ForkModelRoutingConfig.

Throws at builder compilation time if .inheritParentWithEffort(...) or .otherwisePool(...) is missing.

Returns ​

ForkModelRoutingConfig<TParentIn, TReq>

Deeply frozen fork model routing configuration.

Released under the MIT License.