{% extends "settings_base.html" %} {% import "_connection_summary.html" as summaries %} {% import "_status_badge.html" as badges %} {% import "_fallback_defaults_form.html" as fallback_forms %} {% import "_icons.html" as icons %} {% block summary_cards %} {{ summaries.summary_card("RT", "Active routes", summary.active_routes | compact_number, "Across startup and settings") }} {{ summaries.summary_card("FB", "Default provider", fallback.provider_name | default("No provider", true), "Used for fallback", true) }} {{ summaries.summary_card("MD", "Default model", fallback.model | default("No model", true), "Fallback send-as model") }} {{ summaries.summary_card("DB", "Stored rows", summary.stored_rows | compact_number, (summary.rows_older_than_retention | compact_number) ~ " older than " ~ summary.retention_days ~ " days") }} {% endblock %} {% block settings_content %}

Route Registry

Exact routes win first; prefix routes must end with *.

{{ icons.icon("plus", class_name="button-icon") }}Add route
{% for route in model_routes %} {% else %} {% endfor %}
Incoming model Match type Route upstream URL Send as model Provider Fallback Priority Status Actions
{{ route.model }}{{ route.source | default("settings", true) | title }} {{ route.match_type }} {{ route.upstream_url }} {{ route.upstream_model }} {{ route.provider_name | default(route.provider_slug | default("Auto", true), true) }} {{ "Override" if route.override_fallback else "Default" }} {{ route.priority }} {{ badges.status_badge("Active" if route.active else "Inactive") }} {% if route.editable %}
{% else %} Locked {% endif %}
No model routes are configured.

Default Route Discovery

Create routes from active provider pricing rows and aliases.

{{ badges.status_badge("Seeded") }}

Preview or apply generated routes for known models.

Selected Route

Click an editable row to load it here, or save a new route.

{{ badges.status_badge("Editable") }}

Requests matching this pattern will be sent to the selected upstream; prefix patterns should be entered like local-*.

{{ fallback_forms.fallback_defaults_form( "Fallback Routing Behavior", "Resolution runs startup routes, editable routes, then fallback.", providers, default_provider_slug, default_model, fallback_enabled, upstream_url, "/admin/settings/routing", "Save fallback behavior" ) }}

Route Simulator / Diagnostics

Preview how an incoming model name resolves before sending traffic.

Simulation results will appear here.

A sample request appears after simulation.

Recent Route Usage

Requests matched since local midnight.

{{ icons.icon("requests", class_name="button-icon") }}View requests
{% for row in route_usage %} {% else %} {% endfor %}
Route Requests today Last matched
{{ row.route }} {{ row.requests_today | compact_number }} {{ row.last_matched_at | default("-", true) }}
No route matches recorded today.
{% endblock %}