ArticleOctober 12, 2025Free to read

Let the Agent Choose Its Own Model

An Agent needs to balance speed, reasoning, and cost based on the task; n8n’s Model Selector enables intelligent routing, supports up to 10 models, and chooses based on conditions.

Originally published . English translation: . Read the Chinese original.

Original video in Chinese.

Key Takeaway

  • Model selection need: An Agent needs to balance speed, reasoning, and cost based on the task; n8n Model Selector implements intelligent routing and supports connecting 10 models, with conditions determining which one to use.
  • Workflow demo: In a search example, gpt-4.1-mini judges the query (1 simple / 2 complex), and the Model Selector chooses Sonar (standard) or Sonar Deep Research (deep) to output the corresponding result.
  • Expansion advantages: More granular conditions, a tree structure (sub-Agents/models); combined with MCP Trigger, output to AI clients, and n8n provides atomic, modular flexibility.

It would be great if the Agent could choose for itself which model to use!

Look, right now we have so many models available. Open-source, closed-source; some are fast but weaker at reasoning, others are slow but very strong at reasoning. Each of these models has its own use.

For example, if I want quick Q&A, I definitely wouldn’t use a model with deep thinking. If I need to process a very large text, I’d definitely use a model with a huge context window. All of this is a balance among requirements, results, and cost.

So a few days ago I shared this idea inside Knowledge Planet: I hoped there could be an “intelligent model router” like this. I would connect all kinds of models to it, and let this router decide which model to use in which situation.

Right after I posted that idea, I saw that n8n had launched a feature more than a month ago called the “Model Selector.” It basically implements what I wanted.

In this video, I’ll use a workflow to show you exactly how n8n’s Model Selector works.

Hello everyone, welcome back to my channel. Modestly speaking, I’m one of the few bloggers in China who can clearly explain the Why and How of AI. What I offer is far more valuable than tutorials. Remember to follow me. If you want to connect with me, come to our newtype community. This community has been running for 500 days, and more than 1,600 friends have paid to join.

Back to today’s topic: n8n’s Model Selector feature.

This is the workflow I built, specifically for search. But as you know, AI search generally has two cases now:

One is ordinary AI search, similar to how we used search engines before, where we’re looking for simple content.

The other is deep search, that is, Deep Research, which often takes several minutes to wait for.

To achieve these two search effects, I configured two models, both from Perplexity. For ordinary search, I use the Sonar model; for deep search, I use Sonar Deep Research.

So the question is: how do you let the Agent choose the model on its own?

I added a Basic LLM Chain here, and beneath it I attached a gpt-4.1-mini model to judge the requirement. If you click into it, you can see that in the System Prompt I asked for the following:

If the user’s request is relatively simple, output the number “1”;

If the user’s request is relatively complex and needs Deep Research, output the number “2”.

So the first two nodes will pass two pieces of information to the third node: one is the number 1 or 2, which determines which model to use; the other is the user’s request, which determines what content the model will search for.

In the AI Agent node, you can see that it will receive the information from the first node, namely the user request.

Under the Chat Model sub-node below, this part originally had a model connected directly. At this point, I attached the Model Selector.

This selector supports connecting up to 10 models. I connected two here, both from OpenRouter: one is Sonar, and the other is Sonar Deep Research.

Inside the selector, you can set the selection rules. In the second node just now, I deliberately had gpt-4.1-mini make the judgment. It will pass over the number 1 or 2. So when it gets here, if it receives 1, it uses the first model, Sonar; if it receives 2, it uses the second model, Sonar Deep Research.

Let’s do a test. Ask a simple question: Introduction to GPT-5.

Obviously, this kind of question doesn’t need Deep Research, so gpt-4.1-mini outputs 1 to the Model Selector, and then uses the Sonar model to complete the search.

Now let’s try a more complex request: A detailed comparison of GPT-5 and Claude Opus 4.1 in programming capabilities.

You see, even though I didn’t explicitly ask for Deep Research, gpt-4.1-mini judged this to be a big job, so it passed the number 2 to the Model Selector, and then enabled Sonar Deep Research. Once this model starts running, it takes two or three minutes. Of course, the final answer is naturally very detailed — that’s exactly why you need to choose different models based on the task. If every simple question had to go through Deep Research, that would be completely unnecessary.

From the demonstration just now, you can see that the core of this approach is setting and judging conditions. My setup is relatively simple, and you can make it much more fine-grained as needed by adding a few more upstream nodes. In this regard, n8n gives you a great deal of freedom.

Then, once all of that is done, you can use the MCP Trigger feature I introduced in a previous video to output this whole setup for an AI client to use. I also posted the JSON script inside Knowledge Planet, so feel free to grab it.

So, just as I said before: in n8n workflows now, one Agent can connect other Agents as sub-nodes, and then the model can connect up to 10 models through the Model Selector introduced in this episode. In this way, you can form a tree structure based on the situation and make conditional judgments. Finally, this whole setup can also be exposed externally as an MCP server.

This kind of flexibility, and the possibility of atomic and modular design, is the fundamental reason I’m willing to study n8n.

OK, that’s all for this episode. If you want to learn AI, want to become a super individual, and want to find like-minded people, come to our newtype community. See you in the next one!