๐ŸŽฏ Autonomous Agent Router

SLM Orchestrator

Autonomous meta-agent that inspects incoming user queries, dynamically selects appropriate sub-agents, and sequences multi-step execution graphs.

๐Ÿš€ Overview & Capabilities

Autonomous meta-agent that inspects incoming user queries, dynamically selects appropriate sub-agents, and sequences multi-step execution graphs.

Key Features

  • Dynamic routing across local specialized SLM agents
  • ReAct reasoning loop with tool-execution feedback cycles
  • Parallel tool execution branches
  • Automatic fallback handling on sub-agent errors

๐Ÿ’ป Installation

Install the local package using pip:

Terminal
$pip install slm-orchestrator

๐Ÿ™ Checkout from GitHub

Clone only this agent's folder from the monorepo using Git sparse-checkout โ€” no need to download the full repository:

Option 1 โ€” Sparse Checkout (Recommended)

Terminal โ€” Git Sparse Checkout
# 1. Create and enter a new directory
$ mkdir slm_orchestrator && cd slm_orchestrator

# 2. Initialise empty git repo and add remote
$ git init
$ git remote add origin https://github.com/t00114218-stack/SLMAgents.git

# 3. Enable sparse-checkout and set target folder
$ git sparse-checkout init --cone
$ git sparse-checkout set slm_orchestrator

# 4. Pull only that agent's source
$ git pull origin main

Option 2 โ€” Full Repository Clone

Terminal โ€” Full Clone
$ git clone https://github.com/t00114218-stack/SLMAgents.git
$ cd SLMAgents/slm_orchestrator

๐Ÿ’ก Tip: After checkout, install the package locally with pip install -e ./slm_orchestrator to run in editable mode without publishing to PyPI.

โš™๏ธ Configuration API

Constructor Parameters

Instantiate SLMOrchestrator with performance and runtime options:

ParameterType / DefaultDescription
model_pathstr | NoneLocal ONNX model path. Default: None.
temperaturefloat | 0.0Routing decision temperature. Default: 0.0.
top_pfloat | 0.9Nucleus sampling cutoff. Default: 0.9.
max_tokensint | 256Maximum generation token limit. Default: 256.
n_threadsint | 4CPU threads for inference. Default: 4.

Methods

Method SignatureReturn TypeDescription
route(agents, question, ...)dictRoutes user query to the best-matching agent or tool callback chain.

Execution Parameters

Complete list of execution parameters accepted by the primary agent method:

ParameterType / DefaultDescription
agentslist[str] | dictList of available sub-agent names.
questionstrUser query string requiring routing.
system_promptstr | NoneSystem routing instruction override. Default: None.
user_inputstr | NoneContextual parameter key values. Default: None.
temperaturefloat | 0.0Sampling temperature. Default: 0.0.
top_pfloat | 0.9Nucleus sampling probability. Default: 0.9.
max_tokensint | 256Maximum token limit. Default: 256.

Quick Start

Python Example
from slm_orchestrator import SLMOrchestrator

orchestrator = SLMOrchestrator(temperature=0.0, top_p=0.9, max_tokens=256)
res = orchestrator.route(
    agents=["RAG", "TextToSQL", "Math"],
    question="Calculate tax for Q3 revenue",
    system_prompt="Prioritize Math agent for calculation steps",
    user_input="Tax rate: 15%",
    temperature=0.0,
    top_p=0.9,
    max_tokens=256
)
print(res)

๐Ÿ” Verified Output Logs

Diagnostic execution console output running locally on CPU:

Output Console
โ†’ INPUT:
Question: Calculate tax for Q3 revenue

โ† OUTPUT:
{
  'selected_agent': 'Math',
  'result': 'Calculated Q3 tax: $187,500'
}