Colloquial
Rewrite machine text into colloquial, native-sounding language, in any tongue.
Colloquial takes text written by an LLM and produces text that reads like a
person wrote it. It works in the same language (--same-lang) or translates and
humanizes in one pass (--to <lang>). A deterministic detection core (no
network, no LLM) scores how machine a text sounds, a report ranks the worst
sections first, and an optional self-check loop re-evaluates the output.
The name says it. Colloquial. How people actually talk and write.
Why this exists
Machine-written prose has a signature, and it is not just word choice. Research on 61,608 stories (StoryScope, COLM 2026) shows that narrative features alone separate human from machine text at 93.2% macro-F1, and that these structural patterns survive paraphrasing. Surface detectors break when the wording changes. The structure does not.
Colloquial is built on that finding. It reads how a text is built and rewrites it the way a person would have built it. The result is not text with words swapped. It is text with a different skeleton.
What it does
| Command | What you get |
|---|---|
colloquial detect FILE |
A machine-likeness score from 0 to 100, ranked findings, and the worst sections first |
colloquial humanize FILE |
A rewrite that reads human, in the same language, offline and deterministic |
colloquial humanize FILE --mode llm |
The same rewrite driven by your own model, with a style profile built from the research |
colloquial humanize FILE --to ar |
Translate and humanize in one pass, without translationese |
colloquial humanize FILE --self-check |
Re-detect the output and iterate when it still reads machine-made |
colloquial mcp |
The engine as an MCP server, for Claude Code, Codex, Cursor and Hermes |
How it works
Five layers, cheapest first. Each one feeds the next, and every layer is grounded in published measurements.
- Surface rules. Filler transitions, inflated significance, machine punctuation, AI self-reference. Hundreds of rules across eight languages. This layer is deliberately the weakest, because wordlists alone produce false positives on legitimate human text.
- Rhythm. Burstiness (the coefficient of variation of sentence length), type-token ratio, trigram repetition. Machine text keeps an even tempo. People do not.
- Lexical diversity. Six dimensions from arXiv 2508.00086, including dispersion (how close repeated words sit) and evenness (how uniformly vocabulary spreads). The counter-intuitive finding of that paper is that machine text is more lexically varied than human text and repeats words at longer distances. Dispersion alone carries a SHAP weight of 0.279, the strongest single discriminator measured.
- Discourse. A ten-dimension narrative profile ported from StoryScope (revelation, events, perspective, plot, setting, style, situatedness, temporal structure, agents, social networks). It measures how the text is constructed, not what words it uses, and it produces a soft per-model fingerprint (Claude-like flat escalation, GPT-like gossip as plot mechanism, Gemini-like external description) on texts above 300 words.
- Persona. AI-assisted writing makes the writer seem more confident, more positive and more privileged than they are (arXiv 2604.22503). This layer strips the tells and keeps the writer's actual voice.
The mechanical rewriter reverses what the detector finds, offline. The LLM rewriter sends the text with a style profile built from the same research, so either way the rules behind the rewrite are the same rules behind the score.
The science behind it
Colloquial is not a prompt pack with a CLI glued on. Every layer cites its source, and the sources are peer-reviewed.
| Source | What it contributed |
|---|---|
| StoryScope (arXiv 2604.03136, COLM 2026) | The ten discourse dimensions, the per-model fingerprints, and the finding that structural features survive paraphrasing (93.2% macro-F1 on 61,608 stories) |
| Lexical diversity (arXiv 2508.00086) | The six diversity dimensions and their AI/human directions; dispersion as the strongest discriminator |
| AI Argues Differently (arXiv 2604.22503, EMNLP 2025) | The persona-distortion catalog: over-confidence, forced positivity, compressed emotional range |
| The Arabic AI Fingerprint (arXiv 2505.23276, KFUPM) | Arabic stylometric tells: overused high-frequency words, lower vocabulary spread, domain-specific signatures |
| Falsely Accused (arXiv 2511.16690) | The calibration lesson: detectors misjudge slightly-polished Arabic (92% to 12% accuracy on polished text), so the Arabic profile fails open instead of accusing |
| "Signs of AI writing" (Wikipedia, WikiProject AI Cleanup) | The shared heritage behind the surface rule sets |
Two design commitments follow from the research. First, detection is deterministic and offline, so a score is reproducible and a rewrite never depends on a network call. Second, the tool fails open. It prefers a missed detection to a false accusation, because the real cost of an AI detector is sending a human's honest text back to them marked as machine-made.
What makes it different
An honest comparison with the tools that came before.
- Eight languages with real machinery. English, Portuguese (Brazil), Arabic (neutral MSA), Chinese, Japanese, Korean, Hindi and Ukrainian. Each language ships its own surface rules, discourse lexicons, style profile and rewrite transforms. The Arabic profile includes a dialect-consistency lock. Egyptian, Levantine, Gulf, Maghrebi and Iraqi markers are rewritten to neutral MSA, so a text never comes back as a dialectal mix. The Ukrainian profile does the same for Russian calques, known as surzhyk.
- Discourse, not just vocabulary. Most humanizers work at the word level. Colloquial reads event escalation, dialogue balance, theme explicitness and temporal texture, because that is where the research says the signal lives.
- Per-model fingerprints. The report says which family the text resembles. This is a soft signal, never a verdict.
- Two rewrite paths from one rulebook. The offline path needs no key, no account and no network. The LLM path uses whatever provider the user configures, and both are judged by the same detector.
- Zero runtime dependencies. Standard library only, by design. The quality wall (ruff, mypy strict, bandit, pytest at 80% coverage minimum) runs on every push in CI.
Install
pip install colloquial
Or run it without installing anything:
uvx colloquial detect README.md
Quick start
colloquial detect README.md
colloquial detect docs/ --report --format json
colloquial humanize draft.md --lang pt-br --report
colloquial humanize draft.md --mode llm --self-check
colloquial humanize draft.md --to ar
colloquial langs
Using it from coding agents (MCP)
Colloquial runs as an MCP server, so any MCP-capable agent (Claude Code, Codex, Cursor, Cline, Hermes) can call it as native tools.
colloquial mcp
Tools: detect_text, humanize_text, translate_humanize, list_languages,
get_report. See docs/plugins.md for per-agent setup, and
skills/ for ready-made skill files.
Choosing a provider (llm mode)
The mechanical rewriter is offline and needs nothing. The --mode llm
rewriter runs against any OpenAI-compatible API, and the provider is always
your choice. Your key, your model, your machine.
colloquial providers # see the catalog
colloquial setup # interactive: pick provider, key, model
colloquial models # live model list from your provider
colloquial config # show the resolved configuration
colloquial setup writes ~/.config/colloquial/config.toml (mode 0600).
It queries the provider's live /models endpoint with your key, so the
model list is always current. Local providers (Ollama, vLLM, llama.cpp,
LM Studio) need no key at all.
The catalog covers OpenAI, Anthropic (Claude), Google Gemini, xAI (Grok),
Mistral, DeepSeek, Groq, Cerebras, MiniMax, Moonshot (Kimi), Z.ai (GLM),
Alibaba Qwen, Nous Research, OpenRouter, Together AI, Fireworks AI, and
the local servers above, plus a custom entry for any other
OpenAI-compatible endpoint.
Environment variables still work and take precedence over the config file:
COLLOQUIAL_PROVIDER, COLLOQUIAL_API_KEY (or OPENAI_API_KEY),
COLLOQUIAL_BASE_URL, COLLOQUIAL_MODEL.
Supported languages
English (en) · Arabic (ar, neutral MSA) · Chinese (zh) · Japanese (ja) · Korean (ko) · Hindi (hi) · Ukrainian (uk) · Portuguese (pt-BR)
The Arabic, Chinese, Japanese, Korean, Hindi and Ukrainian profiles ship as community-validated beta. Their rule sets were researched against public sources but deserve review from native speakers. Pull requests that sharpen a lexicon, add a tell, or fix a false positive are the most valuable contribution this project can receive.
Contributing
See CONTRIBUTING.md. The short version is that every change runs through the quality wall, and language profiles need a minimum test corpus.
License
MIT
Metadata
Release files for colloquial 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| colloquial-0.1.1.tar.gz | 128.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| colloquial-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 234.5 kB
Release files / colloquial-0.1.1.tar.gz
| Download URL | colloquial-0.1.1.tar.gz |
|---|---|
| Size | 128.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1aed8a5d348345b1bc3adda30ecfa4c141c2bb6e2587f7eb7abce11a0b8b18c9
|
|
BLAKE2b-256 checksum How to use checksums |
8b6a5b5d2fbc1e03a92d9078510ff262546666323d5ac7692926329b9845cd9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / colloquial-0.1.1-py3-none-any.whl
| Download URL | colloquial-0.1.1-py3-none-any.whl |
|---|---|
| Size | 105.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24ff1d87b9380458aaed5af299a40e8d59b188f5b246d63287151de180210642
|
|
BLAKE2b-256 checksum How to use checksums |
b9447e4eceea896bf8ba6f3a78a609b134ebbd2b9745e5055863e27e702f0ad5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency log