feat(llm): Live-Parameter top_p + Live/Restart-Kennzeichnung — Plan-Schritt 4
- local_llm_top_p (Default 0.9) durch Config -> runtime_config (RUNTIME_SETTABLE, live ohne Neustart) -> local-openai-compatible Payload (top_p). - Admin-Einstellungen: top_p als Slider (0–1); Hints "wirkt sofort (kein Neustart)" für temperature/top_p. - Doku: top_p + Klarstellung Live-Parameter (temp/top_p/max_tokens) vs. Startup-Wert Kontextfenster (OLLAMA_CONTEXT_LENGTH / llama.cpp -c). Verifiziert: top_p im Payload, Live-Config-Round-Trip (PUT/DELETE). 165 grün. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
5b6f0f8ef2
commit
b2576fd465
7 changed files with 16 additions and 3 deletions
|
|
@ -1027,6 +1027,12 @@ Diese Settings gelten nur für den Provider `local-openai-compatible`.
|
|||
| `LOCAL_LLM_SYSTEM_PROMPT` | Sprach-Prompt | Kurze, vorlesbare Antworten |
|
||||
| `LOCAL_LLM_MAX_TOKENS` | `0` (Server-Limit) | Optionaler Deckel, z. B. `256` |
|
||||
| `LOCAL_LLM_TEMPERATURE` | `0.3` | Sampling-Temperatur |
|
||||
| `LOCAL_LLM_TOP_P` | `0.9` | Nucleus-Sampling (0.0–1.0) |
|
||||
|
||||
> Temperatur, Top-p und Max-Tokens sind **Live-Parameter**: im Admin-Panel →
|
||||
> Einstellungen änderbar und **ohne Neustart** sofort wirksam (pro Anfrage gesendet).
|
||||
> Das **Kontextfenster** ist dagegen ein Startup-Wert (Ollama: `OLLAMA_CONTEXT_LENGTH`,
|
||||
> llama.cpp: `-c`) und erfordert einen Backend-Neustart.
|
||||
|
||||
Messung (Qwen3-35B, `va_llm`): Reasoning an → **5,5 s / 1433 Zeichen**;
|
||||
Reasoning aus + Sprach-Prompt → **0,7 s / ~190 Zeichen**.
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ class Settings(BaseSettings):
|
|||
local_llm_disable_reasoning: bool = True # Qwen3 /no_think: spart die Denkphase
|
||||
local_llm_max_tokens: int = 0 # 0 = serverseitiges Limit (-n)
|
||||
local_llm_temperature: float = 0.3
|
||||
local_llm_top_p: float = 0.9 # Nucleus-Sampling (0.0–1.0)
|
||||
faster_whisper_model: str = "base" # tiny|base|small|medium|large-v3
|
||||
faster_whisper_device: str = "auto" # auto|cpu|cuda
|
||||
faster_whisper_compute_type: str = "default" # default|int8|float16|int8_float16
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ LLM_REGISTRY = {
|
|||
disable_reasoning=s.local_llm_disable_reasoning,
|
||||
max_tokens=s.local_llm_max_tokens,
|
||||
temperature=s.local_llm_temperature,
|
||||
top_p=s.local_llm_top_p,
|
||||
),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ class LocalOpenAICompatibleLLM(LLMProvider):
|
|||
disable_reasoning: bool = True,
|
||||
max_tokens: int = 0,
|
||||
temperature: float = 0.3,
|
||||
top_p: float = 0.9,
|
||||
):
|
||||
self.base_url = base_url.rstrip("/")
|
||||
self.api_key = api_key
|
||||
|
|
@ -28,6 +29,7 @@ class LocalOpenAICompatibleLLM(LLMProvider):
|
|||
self.disable_reasoning = disable_reasoning
|
||||
self.max_tokens = max_tokens
|
||||
self.temperature = temperature
|
||||
self.top_p = top_p
|
||||
|
||||
def _build_messages(
|
||||
self, text: str, history: list[dict] | None, language: str | None = None
|
||||
|
|
@ -66,6 +68,7 @@ class LocalOpenAICompatibleLLM(LLMProvider):
|
|||
"model": self.model,
|
||||
"messages": self._build_messages(text, history, language=language),
|
||||
"temperature": self.temperature,
|
||||
"top_p": self.top_p,
|
||||
}
|
||||
if stream:
|
||||
payload["stream"] = True
|
||||
|
|
|
|||
|
|
@ -26,7 +26,8 @@ RUNTIME_SETTABLE: dict[str, tuple[str, str, str]] = {
|
|||
"openrouter_tts_voice": ("TTS-Stimme (OpenRouter)", "str", "z.B. Zephyr, Puck, Kore"),
|
||||
"piper_voice": ("TTS-Stimme (piper)", "str", "z.B. de_DE-thorsten-high"),
|
||||
"local_llm_system_prompt": ("Systemprompt (lokal)", "str", "Freier Text"),
|
||||
"local_llm_temperature": ("Temperatur (lokal)", "float", "0.0–2.0"),
|
||||
"local_llm_temperature": ("Temperatur (lokal)", "float", "0.0–2.0 — wirkt sofort (kein Neustart)"),
|
||||
"local_llm_top_p": ("Top-p (lokal)", "float", "0.0–1.0 — wirkt sofort (kein Neustart)"),
|
||||
"local_llm_max_tokens": ("Max. Tokens (lokal)", "int", "0 = kein Limit"),
|
||||
"tts_normalize_level": ("TTS-Normalisierung", "str", "auto | full | light | off"),
|
||||
"audio_stream_default": ("Audio-Streaming Standard", "bool", "true | false"),
|
||||
|
|
|
|||
|
|
@ -1384,6 +1384,7 @@ const FIELD_META = {
|
|||
piper_voice: { ui: "combo", opts: ["de_DE-thorsten-high","en_US-ryan-high","en_US-lessac-high","en_GB-cori-high","es_ES-sharvard-medium","fr_FR-siwis-medium","it_IT-paola-medium","nl_NL-mls-medium","ru_RU-irina-medium","zh_CN-huayan-medium"], test: "tts", testProvider: "piper" },
|
||||
local_llm_system_prompt: { ui: "textarea", test: "llm" },
|
||||
local_llm_temperature: { ui: "range", min: 0, max: 2, step: 0.1, test: "llm" },
|
||||
local_llm_top_p: { ui: "range", min: 0, max: 1, step: 0.05, test: "llm" },
|
||||
local_llm_max_tokens: { ui: "number", min: 0, test: "llm" },
|
||||
tts_normalize_level: { ui: "select", opts: ["auto","full","light","off"], test: "tts" },
|
||||
audio_stream_default: { ui: "select", opts: ["true","false"],
|
||||
|
|
@ -1398,7 +1399,7 @@ const FIELD_GROUPS = [
|
|||
{ label: "Provider & Sprache", keys: ["default_stt_provider","default_llm_provider","default_tts_provider","default_language"] },
|
||||
{ label: "OpenRouter-Modelle & Stimmen", keys: ["openrouter_llm_model","openrouter_tts_model","openrouter_tts_voice"] },
|
||||
{ label: "Piper TTS", keys: ["piper_voice"] },
|
||||
{ label: "Lokales LLM", keys: ["local_llm_system_prompt","local_llm_temperature","local_llm_max_tokens"] },
|
||||
{ label: "Lokales LLM", keys: ["local_llm_system_prompt","local_llm_temperature","local_llm_top_p","local_llm_max_tokens"] },
|
||||
{ label: "TTS-Verarbeitung", keys: ["tts_normalize_level","audio_stream_default"] },
|
||||
{ label: "Gedächtnis", keys: ["memory_extraction_enabled","memory_extraction_every_n_turns"] },
|
||||
{ label: "Limits", keys: ["daily_request_limit"] },
|
||||
|
|
|
|||
|
|
@ -250,6 +250,6 @@
|
|||
<div id="status" class="w-full max-w-3xl mx-auto mt-1 min-h-[1rem] text-xs text-slate-500 dark:text-slate-400"></div>
|
||||
</footer>
|
||||
|
||||
<script src="/app.js?v=30"></script>
|
||||
<script src="/app.js?v=31"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue