Repository navigation
Add the detector as a local web app and MCP server - #7
Merged
Merged
Conversation
A small Starlette service scores text with the trained classifier, and Binoculars on request, in a worker process that starts on demand and stops when idle. Results give bands and the reference rates behind them, never a verdict. The MCP endpoint exposes detect_ai_text on loopback. Includes the launcher manifest used for this project's own deployment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The detectors only ran as batch scripts over the evaluation sets. There was no way to score a new text.
What this adds
detecteval.serve: a web page, a JSON API (POST /api/detect) and an MCP endpoint (/mcp, tooldetect_ai_text) in one small process.detecteval.worker: the model process. It starts on the first request and is stopped after five idle minutes, so the service costs about 50 MB while idle.detecteval.detectoranddetecteval.calibration: passages of up to 500 words, and bands derived from how often human reference texts score as high. A result never states a verdict.results/calibration.json: reference scores built from the committed long-set scores. A private human reference is read from outside the repository when present.launcher.json: the manifest for this project's own deployment.The classifier is the main signal and Binoculars an optional second opinion. Clef is left out because it flagged 42% of real pre-ChatGPT student writing.
Validation
bash ci/run.sh: ruff clean, 38 tests pass (10 new).tools/call./mcpwith a foreign Host header is refused (421).Risks