KakaruHayate/dsh-degen-heal ↗★ 0
@dsh-external/llm-degen-heal
LLM 输出退化循环检测与自愈插件。通过流式碎词、熵骤降、空转仪表三信号检测退化,提供请求级惩罚注入、流中断重试、冷却幂等及诊断功能。
AI 分析
核心用途是解决大语言模型在生成过程中陷入无限循环或退化输出的问题。适合对模型输出稳定性要求高、需要自动检测并纠正模型“复读机”或空转行为的开发者。支持丰富的参数微调。
安裝
此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗
說明文件
閱讀完整 README ↗Configuration 配置
Every tunable is a validated config field (fail-loud on bad values). Override in your cordis.yml / profile patch / inject config:
plugins:
'@dsh-external/llm-degen-heal':
enabled: true
# windowTokens: 256 # detection rolling window
# repeatThreshold: 8 # run length that flags a token-loop
# entropyRatio: 0.35 # unique/total below this (unstructured) => entropy-drop
# detectAlternating: true # detect consecutive A,B,A,B,… runs
# idleTurns: 2 # no-tool short degenerate turns before meter steer
# idleTurnWords: 60
# temperatureDelta: 0 # request temp adjust per healing epoch (0 disables)
# cooldownMs: 30000 # healing epoch cooldown
# escalateAt: 2 # which degenerate stream causes the interrupt
# maxRetriesPerEpoch: 1 # bounded retries per epoch
# lockoutAt: 3 # triggers in one epoch before fail-open lockout
# lockoutMs: 180000 # lockout suspension duration
# healMessage: "..." # corrective prompt injected to the model
| field | default | meaning |
|---|---|---|
enabled | true | master switch; false = pure passthrough with no logging |
providers | [] | provider allowlist, empty = all |
windowTokens | 256 | detection rolling window size |
shortTokenMaxLen | 32 | short-token length cap |
repeatThreshold | 8 | run length (same token, or alternating) that flags a loop |
entropyRatio | 0.35 | entropy-drop threshold |
detectAlternating | true | also count consecutive A B A B… runs |
leakMarkers | built-in | phrases treated as leaked thinking/planning prose |
leakThreshold | 2 | marker hits in a window before leak-out fires |
idleTurns | 2 | consecutive idle turns before the meter acts |
idleTurnWords | 60 | idle turn word cap |
temperatureDelta | 0 | request temperature adjust per healing epoch (0 disables) |
cooldownMs | 30000 | healing epoch cooldown |
escalateAt | 2 | which degenerate stream triggers the interrupt |
maxRetriesPerEpoch | 1 | degenerate retries granted per epoch |
lockoutAt | 3 | triggers in one epoch before fail-open lockout |
lockoutMs | 180000 | lockout suspension duration |
healMessage | built-in | corrective message injected to the model |