31 lines
1.7 KiB
HTML
31 lines
1.7 KiB
HTML
{% if not reachable %}
|
|
<div class="alert">llama-server unreachable at <span class="mono">{{ base_url }}</span>{% if error %}: {{ error }}{% endif %}</div>
|
|
<div class="muted small">start it in router mode: <span class="mono">llama-server --models-dir /path/to/models</span></div>
|
|
{% else %}
|
|
<div class="llama-health">
|
|
<span class="dot {{ "dot-run" if health == "ok" else "dot-failed" }}"></span>
|
|
<span class="llama-health-text">{{ "healthy" if health == "ok" else (health or "status unknown") }}</span>
|
|
<span class="muted small mono">{{ base_url }}</span>
|
|
</div>
|
|
{% if message %}<div class="notice">{{ message }}</div>{% endif %}
|
|
{% if error_msg %}<div class="alert">{{ error_msg }}</div>{% endif %}
|
|
|
|
<h4>Loaded models</h4>
|
|
{% if loaded %}
|
|
<div class="llama-models">
|
|
{% for m in loaded %}
|
|
<div class="llama-model">
|
|
<span class="dot {{ "dot-run" if m.state == "loaded" else ("dot-sleep" if m.state == "sleeping" else ("dot-failed" if m.failed else "dot-busy")) }}"></span>
|
|
<span class="mono llama-id" title="{{ m.path }}">{{ m.id }}</span>
|
|
<span class="badge badge-{{ "failed" if m.failed else m.state }}">{{ m.state }}{% if m.failed %} (exit {{ m.exit_code }}){% endif %}</span>
|
|
{% if m.progress is not none %}<div class="bar small-bar"><div class="bar-fill" style="width: {{ m.progress }}%"></div></div>{% endif %}
|
|
<span class="llama-model-actions">
|
|
<button class="btn" hx-post="/api/plugins/llamacpp/unload" hx-vals='{"model":"{{ m.id }}"}' hx-target="closest .plugin-body" hx-swap="innerHTML" hx-confirm="Unload {{ m.id }}?">unload</button>
|
|
</span>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="muted small">no models loaded</div>
|
|
{% endif %}
|
|
{% endif %}
|