Private & Local Ollama LLM Router for Dynamic AI Routing
detail.loadingPreview
Dynamically route user prompts to the optimal local Ollama Large Language Model (LLM) for private and secure AI processing. This workflow ensures your sensitive data stays local while leveraging the best LLM for each task.
About This Workflow
Take control of your AI interactions with this n8n workflow, designed to empower you with a private and self-hosted LLM router. By leveraging Ollama, you can run powerful LLMs directly on your infrastructure, ensuring data privacy and security. This workflow intelligently analyzes incoming chat messages and dynamically selects the most appropriate Ollama LLM based on the complexity and nature of the user's prompt. From intricate reasoning tasks to simple conversations or code generation, the router ensures you're always using the right tool for the job, optimizing performance and resource utilization. Experience the future of localized AI without compromising on functionality or security.
Key Features
- Private & Self-Hosted: Keep your data secure by running LLMs entirely on your own infrastructure using Ollama.
- Dynamic LLM Routing: Intelligently selects the best Ollama LLM based on the user's prompt, optimizing for task-specific performance.
- Comprehensive Model Support: Supports a range of Ollama models including general reasoning, multilingual, coding, and vision-language capabilities.
- Enhanced Reasoning & Efficiency: Utilizes sophisticated system prompts and decision trees to accurately classify requests and choose optimal models.
- Seamless Integration: Integrates easily into your existing n8n workflows for automated AI task management.
How To Use
- Set up Ollama: Ensure Ollama is installed and running on your local machine or server. Download and pull the desired LLM models (e.g.,
qwq,llama3.2,phi4,qwen2.5-coder:14b,granite3.2-vision,llama3.2-vision). - Configure n8n Credentials: In n8n, navigate to Credentials and add a new "Ollama API" credential, pointing it to your local Ollama instance (typically
127.0.0.1). - Import Workflow: Import the provided n8n workflow JSON into your n8n instance.
- Connect to Chat Trigger: Configure the "When chat message received" node with your desired chat platform integration (e.g., webhook for a custom app, or an existing chat service node).
- Configure LLM Router: The "LLM Router" node is pre-configured with a detailed system prompt. Review the
model_examplesanddecision_treewithin thecontentof this node to understand how it routes prompts. You can customize these rules further if needed. - Configure Ollama LLM Node: The "Ollama Dynamic LLM" node will dynamically use the LLM selected by the router. Ensure it is connected to the "LLM Router" node and uses the correct Ollama credentials.
- Test: Send a test message to your chat trigger to see the router in action.
Apps Used
Workflow JSON
{
"id": "fcfa9c16-3e41-4b53-9c99-8901b11913ea",
"name": "Private & Local Ollama LLM Router for Dynamic AI Routing",
"nodes": 7,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: fcfa9c16-3e41...
About the Author
N8N_Community_Pick
Curator
Hand-picked high quality workflows from the global community.
Statistics
Related Workflows
Discover more workflows you might like
Effortless Bug Reporting: Slack Slash Command to Linear Issue
Streamline your bug reporting process by instantly creating Linear issues directly from Slack using a simple slash command. This workflow enhances team collaboration by providing immediate feedback and a structured approach to logging defects, saving valuable time for development and QA teams.
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.