> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Model Stack & Model Chain

> Wrapper models that combine multiple models into a single model for prediction or optimisation

## Description

The Model Stack and the Model Chain are wrapper models which take multiple models and wrap them into a single model.

***

## Application

The typical situation to chain or stack models:

* You have multiple models
* You need all outputs from those models for a follow up task (for example, optimisation)
* The follow up task can only handle a single model

The resulting, single model can then be used to make predictions, to run an optimisation, and for other tasks.

***

## How to use both manipulators

* Select the **Models** that should be wrapped into a single model.
* Give the new model a **Name**.
* Click **Apply** to create the model.

The Model Chain and Model Stack steps automatically analyses the models and draws connections between models as required. See section below to see how these step work depending on input model's topologies.

***

## More on this step

Below are details on how these steps work depending on the input models' configurations.

### Model Chain

* You can select any number of models
* The outputs from one model must exactly match the inputs to the next model, with no additional columns and no missing columns
* The output from the resulting model is only the outputs from the rightmost model

<img src="https://mintcdn.com/coreweave-dbfa0e8d/QRLrBgwZtalbZXz3/monolith-ai/_media/Model-Stack-Model-Chain-1.png?fit=max&auto=format&n=QRLrBgwZtalbZXz3&q=85&s=8f714558f3783bae3025d3ae99375f12" alt="Diagram of a Model Chain where each model's outputs feed the next model's inputs" width="640" height="400" data-path="monolith-ai/_media/Model-Stack-Model-Chain-1.png" />

### Model Stack

* You can select any number of models
* All model output columns must be mutually exclusive
* Models may have any sets of input columns (ie. overlapping / non-overlapping)
* If any model input column has a name which matches any other model output column name, an error will be raised

<img src="https://mintcdn.com/coreweave-dbfa0e8d/QRLrBgwZtalbZXz3/monolith-ai/_media/Model-Stack-Model-Chain-2.png?fit=max&auto=format&n=QRLrBgwZtalbZXz3&q=85&s=6bc44e82e7f25e8f4052620d46bf7cc0" alt="Diagram of a Model Stack combining models with shared inputs and mutually exclusive outputs" width="640" height="400" data-path="monolith-ai/_media/Model-Stack-Model-Chain-2.png" />
