Render markdown in gist and project sidebar titles; add content visibility and GIF picker
DevPlace CI / test (push) Failing after 1h5m29s
DevPlace CI / test (push) Failing after 1h5m29s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -21,21 +21,24 @@
|
||||
<section class="gw-section">
|
||||
<div class="gw-section-head">
|
||||
<h3>Model routes</h3>
|
||||
<form method="post" action="/admin/gateway/models/test-all" class="gw-inline-form">
|
||||
<button type="submit" class="admin-btn admin-btn-sm">Test all</button>
|
||||
</form>
|
||||
<a href="/admin/gateway/models/new" class="admin-btn admin-btn-primary admin-btn-sm">Add model route</a>
|
||||
</div>
|
||||
<p class="gw-section-hint">Each source model maps to a provider and target model with its own economy. Chat uses cache-hit, cache-miss and output prices (USD per 1M tokens); embeddings use the input price; image routes use the input price as a flat USD per image; a vision model adds input and output pricing for the image description merge. An optional fallback model is retried once, automatically, whenever this route fails after its own retries are exhausted.</p>
|
||||
<p class="gw-section-hint">Each source model maps to a provider and target model with its own economy. Chat uses cache-hit, cache-miss and output prices (USD per 1M tokens); embeddings use the input price; image routes use the input price as a flat USD per image; a vision model adds input and output pricing for the image description merge. An optional fallback model is followed link by link, automatically, whenever this route fails after its own retries are exhausted; unhealthy and inactive links are skipped. Test sends one tiny real call per route (image tests generate one hedgehog-and-bear picture, shown after); a failing route is hidden from the model list until a later test passes.</p>
|
||||
<div class="admin-table-wrap">
|
||||
<table class="admin-table">
|
||||
<caption class="sr-only">Model routes</caption>
|
||||
<thead>
|
||||
<tr><th scope="col">Source</th><th scope="col">Provider</th><th scope="col">Target</th><th scope="col">Kind</th><th scope="col">Vision</th><th scope="col">Economy</th><th scope="col" class="gw-actions">Actions</th></tr>
|
||||
<tr><th scope="col">Source</th><th scope="col">Provider</th><th scope="col">Target</th><th scope="col">Kind</th><th scope="col">Vision</th><th scope="col">Economy</th><th scope="col">Health</th><th scope="col" class="gw-actions">Actions</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if not models %}
|
||||
<tr><td colspan="7" class="admin-empty">No model routes. Requests fall through to the default upstream.</td></tr>
|
||||
<tr><td colspan="8" class="admin-empty">No model routes. Requests fall through to the default upstream.</td></tr>
|
||||
{% endif %}
|
||||
{% for m in models %}
|
||||
<tr>
|
||||
<tr{% if m.health_status == 'bad' %} class="gw-row-bad"{% endif %}>
|
||||
<td>{{ m.source_model }}</td>
|
||||
<td>{{ m.provider or "default" }}</td>
|
||||
<td><code class="gw-code">{{ m.target_model }}</code></td>
|
||||
@@ -52,9 +55,23 @@
|
||||
{% if m.off_peak_start_minute is not none %}<span class="gw-badge" title="{{ m.off_peak_discount_pct }}% off during the configured UTC window">off-peak</span>{% endif %}
|
||||
{% if m.kind == 'image' and m.price_input_per_m %}<span class="gw-badge" title="Flat price per generated image">${{ m.price_input_per_m }}/img</span>{% endif %}
|
||||
{% if m.fallback_model %}<span class="gw-badge" title="Falls back to {{ m.fallback_model }} on failure">fallback: {{ m.fallback_model }}</span>{% endif %}
|
||||
{% if not m.context_tier_threshold_tokens and m.off_peak_start_minute is none and not (m.kind == 'image' and m.price_input_per_m) and not m.fallback_model %}<span class="gw-muted">-</span>{% endif %}
|
||||
{% if m.tools_mode == 'emulated' %}<span class="gw-badge" title="This model does not support tool calling; tools are emulated through the prompt">tools: emulated</span>{% endif %}
|
||||
{% if not m.context_tier_threshold_tokens and m.off_peak_start_minute is none and not (m.kind == 'image' and m.price_input_per_m) and not m.fallback_model and m.tools_mode != 'emulated' %}<span class="gw-muted">-</span>{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if m.health_status == 'bad' %}
|
||||
<span class="gw-badge gw-badge-bad">unhealthy</span>
|
||||
<div class="gw-health-error"><code class="gw-code">{{ m.health_code }}</code> {{ m.health_message }}</div>
|
||||
{% elif m.health_status == 'ok' %}
|
||||
<span class="gw-badge gw-badge-ok" title="Last checked {{ m.health_checked_at }}">ok</span>
|
||||
{% else %}
|
||||
<span class="gw-muted">-</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="gw-actions">
|
||||
<form method="post" action="/admin/gateway/models/{{ m.source_model }}/test" class="gw-inline-form">
|
||||
<button type="submit" class="admin-btn admin-btn-sm">Test</button>
|
||||
</form>
|
||||
<a class="admin-btn admin-btn-sm" href="/admin/gateway/models/{{ m.source_model }}/edit">Edit</a>
|
||||
<form method="post" action="/admin/gateway/models/{{ m.source_model }}/delete" class="gw-inline-form">
|
||||
<button type="submit" class="admin-btn admin-btn-sm admin-btn-danger" data-confirm="Delete model route "{{ m.source_model }}"?">Delete</button>
|
||||
@@ -65,6 +82,20 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% if test_image %}
|
||||
<div id="gw-test-image-modal" class="modal-overlay visible">
|
||||
<div class="modal">
|
||||
<div class="modal-header">
|
||||
<h3>Test image: {{ tested }}</h3>
|
||||
<a href="/admin/gateway?tab=models" class="modal-close" aria-label="Close dialog">×</a>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<img src="{{ test_image }}" alt="Generated test image: a hedgehog and a bear" class="gw-test-image">
|
||||
<p class="gw-section-hint">Generated by the "{{ tested }}" route: a hedgehog and a bear.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user