Files
team 1 0d55c0a439 p100
2026-05-12 08:57:57 +02:00

221 lines
9.1 KiB
Twig

{% extends 'admin/base.html.twig' %}
{% block title %}KI Modell-Generierung{% endblock %}
{% block body %}
<div class="d-flex justify-content-between align-items-center mb-4 flex-wrap gap-2">
<h1 class="h3 mb-0"><i class="bi bi-rocket-takeoff-fill"></i> KI Modell-Generierung</h1>
<div class="d-flex flex-wrap gap-2">
{% if is_granted('ROLE_KNOWLEDGE_ADMIN') %}
<a href="{{ path('admin_evals_index') }}"
class="btn btn-sm btn-outline-warning">
Eval Suite
</a>
{% endif %}
{% 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>
{# ========================================================= #}
{# MODEL CONFIG DESCRIPTION #}
{# ========================================================= #}
<div class="card bg-dark border-secondary text-light mb-4 shadow-sm">
<div class="card-body row">
<div class="col-lg-6">
<h5 class="text-info mb-3">Was steuert die Modell-Konfiguration?</h5>
<p class="small text-light mb-3">
Die Modell-Konfiguration definiert die vollständige
Generierungsumgebung des Agents. Sie trennt strikt zwischen:
</p>
<ul class="small text-light mb-3">
<li>KI/LLM Verhalten (Sampling & Kontext der KI)</li>
<li>Retrieval-Parameter (Vektor-Wissen)</li>
<li>Streaming-Modus</li>
</ul>
<h6 class="text-info mt-3">KI-/LLM-Sampling</h6>
<p class="small text-light mb-3">
Parameter wie <code>Temperature</code>, <code>TopK</code> und <code>TopP</code> beeinflussen die
kreative Varianz der Antwort. <code>Repeat Penalty</code> steuert Wiederholungen,
während <code>numCtx</code> die maximale Kontextgröße des Modells festlegt.
</p>
</div>
<div class="col-lg-6">
<h6 class="text-info mt-3">Retrieval Vector Wissen</h6>
<p class="small text-light mb-3">
Retrieval-Parameter bestimmen, wie viele Chunks aus dem
NDJSON-Vektorindex geladen werden und wie viele
Top-K Kandidaten aus der FAISS-Suche berücksichtigt werden.
Diese Werte beeinflussen die Wissensbreite der Antwort,
nicht deren Kreativität.
</p>
<h6 class="text-info mt-3">Architektur-Prinzip</h6>
<p class="small text-light mb-0">
Das Retrieval ist deterministisch und vom LLM getrennt.
Das Modell erhält ausschließlich die vorselektierten
Chunks als Kontext. Änderungen hier verändern die
Wissensbasis der Antwort — nicht den gespeicherten Index.
Pro Modell kann genau eine Konfiguration aktiv sein.
</p>
</div>
</div>
</div>
<h2 class="text-light mb-3">KI-/LLM Setup-Profile</h2>
<div class="card bg-black border-secondary">
<div class="card-body p-0">
<table class="table table-dark table-striped table-hover align-middle mb-0">
<thead class="table-secondary text-dark">
<tr>
<th>LLM Modell</th>
<th>Profil-Version</th>
<th>Streaming</th>
<th>LLM Sampling</th>
<th class="">Retrieval Vector Wissen</th>
<th>Status</th>
<th class="text-end">Aktionen</th>
</tr>
</thead>
<tbody>
{% for config in configs %}
<tr>
<td>
<span class="text-info">{{ config.modelName }}</span>
</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>
<div class="small">
<div><strong>Temperature:</strong> {{ config.temperature }}</div>
<div><strong>TopK:</strong> {{ config.topK }}</div>
<div><strong>TopP:</strong> {{ config.topP }}</div>
<div><strong>Repeat Penalty:</strong> {{ config.repeatPenalty }}</div>
<div><strong>NumCtx:</strong> {{ config.numCtx }}</div>
</div>
</td>
<td class="text-warning">
<div class="small">
<div><strong>Chunks:</strong> {{ config.retrievalMaxChunks }}</div>
<div><strong>VectorK:</strong> {{ config.retrievalVectorTopK }}</div>
</div>
</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">
<a href="{{ path('admin_model_config_test_retrieval', {id: config.id}) }}"
class="btn btn-sm btn-outline-warning me-1">
Test Retrieval
</a>
{% if not config.active and is_granted('ROLE_SUPER_ADMIN') %}
<form method="post"
action="{{ path('admin_model_config_activate', {id: config.id}) }}"
class="d-inline"
onsubmit="return confirm('Diese Konfiguration aktivieren?');">
<input type="hidden"
name="_token"
value="{{ csrf_token('activate_model_config_' ~ config.id) }}">
<button class="btn btn-sm btn-outline-success me-1">
Aktivieren
</button>
</form>
<form method="post"
action="{{ path('admin_model_config_delete', {id: config.id}) }}"
class="d-inline"
onsubmit="return confirm('Konfiguration 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>
{% else %}
<span class="text-light small">—</span>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan="7" class="text-center py-4">
Keine Konfiguration vorhanden.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="mt-4 mb-4 small text-light">
Hinweis: Änderungen wirken sich unmittelbar auf Sampling- und Retrieval-Parameter
des aktiven Modells aus. Pro Modell kann nur eine Version aktiv sein.
</div>
<hr>
<h3 class="h3 mb-4" id="agentLiveTest">KI-Live-Test</h3>
<div class="card bg-black border-secondary">
<div class="card-body p-0">
<iframe
src="/?admin_test=1"
class="w-100 border-0"
style="height:75vh;"
></iframe>
</div>
</div>
<div class="mt-3 small text-light">
Der Agent läuft im isolierten Admin-Test-Modus.
Keine Persistenz. Keine produktive Session.
</div>
{% endblock %}