KakaruHayate/dsh-degen-heal0

@dsh-external/llm-degen-heal

检测并自愈 LLM 输出退化循环:流式碎词/熵骤降/空转仪表三信号,请求级惩罚注入(含需核心改一行项)、流中断重试、冷却幂等、dev_loop_status 诊断

AI 분석

核心用途是解决大语言模型在生成过程中陷入无限循环或退化输出的问题。适合对模型输出稳定性要求高、需要自动检测并纠正模型“复读机”或空转行为的开发者。支持丰富的参数微调。

패키지
@dsh-external/llm-degen-heal
버전
0.2.0
라이선스
BSD-3-Clause
최근 업데이트
2026. 8. 25.

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 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
fielddefaultmeaning
enabledtruemaster switch; false = pure passthrough with no logging
providers[]provider allowlist, empty = all
windowTokens256detection rolling window size
shortTokenMaxLen32short-token length cap
repeatThreshold8run length (same token, or alternating) that flags a loop
entropyRatio0.35entropy-drop threshold
detectAlternatingtruealso count consecutive A B A B… runs
leakMarkersbuilt-inphrases treated as leaked thinking/planning prose
leakThreshold2marker hits in a window before leak-out fires
idleTurns2consecutive idle turns before the meter acts
idleTurnWords60idle turn word cap
temperatureDelta0request temperature adjust per healing epoch (0 disables)
cooldownMs30000healing epoch cooldown
escalateAt2which degenerate stream triggers the interrupt
maxRetriesPerEpoch1degenerate retries granted per epoch
lockoutAt3triggers in one epoch before fail-open lockout
lockoutMs180000lockout suspension duration
healMessagebuilt-incorrective message injected to the model