Automatically detect content themes and route requests to the best specialized model. Medical questions go to medical LLMs, code questions to coding LLMs, legal questions to legal LLMs.

How It Works

USER REQUEST "What are the symptoms of diabetes?" THEME DETECTOR 1 Keyword Matching (fast) 2 LLM Classification (fallback) Detected: medicine 0.95 MEDICAL WORKER meditron:70b Theme: medicine Specialized Expert USER REQUEST "Write a REST API endpoint in Python" THEME DETECTOR Detected: code Keywords: REST, API, Python CODE WORKER codellama:34b Theme: code Coding Expert

150+ Content Themes

Eldric recognizes and routes based on these theme categories:

Healthcare & Medicine

Medical diagnosis, treatments, pharmacy, nursing, mental health

8 themes • meditron, medllama

Information Technology

Software dev, DevOps, cloud, security, AI/ML, databases

12 themes • codellama, deepseek-coder

Science & Research

Physics, chemistry, biology, astronomy, genetics, neuroscience

15 themes • galactica, scillama

Business & Finance

Banking, investments, accounting, trading, fintech, insurance

15 themes • finllama, bloombergpt

Legal & Compliance

Contract law, IP, criminal law, corporate law, regulatory

6 themes • legallm, lawllama

Engineering

Mechanical, electrical, civil, aerospace, robotics, automotive

9 themes

Education & Languages

Teaching, linguistics, translation, academic research

17 themes

Software-Specific

CommuniGate Pro, nginx, PostgreSQL, Docker, Kubernetes

20+ themes • Custom models

Theme Categories Overview

THEME ROUTER Healthcare 8 themes IT/Code 12 themes Science 15 themes Finance 15 themes Education 17 themes Legal 6 themes Engineering 9 themes Software 20+ themes 150+ Total Themes

Hybrid Detection

1. Keyword Matching (Fast)

Each theme has a curated list of keywords. Content is scored against all themes simultaneously.

  • Sub-millisecond detection
  • 150+ themes with 1000+ keywords
  • Negative keywords to reduce false positives
  • Configurable threshold per theme

2. LLM Classification (Accurate)

When keyword matching is uncertain, the Router LLM analyzes content semantically.

  • Handles ambiguous content
  • Understands context and nuance
  • Returns confidence scores
  • Explains routing decisions

Hybrid Detection Flow

Request Content KEYWORD MATCHING < 1ms latency 150+ themes conf >0.7? YES NO ROUTER LLM Semantic analysis ~100ms latency ROUTING DECISION theme + worker Fast Path ~90% of requests LLM Path ~10% ambiguous

Example Detection

INPUT REQUEST
"How do I configure DKIM signing in CommuniGate Pro for outbound mail relay?"
ROUTING DECISION
{ "theme": "communigate", "confidence": 0.95, "method": "keyword", "matched_keywords": ["communigate", "dkim", "mail"], "recommended_model": "llama3.1:70b", "recommended_worker": "worker-mail-01", "reasoning": "CommuniGate Pro email server configuration" }

Router LLM Addon

Specialized Routing Model

A custom Ollama model optimized for fast, deterministic routing decisions with embedded knowledge of all 150+ themes.

Features

  • Based on llama3.2:1b (fast, lightweight)
  • 150+ embedded theme definitions
  • Performance metrics understanding
  • Known model specialization patterns
  • Deterministic JSON output

Installation

cd models/eldric-router ./build.sh build # Use in router config "ai_config": { "llm_model": "eldric-router" }

Cloud Backend Support

Not just local Ollama models - route to cloud providers with specialization awareness:

Local + Cloud Routing Architecture

ELDRIC ROUTER Theme-based LOCAL BACKENDS Ollama llama3.1:70b vLLM codellama:34b llama.cpp meditron:7b TGI mistral:7b Specialized Local Models communigate-expert, finllama, legallm CLOUD BACKENDS OpenAI gpt-4o, o1 Anthropic claude-3.5 Together llama-3-70b Groq mixtral-8x7b DeepSeek coder-v2 Google gemini-2.0 + More Providers Mistral, AWS Bedrock, Azure, NVIDIA NIM

OpenAI

gpt-4, gpt-4o, o1, o1-mini

Anthropic

claude-3-opus, claude-3.5-sonnet

Together AI

codellama, deepseek-coder, llama-3

Groq

llama, mixtral, gemma

Mistral AI

codestral, mathstral, mistral-large

DeepSeek

deepseek-coder, deepseek-reasoner

Google

gemini-pro, gemini-2.0

AWS Bedrock

claude, titan, llama

NVIDIA NIM

llama, nemotron, codellama

Automatic Model Specialization

Workers automatically detect model specializations by reading Modelfile system prompts:

# Worker extracts specialization from all installed models curl http://worker:8890/api/v1/models/specializations { "models": { "meditron:70b": { "primary_theme": "medicine", "themes": ["medicine", "healthcare", "pharmacy"], "specialization_score": 0.85 }, "codellama:34b": { "primary_theme": "code", "themes": ["code", "software_development"], "specialization_score": 0.90 } } }

Theme-Based Routing Rules

Create routing rules that match on detected themes:

{ "rules": [ { "name": "Medical Questions", "condition": "theme=medicine", "target_model": "meditron:70b", "target_capability": "gpu", "priority": 100, "detect_theme": true }, { "name": "Code Assistance", "condition": "theme=code OR theme=software_development", "target_model": "codellama:34b", "priority": 90, "detect_theme": true }, { "name": "CommuniGate Pro", "condition": "theme=communigate", "target_model": "llama3.1:70b", "target_worker": "worker-mail-01", "priority": 100, "detect_theme": true }, { "name": "General Fallback", "condition": "*", "target_model": "llama3.1:70b", "priority": 0 } ] }

API Reference

Theme Detection API

# Detect theme from content POST /api/v1/themes/detect { "content": "What are the symptoms of hypertension?" } # Response { "theme": "medicine", "confidence": 0.92, "method": "keyword", "matched_keywords": ["symptoms", "hypertension"], "latency_ms": 2 }

Theme Management API

# List all themes GET /api/v1/themes # Add custom theme POST /api/v1/themes { "name": "my_software", "display_name": "My Software", "keywords": ["my_software", "specific_term"], "target_model": "specialized-model:7b", "target_worker": "worker-specialized" } # Load themes from catalog POST /api/v1/themes/load { "file": "/path/to/themes-catalog.json" }

Custom Software Themes

Add themes for your specific software and products:

{ "name": "communigate", "display_name": "CommuniGate Pro", "category": "software", "description": "CommuniGate Pro email/messaging server", "keywords": [ "communigate", "cgpro", "cg pro", "communigate pro", "pronto", "ximss", "cosmo", "smtp", "imap", "dkim", "spf", "dmarc", "mail routing" ], "negative_keywords": ["gmail", "outlook", "exchange"], "keyword_threshold": 0.3, "target_model": "llama3.1:70b", "target_worker": "worker-mail-01" }

Ready to Route Intelligently?

Deploy knowledge-aware routing in your AI infrastructure today.

Download MultiAPI Learn More