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 Parameter | Default type | Description |
|---|---|---|
TParentIn | unknown | Parent actor input payload type. |
TReq | unknown | Fork tool call request payload type. |
Methods
inheritParentWithEffort()
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
| Parameter | Type | Description |
|---|---|---|
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()
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
| Parameter | Type | Description |
|---|---|---|
modelOrPool | | MaybeBuilder<ModelASTNode> | MaybeBuilder<PoolNode<ModelASTNode>> | Fallback model or pool AST node. |
Returns
ForkModelRoutingBuilder<TParentIn, TReq>
New immutable model routing builder.
toAST()
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.