All videos
0:00 / 0:00
ai

How to Build a Model Router in the Harness

LangChain6 October 2026Watch on YouTube

What you'll learn

  • You learn what a model router does inside the harness of a coding agent like Open SWE.
  • You see the four steps: mapping the task mix with LangSmith traces, picking models along the Pareto frontier, building the router in the harness and tracking outcomes.
  • You learn that the router cut median cost per thread by 64% with no measurable change in quality.
  • You hear why open models fit the fast tier and why the fast tier test was stopped after a day.
  • You get a look at what is next: benchmarks, subagents and mid-thread rerouting.

Frequently asked questions

What did the model router in Open SWE do and what result did it deliver?
Sydney Runkle of LangChain and the team built a model router into Open SWE, their open source coding agent. In an A/B test against always using the performance model, the router cut median cost per thread by 64%, with no measurable change in quality.
Which four steps does the episode give for building a model router?
The four steps are mapping your agent's task mix with LangSmith traces, picking models along the Pareto frontier, building the router in the harness and tracking outcomes with evals or an A/B test.
Why were open models used for the fast tier?
According to the episode, open models fit the fast tier, the part of the work that does not need frontier intelligence. The router uses lighter models there and keeps the more expensive model for the tasks that require it.
Why did the team stop the fast tier test after a day?
The team stopped the fast tier test after about a day, because the results were already clear enough at that point to make a decision. This fits the final step of tracking outcomes with evals or an A/B test.

Topics

In this video

Read next

Description from the channel

Sydney Runkle, product manager for LangChain's open source team, walks through how the team built a model router into Open SWE, LangChain's open source coding agent. She covers the four steps: mapping the task mix from LangSmith traces, picking models along the Pareto frontier, building the router in the harness, and tracking outcomes. In an A/B test against always using the performance model, the router cut median cost per thread by 64% with no measurable change in quality. Chapters: 0:00 Frontier intelligence is expensive at scale 1:24 What a model router actually does 1:56 The result: 64% lower median cost per thread 2:10 Four steps to build a model router 2:40 Step 1: Map your agent's tasks with LangSmith traces 4:53 Step 2: Pick models along the Pareto frontier 5:59 Step 3: Build the router in the harness 6:49 Swapping the classifier to Jev 7:23 Why open models fit the fast tier 7:46 Step 4: Track outcomes with evals or an A/B test 8:49 Results: 64% lower median cost, no drop in merged PRs 10:14 Why we stopped the fast tier test after a day 10:45 What's next: benchmarks, subagents, mid thread rerouting 12:30 How to add a router to your own agent Resources: → Companion blog, How to Build a Model Router in the Harness: https://www.langchain.com/blog/how-to-build-a-model-router-in-the-harness → Building a Harness with Jev: https://www.langchain.com/blog/building-a-harness-with-jev → Open SWE: https://github.com/langchain-ai/open-swe → LangSmith: https://www.langchain.com/langsmith