LLM-Runner-Router is not just another model loader - it's a full-stack agnostic neural orchestration system that adapts to ANY model format, ANY runtime environment, and ANY deployment scenario. Think of it as the Swiss Army knife of AI inference, but cooler and with more quantum entanglement.
1
stars
213
commits
JavaScript
primary language
Sep 8, 2025
updated
Where AI models transcend their formats, engines dance across dimensions, and intelligent inference becomes art
# Clone and enter directory
git clone https://github.com/MCERQUA/LLM-Runner-Router.git
cd LLM-Runner-Router
# Install dependencies
npm install
# Download a model (optional - uses mock by default)
pip install huggingface_hub
huggingface-cli download HuggingFaceTB/SmolLM3-3B-Base --local-dir ./models/smollm3-3b
# Start the server
npm start
# API is ready at https://llmrouter.dev:3006
curl -X POST https://llmrouter.dev:3006/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello, AI!"}'
curl https://llmrouter.dev:3006/api/config
server.js - Main server entry pointsrc/index.js - Core LLMRouter classsrc/loaders/ - Model loaders for different formatsmodels/ - Local model storage.env - Configuration (copy from .env.example)npm start # Start production server
npm run dev # Development with hot reload
npm test # Run test suite
npm run benchmark # Performance testing
npm run docs # Generate documentation
See DEPLOYMENT.md for production setup.
Current Version: 2.0.0 | Development Stage: Production Ready | Last Updated: December 2024
LLM Runner Router is a revolutionary universal AI model orchestration system that intelligently manages, routes, and optimizes inference across 24+ major LLM providers with 95% market coverage. Unlike traditional model loaders, our system provides:
Perfect for developers building AI applications, researchers comparing models, and enterprises deploying scalable AI solutions.
/byok-interface.html# Install via NPM
npm install llm-runner-router
# Or with Yarn
yarn add llm-runner-router
# Or with PNPM
pnpm add llm-runner-router
# Clone the repository
git clone https://github.com/MCERQUA/LLM-Runner-Router.git
cd LLM-Runner-Router
# Install dependencies
npm install
# Launch the development server
npm start
# Run tests
npm test
# Build for production
npm run build
import { LLMRouter } from 'llm-runner-router';
// Initialize the router with intelligent defaults
const router = new LLMRouter({
strategy: 'balanced',
engines: ['webgpu', 'wasm'],
models: {
'microsoft/DialoGPT-small': { priority: 'speed' },
'meta-llama/Llama-2-7b-hf': { priority: 'quality' }
}
});
// Simple text completion
const response = await router.complete("Explain quantum computing in simple terms:");
console.log(response.text);
// Streaming responses
for await (const chunk of router.stream("Write a story about AI:")) {
process.stdout.write(chunk.text);
}
import { LLMRouter, setupOllama, addOllamaModel } from 'llm-runner-router';
// Quick setup - automatically discovers and registers all local Ollama models
const router = new LLMRouter();
const models = await setupOllama();
console.log(`Found ${models.length} Ollama models`);
// Use any discovered model immediately
const response = await router.quick("Explain machine learning:", {
modelId: 'qwen2.5:3b-instruct-q4_K_M'
});
// Add specific models manually
await addOllamaModel('phi3:mini', {
name: 'Phi-3 Mini 3.8B',
description: 'Microsoft\'s efficient small language model'
});
// Alternative: Direct router usage
const router2 = new LLMRouter();
const model = await router2.load({
provider: 'ollama',
modelId: 'qwen2.5:3b-instruct-q4_K_M'
});
const result = await model.generate("Write a haiku about programming:");
console.log(result.text);
// Streaming with Ollama
for await (const token of model.stream("Tell me a story:")) {
process.stdout.write(token.text);
}
Ollama Setup Requirements:
curl -fsSL https://ollama.ai/install.sh | shollama pull qwen2.5:3b-instruct-q4_K_Mollama serve (runs on http://localhost:11434)Popular Ollama Models:
qwen2.5:3b-instruct-q4_K_M - Fast 3B model, 32K context (1.9GB)phi3:mini - Microsoft's 3.8B model, 128K context (2.2GB)llama3.1:8b - Meta's 8B model with reasoning (4.7GB)mistral:7b - Mistral's efficient 7B model (4.1GB)๐ Complete Ollama Setup Guide: docs/OLLAMA_SETUP.md
import { APILoader } from 'llm-runner-router/loaders';
// Industry Standards
const openai = new APILoader({
provider: 'openai',
apiKey: process.env.OPENAI_API_KEY
});
await openai.load('gpt-4');
const response = await openai.generate('Hello, GPT!');
const anthropic = new APILoader({
provider: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY
});
await anthropic.load('claude-3-sonnet-20240229');
const claude = await anthropic.generate('Hello, Claude!');
// Enterprise Cloud Giants (NEW!)
const bedrock = new APILoader({
provider: 'bedrock',
region: 'us-east-1',
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
}
});
await bedrock.load('anthropic.claude-3-sonnet-20240229-v1:0');
const aws = await bedrock.generate('Hello from AWS Bedrock!');
const azure = new APILoader({
provider: 'azure-openai',
endpoint: 'https://your-resource.openai.azure.com/',
apiKey: process.env.AZURE_OPENAI_API_KEY
});
await azure.load('gpt-4');
const microsoft = await azure.generate('Hello from Azure OpenAI!');
const vertex = new APILoader({
provider: 'vertex-ai',
projectId: 'your-project-id',
location: 'us-central1',
keyFilename: './service-account.json'
});
await vertex.load('gemini-1.5-pro');
const google = await vertex.generate('Hello from Google Vertex AI!');
const mistral = new APILoader({
provider: 'mistral',
apiKey: process.env.MISTRAL_API_KEY,
dataResidency: 'eu' // GDPR compliant
});
await mistral.load('mistral-large-latest');
const european = await mistral.generate('Bonjour from Mistral AI!');
// High-Performance Inference (NEW!)
const together = new APILoader({
provider: 'together',
apiKey: process.env.TOGETHER_API_KEY,
enableBatchMode: true
});
await together.load('meta-llama/Llama-2-70b-chat-hf');
const opensource = await together.generate('Open source power!');
const fireworks = new APILoader({
provider: 'fireworks',
apiKey: process.env.FIREWORKS_API_KEY,
enableFireAttention: true,
enableHIPAA: true
});
await fireworks.load('accounts/fireworks/models/llama-v3p1-70b-instruct');
const enterprise = await fireworks.generate('Enterprise-grade inference!');
const groq = new APILoader({
provider: 'groq',
apiKey: process.env.GROQ_API_KEY
});
await groq.load('mixtral-8x7b-32768');
const fast = await groq.generate('Lightning speed inference!');
// Security & Performance Examples (NEW!)
import { SecurityValidator, PerformanceBenchmark } from 'llm-runner-router/utils';
// Security validation
const security = new SecurityValidator();
const credentialCheck = security.validateCredentials('openai', { apiKey: 'sk-...' });
const requestCheck = security.validateRequest({ prompt: 'Hello' }, 'openai');
// Performance benchmarking
const benchmark = new PerformanceBenchmark();
const results = await benchmark.runBenchmarkSuite(openai, {
categories: ['simple', 'medium', 'complex'],
iterations: 5,
includeStressTest: true,
includeConcurrencyTest: true
});
console.log(`Performance Grade: ${results.summary.overallGrade}`);
console.log(`Average Latency: ${results.summary.averageMetrics.latency}ms`);
Experience LLM Runner Router in action:
๐ฎ Try Interactive Demo - Real-time model routing with streaming responses
๐ Browse Documentation - Complete API reference and guides
import { quick } from 'llm-runner-router';
// Just ask, and ye shall receive
const response = await quick("Explain quantum computing to a goldfish");
console.log(response.text);
import LLMRouter from 'llm-runner-router';
const router = new LLMRouter({
strategy: 'quality-first',
enableQuantumMode: true // (Not actually quantum, but sounds cool)
});
// Load multiple models
await router.load('huggingface:meta-llama/Llama-2-7b');
await router.load('local:./models/mistral-7b.gguf');
await router.load('bitnet:microsoft/BitNet-b1.58-2B-4T');
// Let the router choose the best model
const response = await router.advanced({
prompt: "Write a haiku about JavaScript",
temperature: 0.8,
maxTokens: 50,
fallbacks: ['gpt-3.5', 'local-llama']
});
const stream = router.stream("Tell me a story about a debugging dragon");
for await (const token of stream) {
process.stdout.write(token);
}
const result = await router.ensemble([
{ model: 'gpt-4', weight: 0.5 },
{ model: 'claude', weight: 0.3 },
{ model: 'llama', weight: 0.2 }
], "What is the meaning of life?");
// Get wisdom from multiple AI perspectives!
LLM Runner Router now supports Microsoft BitNet - revolutionary 1.58-bit quantized models that deliver:
# Install prerequisites (CMake required)
sudo apt-get install cmake # Ubuntu/Debian
brew install cmake # macOS
# Setup BitNet integration
npm run setup:bitnet
# Download a model
cd temp/bitnet-repo
python3 setup_env.py --hf-repo microsoft/BitNet-b1.58-2B-4T --quant-type i2_s
// Load official Microsoft BitNet model
const bitnetModel = await router.load({
source: 'microsoft/BitNet-b1.58-2B-4T',
type: 'bitnet',
quantType: 'i2_s',
threads: 4
});
// Generate with 1-bit efficiency
const response = await router.generate('Explain neural networks', {
modelId: bitnetModel.id,
maxTokens: 200
});
LLM Runner Router delivers exceptional performance across all supported engines:
| Engine | Model Format | Tokens/sec | First Token (ms) | Memory Usage |
|---|---|---|---|---|
| WebGPU | GGUF Q4 | 125 | 45 | 2.1 GB |
| WASM | ONNX | 85 | 120 | 1.8 GB |
| Node.js | Safetensors | 200 | 30 | 3.2 GB |
| BitNet | 1.58-bit | 150 | 35 | 0.7 GB |
Benchmarks run on MacBook Pro M2, 16GB RAM. Results may vary based on hardware.
LLM Runner Router supports all major AI model formats including GGUF, BitNet (1-bit LLMs), ONNX, Safetensors, HuggingFace Hub models, and custom formats. Our universal loader architecture automatically detects and optimizes loading for each format.
Yes! LLM Runner Router is designed for universal deployment. Use WebGPU for GPU-accelerated browser inference or WASM for maximum compatibility across all browsers and devices.
Our routing system evaluates models based on your configured strategy (quality, cost, speed, or balanced) and automatically selects the optimal model for each request. Custom routing strategies can be defined with JavaScript functions.
Absolutely. LLM Runner Router includes enterprise-grade features like load balancing, failover handling, performance monitoring, and security best practices. See our deployment guide for production setup.
Yes! LLM Runner Router supports model ensemble techniques, A/B testing, and parallel inference across multiple models with intelligent request distribution.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Your Application โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ LLM-Runner-Router โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโค
โ Router โ Pipeline โ Registry โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโค
โ Engines (WebGPU, WASM, Node) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Loaders (GGUF, ONNX, Safetensors) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Choose your destiny:
{
"routingStrategy": "balanced",
"maxModels": 100,
"enableCaching": true,
"quantization": "dynamic",
"preferredEngine": "webgpu",
"maxTokens": 4096,
"cosmicAlignment": true // Optional but recommended
}
LLM Runner Router includes a state-of-the-art testing framework with high-value test suites covering all critical aspects of production AI orchestration systems.
LLM Router Functional Test Suite - Comprehensive external testing framework for AI/ML capability validation
# Quick start with external test suite
git clone https://github.com/MCERQUA/LLM-Runner-Test-Suite.git
cd LLM-Runner-Test-Suite
cp example.env .env # Configure your API endpoint
./functional-llm-router-tests.sh # Run AI/ML tests
./comprehensive-test-suite.sh # Run all infrastructure tests
This external test suite provides end-to-end validation of your deployed LLM Router instance, testing real AI capabilities rather than just infrastructure.
tests/integration/real-model-inference.test.js)Purpose: End-to-end validation with actual model files for production readiness
tests/performance/memory-usage-validation.test.js)Purpose: Ensures efficient memory management with large models (1-3GB each)
tests/resilience/error-recovery-verification.test.js)Purpose: System resilience and self-healing capabilities testing
tests/performance/performance-regression-detection.test.js)Purpose: Long-term performance monitoring and regression detection
# Run all high-value test suites
npm test -- --testPathPattern="(real-model-inference|memory-usage-validation|error-recovery-verification|performance-regression-detection)"
# Individual test suite execution
npm test -- --testPathPattern="real-model-inference" # Real model tests
npm test -- --testPathPattern="memory-usage-validation" # Memory tests
npm test -- --testPathPattern="error-recovery-verification" # Error tests
npm test -- --testPathPattern="performance-regression" # Performance tests
# Specific test cases
npm test -- --testNamePattern="should have reasonable baseline memory usage"
npm test -- --testNamePattern="should handle missing model file gracefully"
npm test -- --testNamePattern="should establish router initialization baseline"
| Test Suite | Status | Key Metrics | Value Proposition |
|---|---|---|---|
| Real Model Inference | โ Pass | TinyLlama, Phi-2, Qwen2.5 verified | Production readiness validation |
| Memory Validation | โ Pass | RSS=140โ141MB (+1MB), efficient cleanup | Memory leak prevention |
| Error Recovery | โ Pass | ENOENT graceful handling, system resilience | Production reliability assurance |
| Performance Regression | โ Pass | 13.65ms init baseline, trend tracking | Performance optimization |
Our comprehensive testing approach ensures:
router.registerLoader('my-format', MyCustomLoader);
const budget = 0.10; // $0.10 per request
const models = router.optimizeForBudget(availableModels, budget);
const scores = await router.rankModelsByQuality(models, prompt);
We welcome contributions from all dimensions! Whether you're fixing bugs, adding features, or improving documentation, your quantum entanglement with this project is appreciated.
git checkout -b feature/quantum-enhancement)git commit -m 'Add quantum tunneling support')git push origin feature/quantum-enhancement)MIT License - Because sharing is caring, and AI should be for everyone.
Built with ๐ and โ by Echo AI Systems
"Because every business deserves an AI brain, and every AI brain deserves a proper orchestration system"
Remember: With great model power comes great computational responsibility. Use wisely! ๐งโโ๏ธ
127 commits
86 commits
JavaScript
46.7%
HTML
44.6%
Rust
3.4%
Shell
2.7%
Python
1.6%
LLM-Runner-Router is not just another model loader - it's a full-stack agnostic neural orchestration system that adapts to ANY model format, ANY runtime environment, and ANY deployment scenario. Think of it as the Swiss Army knife of AI inference, but cooler and with more quantum entanglement.
1
stars
213
commits
JavaScript
primary language
Sep 8, 2025
updated
Where AI models transcend their formats, engines dance across dimensions, and intelligent inference becomes art
# Clone and enter directory
git clone https://github.com/MCERQUA/LLM-Runner-Router.git
cd LLM-Runner-Router
# Install dependencies
npm install
# Download a model (optional - uses mock by default)
pip install huggingface_hub
huggingface-cli download HuggingFaceTB/SmolLM3-3B-Base --local-dir ./models/smollm3-3b
# Start the server
npm start
# API is ready at https://llmrouter.dev:3006
curl -X POST https://llmrouter.dev:3006/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello, AI!"}'
curl https://llmrouter.dev:3006/api/config
server.js - Main server entry pointsrc/index.js - Core LLMRouter classsrc/loaders/ - Model loaders for different formatsmodels/ - Local model storage.env - Configuration (copy from .env.example)npm start # Start production server
npm run dev # Development with hot reload
npm test # Run test suite
npm run benchmark # Performance testing
npm run docs # Generate documentation
See DEPLOYMENT.md for production setup.
Current Version: 2.0.0 | Development Stage: Production Ready | Last Updated: December 2024
LLM Runner Router is a revolutionary universal AI model orchestration system that intelligently manages, routes, and optimizes inference across 24+ major LLM providers with 95% market coverage. Unlike traditional model loaders, our system provides:
Perfect for developers building AI applications, researchers comparing models, and enterprises deploying scalable AI solutions.
/byok-interface.html# Install via NPM
npm install llm-runner-router
# Or with Yarn
yarn add llm-runner-router
# Or with PNPM
pnpm add llm-runner-router
# Clone the repository
git clone https://github.com/MCERQUA/LLM-Runner-Router.git
cd LLM-Runner-Router
# Install dependencies
npm install
# Launch the development server
npm start
# Run tests
npm test
# Build for production
npm run build
import { LLMRouter } from 'llm-runner-router';
// Initialize the router with intelligent defaults
const router = new LLMRouter({
strategy: 'balanced',
engines: ['webgpu', 'wasm'],
models: {
'microsoft/DialoGPT-small': { priority: 'speed' },
'meta-llama/Llama-2-7b-hf': { priority: 'quality' }
}
});
// Simple text completion
const response = await router.complete("Explain quantum computing in simple terms:");
console.log(response.text);
// Streaming responses
for await (const chunk of router.stream("Write a story about AI:")) {
process.stdout.write(chunk.text);
}
import { LLMRouter, setupOllama, addOllamaModel } from 'llm-runner-router';
// Quick setup - automatically discovers and registers all local Ollama models
const router = new LLMRouter();
const models = await setupOllama();
console.log(`Found ${models.length} Ollama models`);
// Use any discovered model immediately
const response = await router.quick("Explain machine learning:", {
modelId: 'qwen2.5:3b-instruct-q4_K_M'
});
// Add specific models manually
await addOllamaModel('phi3:mini', {
name: 'Phi-3 Mini 3.8B',
description: 'Microsoft\'s efficient small language model'
});
// Alternative: Direct router usage
const router2 = new LLMRouter();
const model = await router2.load({
provider: 'ollama',
modelId: 'qwen2.5:3b-instruct-q4_K_M'
});
const result = await model.generate("Write a haiku about programming:");
console.log(result.text);
// Streaming with Ollama
for await (const token of model.stream("Tell me a story:")) {
process.stdout.write(token.text);
}
Ollama Setup Requirements:
curl -fsSL https://ollama.ai/install.sh | shollama pull qwen2.5:3b-instruct-q4_K_Mollama serve (runs on http://localhost:11434)Popular Ollama Models:
qwen2.5:3b-instruct-q4_K_M - Fast 3B model, 32K context (1.9GB)phi3:mini - Microsoft's 3.8B model, 128K context (2.2GB)llama3.1:8b - Meta's 8B model with reasoning (4.7GB)mistral:7b - Mistral's efficient 7B model (4.1GB)๐ Complete Ollama Setup Guide: docs/OLLAMA_SETUP.md
import { APILoader } from 'llm-runner-router/loaders';
// Industry Standards
const openai = new APILoader({
provider: 'openai',
apiKey: process.env.OPENAI_API_KEY
});
await openai.load('gpt-4');
const response = await openai.generate('Hello, GPT!');
const anthropic = new APILoader({
provider: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY
});
await anthropic.load('claude-3-sonnet-20240229');
const claude = await anthropic.generate('Hello, Claude!');
// Enterprise Cloud Giants (NEW!)
const bedrock = new APILoader({
provider: 'bedrock',
region: 'us-east-1',
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
}
});
await bedrock.load('anthropic.claude-3-sonnet-20240229-v1:0');
const aws = await bedrock.generate('Hello from AWS Bedrock!');
const azure = new APILoader({
provider: 'azure-openai',
endpoint: 'https://your-resource.openai.azure.com/',
apiKey: process.env.AZURE_OPENAI_API_KEY
});
await azure.load('gpt-4');
const microsoft = await azure.generate('Hello from Azure OpenAI!');
const vertex = new APILoader({
provider: 'vertex-ai',
projectId: 'your-project-id',
location: 'us-central1',
keyFilename: './service-account.json'
});
await vertex.load('gemini-1.5-pro');
const google = await vertex.generate('Hello from Google Vertex AI!');
const mistral = new APILoader({
provider: 'mistral',
apiKey: process.env.MISTRAL_API_KEY,
dataResidency: 'eu' // GDPR compliant
});
await mistral.load('mistral-large-latest');
const european = await mistral.generate('Bonjour from Mistral AI!');
// High-Performance Inference (NEW!)
const together = new APILoader({
provider: 'together',
apiKey: process.env.TOGETHER_API_KEY,
enableBatchMode: true
});
await together.load('meta-llama/Llama-2-70b-chat-hf');
const opensource = await together.generate('Open source power!');
const fireworks = new APILoader({
provider: 'fireworks',
apiKey: process.env.FIREWORKS_API_KEY,
enableFireAttention: true,
enableHIPAA: true
});
await fireworks.load('accounts/fireworks/models/llama-v3p1-70b-instruct');
const enterprise = await fireworks.generate('Enterprise-grade inference!');
const groq = new APILoader({
provider: 'groq',
apiKey: process.env.GROQ_API_KEY
});
await groq.load('mixtral-8x7b-32768');
const fast = await groq.generate('Lightning speed inference!');
// Security & Performance Examples (NEW!)
import { SecurityValidator, PerformanceBenchmark } from 'llm-runner-router/utils';
// Security validation
const security = new SecurityValidator();
const credentialCheck = security.validateCredentials('openai', { apiKey: 'sk-...' });
const requestCheck = security.validateRequest({ prompt: 'Hello' }, 'openai');
// Performance benchmarking
const benchmark = new PerformanceBenchmark();
const results = await benchmark.runBenchmarkSuite(openai, {
categories: ['simple', 'medium', 'complex'],
iterations: 5,
includeStressTest: true,
includeConcurrencyTest: true
});
console.log(`Performance Grade: ${results.summary.overallGrade}`);
console.log(`Average Latency: ${results.summary.averageMetrics.latency}ms`);
Experience LLM Runner Router in action:
๐ฎ Try Interactive Demo - Real-time model routing with streaming responses
๐ Browse Documentation - Complete API reference and guides
import { quick } from 'llm-runner-router';
// Just ask, and ye shall receive
const response = await quick("Explain quantum computing to a goldfish");
console.log(response.text);
import LLMRouter from 'llm-runner-router';
const router = new LLMRouter({
strategy: 'quality-first',
enableQuantumMode: true // (Not actually quantum, but sounds cool)
});
// Load multiple models
await router.load('huggingface:meta-llama/Llama-2-7b');
await router.load('local:./models/mistral-7b.gguf');
await router.load('bitnet:microsoft/BitNet-b1.58-2B-4T');
// Let the router choose the best model
const response = await router.advanced({
prompt: "Write a haiku about JavaScript",
temperature: 0.8,
maxTokens: 50,
fallbacks: ['gpt-3.5', 'local-llama']
});
const stream = router.stream("Tell me a story about a debugging dragon");
for await (const token of stream) {
process.stdout.write(token);
}
const result = await router.ensemble([
{ model: 'gpt-4', weight: 0.5 },
{ model: 'claude', weight: 0.3 },
{ model: 'llama', weight: 0.2 }
], "What is the meaning of life?");
// Get wisdom from multiple AI perspectives!
LLM Runner Router now supports Microsoft BitNet - revolutionary 1.58-bit quantized models that deliver:
# Install prerequisites (CMake required)
sudo apt-get install cmake # Ubuntu/Debian
brew install cmake # macOS
# Setup BitNet integration
npm run setup:bitnet
# Download a model
cd temp/bitnet-repo
python3 setup_env.py --hf-repo microsoft/BitNet-b1.58-2B-4T --quant-type i2_s
// Load official Microsoft BitNet model
const bitnetModel = await router.load({
source: 'microsoft/BitNet-b1.58-2B-4T',
type: 'bitnet',
quantType: 'i2_s',
threads: 4
});
// Generate with 1-bit efficiency
const response = await router.generate('Explain neural networks', {
modelId: bitnetModel.id,
maxTokens: 200
});
LLM Runner Router delivers exceptional performance across all supported engines:
| Engine | Model Format | Tokens/sec | First Token (ms) | Memory Usage |
|---|---|---|---|---|
| WebGPU | GGUF Q4 | 125 | 45 | 2.1 GB |
| WASM | ONNX | 85 | 120 | 1.8 GB |
| Node.js | Safetensors | 200 | 30 | 3.2 GB |
| BitNet | 1.58-bit | 150 | 35 | 0.7 GB |
Benchmarks run on MacBook Pro M2, 16GB RAM. Results may vary based on hardware.
LLM Runner Router supports all major AI model formats including GGUF, BitNet (1-bit LLMs), ONNX, Safetensors, HuggingFace Hub models, and custom formats. Our universal loader architecture automatically detects and optimizes loading for each format.
Yes! LLM Runner Router is designed for universal deployment. Use WebGPU for GPU-accelerated browser inference or WASM for maximum compatibility across all browsers and devices.
Our routing system evaluates models based on your configured strategy (quality, cost, speed, or balanced) and automatically selects the optimal model for each request. Custom routing strategies can be defined with JavaScript functions.
Absolutely. LLM Runner Router includes enterprise-grade features like load balancing, failover handling, performance monitoring, and security best practices. See our deployment guide for production setup.
Yes! LLM Runner Router supports model ensemble techniques, A/B testing, and parallel inference across multiple models with intelligent request distribution.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Your Application โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ LLM-Runner-Router โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโค
โ Router โ Pipeline โ Registry โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโค
โ Engines (WebGPU, WASM, Node) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Loaders (GGUF, ONNX, Safetensors) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Choose your destiny:
{
"routingStrategy": "balanced",
"maxModels": 100,
"enableCaching": true,
"quantization": "dynamic",
"preferredEngine": "webgpu",
"maxTokens": 4096,
"cosmicAlignment": true // Optional but recommended
}
LLM Runner Router includes a state-of-the-art testing framework with high-value test suites covering all critical aspects of production AI orchestration systems.
LLM Router Functional Test Suite - Comprehensive external testing framework for AI/ML capability validation
# Quick start with external test suite
git clone https://github.com/MCERQUA/LLM-Runner-Test-Suite.git
cd LLM-Runner-Test-Suite
cp example.env .env # Configure your API endpoint
./functional-llm-router-tests.sh # Run AI/ML tests
./comprehensive-test-suite.sh # Run all infrastructure tests
This external test suite provides end-to-end validation of your deployed LLM Router instance, testing real AI capabilities rather than just infrastructure.
tests/integration/real-model-inference.test.js)Purpose: End-to-end validation with actual model files for production readiness
tests/performance/memory-usage-validation.test.js)Purpose: Ensures efficient memory management with large models (1-3GB each)
tests/resilience/error-recovery-verification.test.js)Purpose: System resilience and self-healing capabilities testing
tests/performance/performance-regression-detection.test.js)Purpose: Long-term performance monitoring and regression detection
# Run all high-value test suites
npm test -- --testPathPattern="(real-model-inference|memory-usage-validation|error-recovery-verification|performance-regression-detection)"
# Individual test suite execution
npm test -- --testPathPattern="real-model-inference" # Real model tests
npm test -- --testPathPattern="memory-usage-validation" # Memory tests
npm test -- --testPathPattern="error-recovery-verification" # Error tests
npm test -- --testPathPattern="performance-regression" # Performance tests
# Specific test cases
npm test -- --testNamePattern="should have reasonable baseline memory usage"
npm test -- --testNamePattern="should handle missing model file gracefully"
npm test -- --testNamePattern="should establish router initialization baseline"
| Test Suite | Status | Key Metrics | Value Proposition |
|---|---|---|---|
| Real Model Inference | โ Pass | TinyLlama, Phi-2, Qwen2.5 verified | Production readiness validation |
| Memory Validation | โ Pass | RSS=140โ141MB (+1MB), efficient cleanup | Memory leak prevention |
| Error Recovery | โ Pass | ENOENT graceful handling, system resilience | Production reliability assurance |
| Performance Regression | โ Pass | 13.65ms init baseline, trend tracking | Performance optimization |
Our comprehensive testing approach ensures:
router.registerLoader('my-format', MyCustomLoader);
const budget = 0.10; // $0.10 per request
const models = router.optimizeForBudget(availableModels, budget);
const scores = await router.rankModelsByQuality(models, prompt);
We welcome contributions from all dimensions! Whether you're fixing bugs, adding features, or improving documentation, your quantum entanglement with this project is appreciated.
git checkout -b feature/quantum-enhancement)git commit -m 'Add quantum tunneling support')git push origin feature/quantum-enhancement)MIT License - Because sharing is caring, and AI should be for everyone.
Built with ๐ and โ by Echo AI Systems
"Because every business deserves an AI brain, and every AI brain deserves a proper orchestration system"
Remember: With great model power comes great computational responsibility. Use wisely! ๐งโโ๏ธ
127 commits
86 commits
JavaScript
46.7%
HTML
44.6%
Rust
3.4%
Shell
2.7%
Python
1.6%