161 lines
7.2 KiB
Twig
161 lines
7.2 KiB
Twig
{% 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 KI-Endpunkt konfiguriert (z. B. Ollama oder API).
|
||
</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" checked>
|
||
<label class="form-check-label" for="streamSwitch">
|
||
Streaming aktivieren
|
||
</label>
|
||
</div>
|
||
<div class="form-text text-secondary ms-3">
|
||
Aktiviert Token-Streaming im Chat (empfohlen für bessere UX).
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Temperature -->
|
||
<div class="col-md-4">
|
||
<label class="form-label">Temperature</label>
|
||
<input type="number"
|
||
step="0.05"
|
||
min="0"
|
||
max="2"
|
||
name="temperature"
|
||
value="0.35"
|
||
class="form-control bg-dark text-light border-secondary"
|
||
required>
|
||
<div class="form-text text-secondary">
|
||
Steuert die Kreativität der Antworten.
|
||
Niedrige Werte (0.2–0.4) erzeugen stabile, sachliche Ergebnisse – empfohlen für RAG-Systeme.
|
||
Höhere Werte führen zu freieren, weniger deterministischen Antworten.
|
||
</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="40"
|
||
class="form-control bg-dark text-light border-secondary"
|
||
required>
|
||
<div class="form-text text-secondary">
|
||
Begrenzt die Anzahl der wahrscheinlichsten Token, aus denen das Modell auswählt.
|
||
Niedrigere Werte = konservativer, höhere Werte = flexibler.
|
||
20–50 ist für Wissenssysteme üblich.
|
||
</div>
|
||
</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.9"
|
||
class="form-control bg-dark text-light border-secondary"
|
||
required>
|
||
<div class="form-text text-secondary">
|
||
Nucleus Sampling: Das Modell berücksichtigt nur Token,
|
||
deren kumulative Wahrscheinlichkeit innerhalb dieses Werts liegt.
|
||
0.8–0.95 bietet eine gute Balance zwischen Stabilität und Natürlichkeit.
|
||
</div>
|
||
</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.1"
|
||
class="form-control bg-dark text-light border-secondary"
|
||
required>
|
||
<div class="form-text text-secondary">
|
||
Bestraft Wortwiederholungen. Werte leicht über 1.0 (z. B. 1.1–1.15)
|
||
verhindern Schleifen und redundante Antworten.
|
||
</div>
|
||
</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="8192"
|
||
class="form-control bg-dark text-light border-secondary"
|
||
required>
|
||
<div class="form-text text-secondary">
|
||
Maximale Kontextlänge in Tokens (Systemprompt + Benutzerfrage + Retrieval-Chunks).
|
||
Muss vom Modell unterstützt werden.
|
||
Höhere Werte ermöglichen größere Wissenskontexte, erhöhen jedoch Speicher- und Rechenbedarf.
|
||
</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 %}
|