Sandwiching frontier and open models in multi-step workflows

Using a powerful frontier model for upfront planning and final review while delegating core execution to a cheaper open model yields frontier-level quality at a fraction of the cost.


Cole Medin advocates for a specific design pattern in automated AI workflows: placing a cheaper open model in the middle of a process, flanked at the start and end by a powerful frontier model.

In multi-step automation systems, relying on top-tier models for every step quickly becomes expensive and slow. The sandwich approach splits the labor based on model strengths:

  • Upfront planning: A top-tier frontier model analyzes the initial goal, breaks it down into clear steps, and sets the specific instructions.
  • Core execution: A cheaper, often faster open model acts as the primary worker, generating the bulk text or code required by the plan.
  • Final review: The frontier model inspects the output, checks for errors, and refines the result before delivering it.

As Medin put it:

"If you want to save on tokens, make your workflows faster, experiment with open models, use them for the workhorse that always writes the code, but then you just sandwich that with the planning and reviewing that uses a frontier model"

This technique is for people building multi-step or multi-agent automation systems. While someone using a single chat prompt in a web browser does not need to manage model routing, anyone building automated pipelines, software tools, or multi-agent systems can apply this setup. Medin specifically highlights tasks where the middle step generates code, making this relevant primarily to developers and technical users building automated pipelines.

The main advantage is output reliability without top-tier API costs at every stage. Frontier models charge higher prices per token and often take longer to generate responses. Open models are significantly cheaper per call and can process routine steps quickly. Delegating repetitive execution steps to an open model allows builders to maintain high output quality across complex jobs without paying premium rates for the entire sequence.

This strategy is not just a theoretical proposal; it is shipping and usable in production pipelines today.

However, the approach introduces trade-offs that single-model providers rarely emphasize:

  • Pipeline complexity: Running a multi-model workflow requires setting up logic to hand off context, manage system states, and format prompts across different model architectures.
  • Review limitations: If the open model makes severe structural mistakes during execution, the reviewing frontier model may spend extra tokens rewriting the work. In those cases, correcting bad output can erode the expected cost savings.
  • Model compatibility: Open models vary significantly in how reliably they follow instructions drafted by a frontier model, requiring setup testing to find an execution model capable of handling the workhorse role.
financeproductsefficiencyvideo
Source: youtube.com