Catalog/llm-repetition-detector

LLM

Repetition / loop detector API

Detects degenerate repetition or looping in model output: the longest consecutive repeated line, the most-repeated word n-gram, and the distinct-token ratio — the classic 'model got stuck' signal — with a verdict and mitigation hint. Answers 'is my model output stuck in a loop?', 'is this response degenerate/repetitive?'.

Price$0.02per request
MethodPOST
Route/v1/llm/repetition-detector
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
llmrepetitionloopdegenerationqualitydetectorngramagent
API URLhttps://x402.hexl.dev/v1/llm/repetition-detector
Integration docs
Example request
{
  "text": "go go go go go go go go"
}
Example response
{
  "hasLoop": true,
  "maxLineRepeat": 1,
  "repeatedLine": null,
  "maxNgramRepeat": 6,
  "repeatedNgram": "go go go",
  "distinctRatio": 0.125,
  "verdict": "looping: output shows degenerate repetition — lower temperature / add repetition penalty / truncate"
}
Input schema
{
  "type": "object",
  "required": [
    "text"
  ],
  "properties": {
    "text": {
      "type": "string",
      "examples": [
        "go go go go go go go go"
      ]
    },
    "ngram": {
      "type": "number",
      "default": 3
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}