---
name: optimizing-multi-model-routing-from-telemetry-traces
description: "Reviews inference gateway telemetry and query logs to cluster prompt archetypes and recommend cost-effective model routing rules. Use when balancing model cost against latency and accuracy across self-hosted and cloud providers."
license: CC-BY-4.0
compatibility: "Needs access to: Database, Terminal, GitHub, Chat."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-15"
  source: "https://botbento.com/usecases/optimizing-multi-model-routing-from-telemetry-traces/"
  kind: workflow
  hermes:
    tags: ["llm", "routing", "gateway", "cost-optimization", "telemetry"]
    category: ops
    requires_toolsets: ["terminal"]
---
# Optimizing multi-model routing from telemetry traces

Analyze prompt logs and latency metrics to recommend cost-effective model routing rules

## When to use

This bot inspects telemetry traces and query logs from your inference gateway, clusters common prompt archetypes, and evaluates candidate models to balance cost against latency and accuracy. It drafts routing policies and cache configuration changes to optimize resource utilization across self-hosted and cloud providers.

## Inputs

- `telemetry_database`: Gateway telemetry database containing sample prompt traces, token usage, and response latencies across active providers
- `quality_thresholds`: Acceptable quality thresholds candidate fallback models must meet during standard quality checks
- `routing_config_files` (optional): Existing routing configuration files to update with cheaper or faster model alternatives

## Steps

1. On a schedule: Weekly telemetry review (Runs weekly as a scheduled telemetry review of gateway traces and costs). Schedule: `0 9 * * 1`
2. Analyze prompt traces and costs
3. Submit routing rule pull request

## Instructions

Query the gateway telemetry database to extract sample prompt traces, token usage, and response latencies across active providers. Group requests by task complexity and test candidate fallback models against standard quality checks. When you identify cheaper or faster alternatives that maintain acceptable quality thresholds, draft updated routing configuration files. Always wait for human approval before opening a pull request on GitHub or applying any routing updates to live gateway environments.

## Approvals

- Opening a pull request on GitHub with updated routing configuration files must wait for human approval.
- Applying any routing updates to live gateway environments must wait for human approval.

## Output

Draft routing configuration changes submitted as a pull request after human approval (format: pull_request)

## Source

Summarized in our own words from [Show HN: We built open OpenRouter that turns usage into a better model](https://news.ycombinator.com/item?id=49471407) (Hacker News, checked 2026-10-15). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/optimizing-multi-model-routing-from-telemetry-traces/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
