If you want software to sound more like an existing author, the tempting shortcut is to paste a large collection of documents into a prompt and ask for a clone. That approach mixes topic knowledge, private text, and stylistic habits in one opaque step.
AuthorStyle takes a more inspectable route. It ingests a local corpus, separates documents before chunking, measures explicit features such as sentence rhythm and punctuation, builds an evidence-grounded Style Card, and keeps generation and evaluation behind explicit privacy modes. The project is an alpha research CLI, not a promise of perfect imitation.
This tutorial walks through the smallest useful path: install the project from its public repository, create a profile, ingest the included English fixture corpus, analyze it, and inspect the resulting profile. The same workflow can be adapted to your own Markdown, text, HTML, or Word documents.
TL;DR
git clone https://github.com/paladini/authorstyle.git
cd authorstyle
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
authorstyle init demo
authorstyle ingest demo ./fixtures/corpus/en
authorstyle analyze demo
authorstyle profile show demo
The commands create a local profile, ingest the fixture corpus, calculate a Style Profile, and print a summary with measured rhythm, lexical, punctuation, and voice information.
Prerequisites
You need Python 3.11 or newer and Git. The package metadata declares Python 3.11 or newer, uses the MIT license, and exposes the authorstyle console script. The development extra installs pytest and ruff in addition to the runtime dependencies.
The examples use a Unix-like shell. On Windows PowerShell, create and activate the environment with these commands:
git clone https://github.com/paladini/authorstyle.git
cd authorstyle
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
Build a local profile
After installation, initialize a named profile. The profile identifier becomes the directory name under the configured AuthorStyle home.
authorstyle init demo
By default, profiles live under ~/.authorstyle/profiles/<profile_id>/. You can direct that home elsewhere with the AUTHORSTYLE_HOME environment variable. This is useful for a disposable experiment or a project-specific data directory.
Now ingest the repository fixture corpus:
authorstyle ingest demo ./fixtures/corpus/en
authorstyle corpus stats demo
The loader accepts .md, .txt, .html, and .docx files. Markdown can contain optional YAML front matter, including a mode such as technical, essay, or humor. Use .authorstyleignore when a corpus directory contains files that should be skipped.
At this point, you have stored source documents and chunks, but you do not yet have an analyzed style profile. Run the analysis step:
authorstyle analyze demo
authorstyle profile show demo
The profile summary reports measured properties instead of presenting one mysterious similarity number. The Style Card links statements to metrics and exemplars. You can inspect representative chunks with:
authorstyle exemplars demo
What the pipeline is measuring
The repository documents a deliberate sequence. AuthorStyle first canonicalizes and deduplicates documents, then assigns complete document families to train, validation, or test splits before structural chunking. That order matters: chunks from the same document should not leak into multiple evaluation splits.
It then extracts explicit stylometric features, such as sentence and paragraph rhythms, punctuation rates, lexical diversity, Markdown structure, and technical prose or code ratios. Numeric features are summarized with robust statistics such as medians, median absolute deviation, and quantiles.
The project also defines separate style and semantic embeddings. The style representation is intended to describe how text is written, while the semantic representation describes what it is about. Separating those concepts does not eliminate topic leakage, so the methodology warns that recurring subject vocabulary can still look like style.
Global profiles aggregate all training documents. Mode profiles aggregate documents carrying the same front-matter mode. If there is not enough evidence for a mode, the documented behavior falls back toward the global profile and emits warnings.
Generate text without sending the corpus remotely
Once a profile has been analyzed, the CLI can generate text with a local-only default:
authorstyle write demo --prompt "Explain why document-level evaluation splits matter"
The command uses the LOCAL_ONLY privacy mode by default. The repository describes that mode as permitting only local or mock providers, so profiling and analysis do not require a remote language model. A run records candidates, component scores, retrieved exemplars, and provider metadata for reproducibility.
If you choose another privacy mode, make that choice explicit and understand what leaves the machine. REMOTE_PROFILE_ONLY sends the task and Style Card. REMOTE_EXEMPLARS also sends selected exemplar passages. Raw corpus text should not be sent remotely unless the configured mode explicitly permits it.
Evaluate the result honestly
Run the held-out evaluation command after analysis:
authorstyle evaluate demo
The project compares several baselines, including generic, card, examples, hybrid, and full. Reports include style embedding distance, explicit stylometric fit, content adherence, naturalness heuristics, originality checks, and calibration percentiles against genuine held-out author writing.
Those metrics are useful for comparing configurations, not for proving that a generated paragraph is authentic. AuthorStyle explicitly does not claim to perfectly clone an author, guarantee topic-independent style transfer, or infer personality and beliefs automatically. Treat the output as a measured experiment that still needs human review.
Failure modes and security boundaries
An ingest command fails when the supplied corpus path does not exist. An uninitialized profile causes commands such as profile show or exemplars to report that the profile is missing. A mode-specific profile may be unavailable when the corpus has insufficient documents for that mode.
The most important operational boundary is privacy. Your corpus may contain unpublished writing, personal information, or details that should never reach a provider. Keep LOCAL_ONLY for sensitive experiments, inspect configuration before enabling remote generation, and avoid committing .env files or private corpora. The project security policy also calls out unsafe file handling, prompt injection through Style Cards or generation prompts, unexpected network access, and dependency vulnerabilities as issues to report privately.
AuthorStyle is marked alpha in its package metadata. The current repository has an initial 0.1.0 changelog entry and no published GitHub release, so this tutorial targets the documented main branch rather than claiming a stable release artifact. Pin a commit in your own reproducible workflow when branch drift matters.
FAQ
Does AuthorStyle fine-tune a model?
No. The README describes a profiling and generation pipeline with pluggable encoders. Fine-tuning is listed as an extension point, not an MVP feature.
What files can I ingest?
The documented loaders support Markdown, plain text, HTML, and DOCX. Markdown front matter can label language, source, publication state, tags, and mode.
Is the corpus uploaded by default?
No. The default generation privacy mode is LOCAL_ONLY, and the project states that raw corpus text stays local during profiling. Remote modes are explicit and have different payload boundaries.
Can it reproduce my beliefs or biography?
No. Persona extraction is deferred in the MVP. The tool models recurring stylistic patterns observed in the supplied corpus.
Takeaway
The useful idea in AuthorStyle is not a stronger imitation claim. It is the separation of corpus handling, measurable style evidence, privacy policy, generation, and held-out evaluation. That gives you a workflow you can inspect and challenge before using generated text.
If you try the tutorial, which boundary matters most for your use case: local-only generation, document-level holdouts, or separate style and semantic signals?
Disclosure: AI assistance was used to organize and edit this tutorial. The repository documentation, package metadata, security policy, and command path were checked against the public project before publication.
Top comments (0)