Fantasma#
Anonymize your writing style. Zig WASM engine detects authorship markers, fine-tuned LLM rewrites to remove them. Runs entirely in-browser.
How it works#
- Paste text — the Zig engine extracts your stylometric fingerprint (punctuation habits, sentence length, vocabulary richness, contraction rate, function word frequencies, etc.)
- Analyze — each feature is compared against a neutral baseline; deviations >1 sigma are flagged as markers
- Neutralize — a fine-tuned Qwen3.5-0.8B rewrites your text to flatten flagged markers while preserving meaning
- Verify — the engine re-extracts features from the rewrite to confirm markers were actually removed
No server. No data leaves your machine. The WASM profiler loads instantly (~27KB); model weights download once and persist in IndexedDB.
Build#
Requires Zig 0.15.
# Native CLI
zig build
./zig-out/bin/fantasma profile "your text here"
# WASM (for browser)
zig build wasm
# Tests
zig build test
Stylometric features#
| Category | Features |
|---|---|
| Lexical | avg word length, vocabulary richness (TTR), hapax ratio, avg syllables/word |
| Syntactic | avg sentence length, sentence length variance, passive voice ratio |
| Punctuation | semicolon, comma, colon, dash, exclamation, ellipsis, parenthetical rates |
| Structural | avg paragraph length, sentence-opening distribution, contraction rate |
| Idiosyncratic | British spelling, Oxford comma, hyphenation rate |
Project structure#
src/
main.zig # WASM exports + native CLI
stylometry/
extractor.zig # Feature extraction from text
baseline.zig # Neutral baseline profiles (EN, ES)
comparator.zig # Compare profile vs baseline, flag markers
verifier.zig # Re-extract after rewrite, measure delta
neutralizer/
rewrite.zig # Extract → prompt → infer → verify pipeline
parser.zig # Parse model output
chunker.zig # Split long texts at paragraph boundaries
utils/
json.zig # JSON parser/emitter
allocator.zig # WASM-compatible allocator
unicode.zig # UTF-8 handling, language detection
web/
index.html # Catppuccin Mocha dark theme PWA
app.js # WASM integration, UI logic
style.css # Oat UI + custom styles
License#
MIT