Skip to main content

Detect AI writing patterns — scores text 0-100 for AI fingerprints

Project description

aifingerprint

Scores text 0–100 for AI writing fingerprints. Catches the stuff LLMs can't help doing — flat rhythm, hedge words, compression patterns, that weird punctuation sameness. No API keys, no model downloads, just stdlib Python.

Installation

pip install .
# or for development:
pip install -e .

Usage

# Analyze a file
aifingerprint input.txt

# Read from clipboard
aifingerprint --clipboard

# Read from stdin
echo "text to analyze" | aifingerprint

# Generate a markdown report
aifingerprint input.txt --report
aifingerprint input.txt --report output.md

Score interpretation

Score Label Meaning
0–20 CLEAN Looks human
21–40 MILD A few AI-ish traits, probably human
41–60 NOTICEABLE Smells like AI
61–80 OBVIOUS Yeah, that's AI
81–100 BLATANT Copy-pasted straight from ChatGPT

What it checks

Ten weighted checks, each scoring 0.0–1.0:

Check Weight What it measures
Compression 20% LZMA similarity to a known AI corpus
Sentence rhythm 15% Coefficient of variation in sentence lengths
Tone 15% Hedging, enthusiasm, formality, word length
Punctuation 12% Shannon entropy of punctuation distribution
Connectives 10% Density of discourse markers (however, moreover...)
Burstiness 8% Whether content words cluster or distribute evenly
Vocabulary 8% Known AI-favored words (delve, leverage, utilize...)
Structure 7% Paragraph uniformity, parallelism, five-paragraph essay
Phrases 5% Cliches, hedges, openers, closers
Formatting 0% Em dashes, bold bullets, header density (disabled)

HTML reports

Generate a markdown report, then convert to styled HTML:

aifingerprint input.txt --report
python -m aifingerprint.html report.md

How it compares

We tested against the RoBERTa OpenAI detector (openai-community/roberta-base-openai-detector via HuggingFace Transformers) — the only other pip-installable thing that runs offline on prose. 27 samples, 8 AI-generated, 19 human-written:

aifingerprint RoBERTa
AI samples (avg) 58% 97%
Human samples (avg) 18% 97%
Separation 40pp gap ~0 — labels everything as AI

RoBERTa was trained on GPT-2 output back in 2019. It thinks Paul Graham, Reddit posts, and Seth Godin are all 100% AI. Basically useless on anything written after 2022. aifingerprint uses heuristics instead of a model, so it doesn't go stale when the next GPT drops.

Other packages in this space:

Package Why it doesn't work
gptzero API wrapper — requires paid GPTZero API key
openai-detector Thin wrapper around the same broken RoBERTa model
sloppylint Detects AI patterns in code, not prose
finbert-ai-detector Fine-tuned for financial documents only
ai-slop-detector Browser-based, requires Gemma 270M model download
textstat Readability metrics (Flesch, SMOG, etc.) — doesn't attempt detection

No dependencies

Runs on Python 3.10+ using only the standard library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aifingerprint-1.0.1.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aifingerprint-1.0.1-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file aifingerprint-1.0.1.tar.gz.

File metadata

  • Download URL: aifingerprint-1.0.1.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aifingerprint-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2d80a44c0bf50c1ba69a1b8a4174394bf3b3c518e4f53e68ddfaa167caeebf63
MD5 793ffad403714de9709b2a8d4fccabab
BLAKE2b-256 758678884043e6a89c91ff17c4f204517e8d00f61bcf0c2a5896046081e2c21a

See more details on using hashes here.

File details

Details for the file aifingerprint-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: aifingerprint-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aifingerprint-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2568ebb0b30462e14079c7438cdbde1d589e51706dc602eea5200058f91afd05
MD5 8b0456bac495dabae3ccd3b39af9e29f
BLAKE2b-256 7e3d67e760d829ff8b9fc9721f17e421181b957bedeeed7268678e19ab95c904

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page