How neferax07/unloop works
unloop is a small, dependency-free repetition-loop governor for greedy LLM decoding. Its main workflow profiles a prompt, initializes a preset governor, then reviews each token step using history and logits; it passes, minimally demotes the continuation logit, escalates with a deterministic phase schedule, or stops. The same core is available through a C ABI, while the CLI replays fixture files and prints a trace. The source excerpts show the core review path and adapters; other documented behavior is represented only where the README supports it.
Main entry points: lib.rs Governor Review · main.rs CLI Replay · ffi.rs C ABI
Components 13
Governor Core
- Preset Policy
src/lib.rs - Governor Review
src/lib.rs - Top-Two Scan
src/lib.rs - Step Verdict
src/lib.rs
Prompt And Detection
- Prompt Profile
src/lib.rs - Period Detector
src/lib.rs - Echo Detector
src/lib.rs
Runtime Interfaces
- CLI Replay
src/main.rs - C ABI
src/ffi.rs
Intervention
- Phase Schedule
src/lib.rs - Logit Demotion
src/lib.rs
Other components
- CLI User
- Decoder Host
Connections 15
- CLI User → CLI Replay: runs replay
README.md - CLI Replay → Prompt Profile: profiles prompt
src/main.rs - CLI Replay → Governor Review: reviews steps
src/main.rs - CLI Replay → Step Verdict: prints trace
src/main.rs - Decoder Host → C ABI: calls ABI
src/ffi.rs - C ABI → Governor Review: delegates review
src/ffi.rs - Prompt Profile → Governor Review: seeds state
README.md - Governor Review → Period Detector: checks period
src/lib.rs - Governor Review → Echo Detector: checks echo
src/lib.rs - Governor Review → Top-Two Scan: scans logits
src/lib.rs - Preset Policy → Governor Review: configures policy
README.md - Governor Review → Phase Schedule: advances phase
README.md - Governor Review → Logit Demotion: demotes continuation
README.md - Governor Review → Step Verdict: returns verdict
src/lib.rs - Step Verdict → Decoder Host: guides sampling
README.md