Skip to content

A dynamic input-based LLM routing AI-agent built with n8n. It selects the most suitable language model based on user queries, and uses the selected model to answer, solve, or address the input accordingly.

License

Notifications You must be signed in to change notification settings

m3mentomor1/Input-based-LLM-Routing-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 

Repository files navigation

Input-based LLM Routing Agent

🧐 I. Overview

A dynamic input-based LLM routing AI-agent built with n8n. It selects the most suitable language model:

  • Sonar (Perplexity)
  • GPT o3-mini-high (OpenAI)
  • Claude 3.5 Sonnet (Anthropic)

based on user queries, and uses the selected model to answer, solve, or address the input accordingly.

⛓️ II. Workflow

image

The workflow above contains the following nodes:

  • Chat Trigger (Chat Input)

  • AI Agent (Routing Agent, Agent Output)

  • OpenRouter Chat Model (gpt-4o-mini, Dynamic Model)

  • Simple Memory (Memory 1, Memory 2)

  • Structured Output Parser

🛠️ III. Use this repository

1. Make sure to have the following requirements:

  • n8n account (Click here to create an account.)
  • OpenRouter account + enough credits (Click here to create an account.)
  • Docker Desktop (Optional for local hosting. Download here.)

2. Clone this repository.

Run this command in your terminal:

git clone https://github.com/m3mentomor1/Input-based-LLM-Routing-Agent.git

(Optional: You can also Fork this repository.)


3. Go to the repository's main directory.

Run this command in your terminal:

cd Input-based-LLM-Routing-Agent

4. Import workflow into n8n.

  • Create a new workflow or open an existing one (n8n website or local via docker).
  • Click the ••• menu in the top-right corner.
  • Select Import from File...
  • Choose workflow.json from this repository.

About

A dynamic input-based LLM routing AI-agent built with n8n. It selects the most suitable language model based on user queries, and uses the selected model to answer, solve, or address the input accordingly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published