{% 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("PV", "Active providers", summary.active_providers | compact_number, "Across all environments") }} {{ summaries.summary_card("DF", "Default provider", fallback.provider_name | default("No provider", true), "Used for fallback", true) }} {{ summaries.summary_card("MD", "Default model family", fallback.model | default("No model", true), "Used when no route matches") }} {{ 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 %}

Provider Registry

Base URLs, auth environment variables, capabilities, and fallback status.

{{ icons.icon("plus", class_name="button-icon") }}Add provider
{% for provider in providers %} {% set usage = provider_usage | selectattr("provider_slug", "equalto", provider.slug) | list | first %} {% else %} {% endfor %}
Provider Slug Base URL Currency Status Models / Routes Actions
{{ icons.provider_badge(provider.slug, provider.name) }}{{ provider.name }}{% if provider.is_default_fallback %}Default fallback{% endif %} {{ provider.slug }} {{ provider.upstream_url | default("-", true) }} {{ provider.currency }} {{ badges.status_badge("Active" if provider.active else "Inactive") }} {{ usage.active_routes | default(0, true) }} routes
No providers are configured.

Selected Provider

Click a provider row to load it here, or save a new provider.

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

A default fallback provider must be active and should have a reachable OpenAI-compatible base URL.

{{ fallback_forms.fallback_defaults_form( "Fallback Defaults", "Route misses can use a default provider and model.", providers, default_provider_slug, default_model, fallback_enabled, upstream_url, "/admin/settings/providers", "Save fallback defaults" ) }}

Provider Health / Diagnostics

Lightweight checks call each configured provider's /models endpoint.

{% for provider in providers %} {% set health = health_results.get(provider.slug, {}) %} {% endfor %}
Provider Last check Latency Auth Result
{{ provider.name }} {{ health.checked_at | default("Not checked", true) }} {{ health.latency_ms | default("-", true) }} {{ health.auth_state | default(provider.api_key_env | default("not configured", true), true) }} {{ badges.status_badge(health.status | default("Warning", true)) }}

Recent Provider Usage

Requests, estimated cost, and active routes since local midnight.

{{ icons.icon("requests", class_name="button-icon") }}View requests
{% for row in provider_usage %} {% else %} {% endfor %}
Provider Requests today Estimated cost Active routes
{{ row.provider_name }} {{ row.requests_today | compact_number }} {{ row.estimated_cost_usd | usd }} {{ row.active_routes | compact_number }}
No provider usage recorded today.
{% endblock %}