SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.13979 · 2024

Routoo: Learning to Route to Large Language Models Effectively

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2401.13979.json · badge: /api/ran/2401.13979.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
leeroo-ai/leeroo_orchestrator canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
get_available_instances Ran
ran; our contract draft was wrong, not the code
leeroo-ai/leeroo_orchestrator/app/utils/aws_ec2_utils.py
code served (permissive licence) · get_code("c511f255cfc32c16")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class AwsEngine:
    """Stand-in AWS Engine with EC2 mock."""
    def __init__(self):
        self.ec2 = MockEC2()


class MockEC2:
    """Mock EC2 client that returns describe_instances response."""
    def describe_instances(self):
        """Return a mock AWS describe_instances response structure."""
        return {
            'Reservations': [
                {
                    'Instances': [
                        {
                            'InstanceId': 'i-1234567890abcdef0',
                            'InstanceType': 't2.micro',
                            'State': {'Name': 'running'},
                            'PublicIpAddress': '203.0.113.12',
                        },
                        {
                            'InstanceId': 'i-0987654321fedcba0',
                            'InstanceType': 't2.small',
                            'State': {'Name': 'stopped'},
                            'PublicIpAddress': '203.0.113.13',
                        },
                    ]
                },
                {
                    'Instances': [
                        {
                            'InstanceId': 'i-abcdef1234567890',
                            'InstanceType': 't2.medium',
                            'State': {'Name': 'running'},
                            'PublicIpAddress': '203.0.113.14',
                        },
                    ]
                },
            ]
        }


aws_engine = AwsEngine()

ARGS = {
    'aws_engine': aws_engine,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_hf_image Ran
ran; our contract draft was wrong, not the code
leeroo-ai/leeroo_orchestrator/app/utils/aws_sagemaker_utils.py
code served (permissive licence) · get_code("cb38fce50ea91649")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

ARGS = {
    'boto_region_name': 'us-east-1'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_instance Ran
ran; our contract draft was wrong, not the code
leeroo-ai/leeroo_orchestrator/app/utils/aws_ec2_utils.py
code served (permissive licence) · get_code("7f01b73112057bfa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from unittest.mock import Mock, MagicMock

# Create a mock AwsEngine with an ec2 client
aws_engine = Mock()
aws_engine.ec2 = Mock()

# Mock the describe_instances method to return a valid AWS response structure
aws_engine.ec2.describe_instances = MagicMock(return_value={
    'Reservations': [
        {
            'Instances': [
                {
                    'InstanceId': 'i-1234567890abcdef0',
                    'InstanceType': 't2.micro',
                    'State': {'Name': 'running'},
                    'PublicIpAddress': '192.0.2.1',
                    'PrivateIpAddress': '10.0.0.1'
                }
            ]
        }
    ]
})

InstanceId = 'i-1234567890abcdef0'

ARGS = {
    'aws_engine': aws_engine,
    'InstanceId': InstanceId
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_instance_name Ran
ran; our contract draft was wrong, not the code
leeroo-ai/leeroo_orchestrator/app/server_manager.py
code served (permissive licence) · get_code("731e7e89992ee7f0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'model_id': 'gpt-3',
    'server_type': 'production'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_realtime_response_stream Ran
ran; our contract draft was wrong, not the code
leeroo-ai/leeroo_orchestrator/app/utils/aws_sagemaker_utils.py
code served (permissive licence) · get_code("5488fdc21b8c3b74")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Mock. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
from unittest.mock import Mock, MagicMock


class MockSagemakerRuntime:
    """Mock AWS Sagemaker Runtime client."""
    
    def invoke_endpoint_with_response_stream(self, EndpointName, Body, ContentType, CustomAttributes):
        """Mock method that simulates streaming response from Sagemaker endpoint."""
        # Return a mock response stream object
        response_stream = Mock()
        response_stream.get_stream = Mock(return_value=iter([
            {'PayloadPart': {'Bytes': b'{"generated_text": "Hello world"}'}}
        ]))
        return response_stream


# Create mock sagemaker runtime
sagemaker_runtime = MockSagemakerRuntime()

# Define endpoint name
endpoint_name = "test-endpoint-name"

# Define payload - a simple request dictionary
payload = {
    "inputs": "What is machine learning?",
    "parameters": {
        "max_length": 100,
        "temperature": 0.7
    }
}

# Construct ARGS dictionary with all required parameters
ARGS = {
    "sagemaker_runtime": sagemaker_runtime,
    "endpoint_name": endpoint_name,
    "payload": payload
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Mock — a Mock output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_ec2_instance_present Ran
ran; our contract draft was wrong, not the code
leeroo-ai/leeroo_orchestrator/app/utils/aws_ec2_utils.py
code served (permissive licence) · get_code("ddb07a8d209600be")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from unittest.mock import Mock, MagicMock


# Create a mock AwsEngine with ec2 connection
class MockAwsEngine:
    def __init__(self):
        self.ec2 = Mock()
        
        # Mock the describe_instances response with realistic structure
        self.ec2.describe_instances.return_value = {
            'Reservations': [
                {
                    'Instances': [
                        {
                            'InstanceId': 'i-1234567890abcdef0',
                            'State': {'Name': 'running'},
                            'Tags': [
                                {'Key': 'Name', 'Value': 'test-instance-1'}
                            ]
                        },
                        {
                            'InstanceId': 'i-0987654321fedcba0',
                            'State': {'Name': 'stopped'},
                            'Tags': [
                                {'Key': 'Name', 'Value': 'test-instance-2'}
                            ]
                        }
                    ]
                },
                {
                    'Instances': [
                        {
                            'InstanceId': 'i-abcdefghijklmnop',
                            'State': {'Name': 'terminated'},
                            'Tags': [
                                {'Key': 'Name', 'Value': 'test-instance-3'}
                            ]
                        }
                    ]
                }
            ]
        }


aws_engine = MockAwsEngine()
instance_name = 'test-instance-1'

ARGS = {
    'aws_engine': aws_engine,
    'instance_name': instance_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_response_stream Not yet run
unverified (harvested, no recorded run)
leeroo-ai/leeroo_orchestrator/app/utils/aws_sagemaker_utils.py
code served (permissive licence) · get_code("b7388f13c43b45e8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

LLMs with superior response quality--particularly larger or closed-source models--often come with higher inference costs, making their deployment inefficient and costly. Meanwhile, developing foundational LLMs from scratch is becoming increasingly resource-intensive and impractical for many applications. To address the challenge of balancing quality and cost, we introduce Routoo, an architecture designed to optimize the selection of LLMs for specific prompts based on performance, cost, and efficiency. Routoo provides controllability over the trade-off between inference cost and quality, enabling significant reductions in inference costs for a given quality requirement. Routoo comprises two key components: a performance predictor and cost-aware selector. The performance predictor is a lightweight LLM that estimates the expected performance of various underlying LLMs on a given prompt without executing them. The cost-aware selector module then selects the most suitable model based on these predictions and constraints such as cost and latency, significantly reducing inference costs for the same quality. We evaluated Routoo using the MMLU benchmark across 57 domains employing open-source models. Our results show that Routoo matches the performance of the Mixtral 8x7b model while reducing inference costs by one-third. Additionally, by allowing increased costs, Routoo surpasses Mixtral's accuracy by over 5% at equivalent costs, achieving an accuracy of 75.9%. When integrating GPT4 into our model pool, Routoo nearly matches GPT4's performance at half the cost and exceeds it with a 25% cost reduction. These outcomes highlight Routoo's potential to significantly reduce inference costs without compromising quality, and even to establish new state-of-the-art results by leveraging the collective capabilities of multiple LLMs.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2401.13979")
get_code_for_paper("2401.13979")
have("2401.13979")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2401.13979.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2401.13979.svg)](https://syntology.ai/paper/2401.13979)

Connect an agent — have() is free.