optimize ui

add new ki endpoint params
This commit is contained in:
team2
2026-02-17 20:36:47 +01:00
parent 5b2a633a99
commit 6822c8f3f8
23 changed files with 1915 additions and 608 deletions

View File

@@ -0,0 +1,139 @@
{% extends 'admin/base.html.twig' %}
{% block title %}Neue Modell-Generierungskonfiguration{% endblock %}
{% block body %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="h3">Neue Modell-Generierungskonfiguration</h1>
<a href="{{ path('admin_model_config_list') }}"
class="btn btn-sm btn-outline-secondary">
Zurück
</a>
</div>
<div class="card bg-black border-secondary text-light">
<div class="card-body">
<form method="post">
<input type="hidden" name="_token"
value="{{ csrf_token('create_model_config') }}">
<div class="row g-4">
<!-- Modell -->
<div class="col-md-6">
<label class="form-label">Modellname</label>
<input type="text"
name="model_name"
class="form-control bg-dark text-light border-secondary"
placeholder="z. B. qwen3:latest"
required>
<div class="form-text text-secondary">
Exakter Modellname wie im Endpunkt konfiguriert.
</div>
</div>
<!-- Stream -->
<div class="col-md-6 d-flex align-items-center">
<div class="form-check form-switch mt-4">
<input class="form-check-input"
type="checkbox"
name="stream"
value="1"
id="streamSwitch">
<label class="form-check-label" for="streamSwitch">
Streaming aktivieren
</label>
</div>
</div>
<!-- Temperature -->
<div class="col-md-4">
<label class="form-label">Temperature</label>
<input type="number"
step="0.1"
min="0"
max="2"
name="temperature"
value="0.1"
class="form-control bg-dark text-light border-secondary"
required>
<div class="form-text text-secondary">
Niedrige Werte = deterministisch (empfohlen für RAG).
</div>
</div>
<!-- Top K -->
<div class="col-md-4">
<label class="form-label">Top K</label>
<input type="number"
min="1"
name="top_k"
value="20"
class="form-control bg-dark text-light border-secondary"
required>
</div>
<!-- Top P -->
<div class="col-md-4">
<label class="form-label">Top P</label>
<input type="number"
step="0.05"
min="0"
max="1"
name="top_p"
value="0.8"
class="form-control bg-dark text-light border-secondary"
required>
</div>
<!-- Repeat Penalty -->
<div class="col-md-6">
<label class="form-label">Repeat Penalty</label>
<input type="number"
step="0.05"
min="0"
max="5"
name="repeat_penalty"
value="1.05"
class="form-control bg-dark text-light border-secondary"
required>
</div>
<!-- Num Ctx -->
<div class="col-md-6">
<label class="form-label">Context Window (num_ctx)</label>
<input type="number"
min="512"
max="32768"
name="num_ctx"
value="4096"
class="form-control bg-dark text-light border-secondary"
required>
<div class="form-text text-secondary">
Muss zum Modell passen. Zu hohe Werte können Performance beeinflussen.
</div>
</div>
</div>
<hr class="border-secondary my-4">
<div class="d-flex justify-content-end">
<button type="submit"
class="btn btn-outline-info">
Konfiguration speichern
</button>
</div>
</form>
</div>
</div>
<div class="mt-4 small text-secondary">
Hinweis: Neue Konfigurationen werden zunächst inaktiv gespeichert und
müssen separat aktiviert werden. Pro Modell kann nur eine Version aktiv sein.
</div>
{% endblock %}

View File

@@ -0,0 +1,102 @@
{% extends 'admin/base.html.twig' %}
{% block title %}KI Modell-Generierung Config{% endblock %}
{% block body %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="h3">KI Modell-Generierung Config</h1>
{% if is_granted('ROLE_SUPER_ADMIN') %}
<a href="{{ path('admin_model_config_create') }}"
class="btn btn-sm btn-outline-info">
Neue Konfiguration
</a>
{% endif %}
</div>
<div class="card bg-black border-secondary">
<div class="card-body p-0">
<table class="table table-dark table-striped table-hover mb-0 align-middle">
<thead class="table-secondary text-dark">
<tr>
<th>Modell</th>
<th>Version</th>
<th>Stream</th>
<th>Temp</th>
<th>Top K</th>
<th>Top P</th>
<th>Repeat</th>
<th>Ctx</th>
<th>Status</th>
<th class="text-end">Aktion</th>
</tr>
</thead>
<tbody>
{% for config in configs %}
<tr>
<td>{{ config.modelName }}</td>
<td>v{{ config.version }}</td>
<td>
{% if config.stream %}
<span class="badge bg-info text-dark">Streaming</span>
{% else %}
<span class="badge bg-secondary">Blocking</span>
{% endif %}
</td>
<td>{{ config.temperature }}</td>
<td>{{ config.topK }}</td>
<td>{{ config.topP }}</td>
<td>{{ config.repeatPenalty }}</td>
<td>{{ config.numCtx }}</td>
<td>
{% if config.active %}
<span class="badge bg-success">Aktiv</span>
{% else %}
<span class="badge bg-dark border border-secondary">
Inaktiv
</span>
{% endif %}
</td>
<td class="text-end">
{% if not config.active and is_granted('ROLE_SUPER_ADMIN') %}
<a href="{{ path('admin_model_config_activate', {id: config.id}) }}"
class="btn btn-sm btn-outline-success me-2">
Aktivieren
</a>
<form method="post"
action="{{ path('admin_model_config_delete', {id: config.id}) }}"
style="display:inline-block"
onsubmit="return confirm('Wirklich löschen?');">
<input type="hidden" name="_token"
value="{{ csrf_token('delete_model_config_' ~ config.id) }}">
<button class="btn btn-sm btn-outline-danger">
Löschen
</button>
</form>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan="10" class="text-center text-secondary py-4">
Keine Konfiguration vorhanden.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="mt-4 small text-secondary">
Hinweis: Änderungen wirken sich unmittelbar auf die Generierungsparameter
des aktiven Modells aus. Nur eine Konfiguration pro Modell kann aktiv sein.
</div>
{% endblock %}