How Ghostrow understands databases.

Ghostrow reads schemas and application code with its rule-based engine, gr-schema-1, and turns what it understands into rules. Since 1.0.2, a small model trained for this step, gr-col-1, runs on your machine and proposes what each column holds; the engine checks every proposal before it is used. A deterministic generator then follows the rules, so the same seed always gives the same rows.

What runs whereeverything inside the dashed line stays on your machine
YOUR MACHINEInputsschema or DBORM modelsvalidatorsParserdeterministicGhostrow engineon your machinemeaning + rulesRule planyou can reviewGeneratorseeded, repeatable→ database, SQL,CSV or JSONghostrow.com license serverreceives: license key, hashed machine IDYour AI provider (optional)only if you turn on your own key
Local
schema, code and data
2 values
sent for license checks
Off
bring-your-own-key, by default
Repeatable
same seed, same rows

What Ghostrow works out for you

Hand-written fixtures encode this knowledge by hand. Ghostrow reads it from the places it already lives: column names, types, constraints, triggers and your validation code.

Inference types with an example of each
TypeExampleRead fromPlans
Column meaningcustomers.nic is a Sri Lankan NICname, type, CHECK constraintAll plans
Cross-column rulesorders.total = sum(order_lines.amount)triggers, views, foreign keysAll plans
Code rulesplans.ends_at is later than starts_atZod, Pydantic, Django, Laravel validatorsPro, Max
Data shapeorder sizes follow production’s distributionstatistics measured locally by TwinMax

Understanding first. Plain code for generating.

The understanding step never writes rows directly, whether it is the engine, the model or an AI provider you bring. It produces a rule plan, and a seeded generator produces the data. That keeps output repeatable for CI and makes every decision visible.

Reviewable
The rule plan is saved as ghostrow.rules.yaml. Read it, edit it and commit it with your code.
Checked proposals
The model’s meaning is used only when it is at least 50% sure and the meaning fits the column’s declared type. Foreign keys and meanings pinned in the rules file never change. --no-model turns it off for a run.
Repeatable
The same schema, rules, model and seed produce the same rows on every machine and every CI run.
Valid by construction
Foreign keys and constraints are enforced by the generator, then checked again by an independent validator.
Private by default
No telemetry on your schema or data. License checks send two values, nothing else.

Model card: gr-col-1

What the schema model is for, what it isn’t for, what it was trained on and where it falls short.

Model card for gr-col-1
StatusAvailable In Ghostrow 1.0.2 and later, on every plan. Install it once with ghostrow model pull; without it, Ghostrow uses the rule-based engine gr-schema-1 as before
TaskColumn meaning: which of 56 meanings a column holds, such as email, currency code, token, status or date of birth
Model typeA 32-million-parameter text encoder (Ettin-encoder-32m, ModernBERT architecture, MIT licence), fine-tuned by Ghostrow. Ships as a 32.5 MB int8 ONNX file
InputSchema text only: table and column names, declared type, key and null flags, and the names of nearby columns. Never values from your database
Runs onThe CPU of the machine running Ghostrow, offline after the download. Windows (x64, arm64), Linux (x64, arm64) and macOS on Apple silicon. On Intel Macs Ghostrow uses the rule-based engine. No GPU required
Intended useInferring column meaning so Ghostrow can plan synthetic test data
Out of scopeWriting content about real people, making decisions about people, or producing anything other than a rule plan
Training data81,863 columns from 6,000 synthetic tables made by our own generator, each with a known meaning, and columns from 16 open-source schemas under MIT, BSD and Apache-2.0 licences, labelled by the rule engine. Every public file is pinned to a commit and listed with its licence. No customer data, and nothing users run through Ghostrow
Training3 epochs over 90,840 examples in bf16 on one NVIDIA RTX 4070, in 298 seconds
Known limitsLess accurate than the rule engine on free text and plain numbers in our evaluation, and less accurate on column names unlike anything in its training data. It doesn’t read code or find cross-column rules; the engine still does. Every inference is shown for review
IntegrityThe download is described by a signed manifest (Ed25519), and every file is checked against its SHA-256 before it is installed

How well it reads columns

505 columns from five public schemas the model never saw in training (Chinook, Sakila, Umami, Healthchecks and Koel): every column that isn’t a declared foreign key, which the constraint decides. Each column was labelled against a written guide, and the labels are public. They were written in two passes by one labeller, an AI assistant working from the guide, and have not yet been reviewed independently. We ran the same columns through Ghostrow with and without the model.

Column meaning, share of held-out columns labelled correctly
MeasureRule engine gr-schema-1With gr-col-1
All 505 columns, as Ghostrow runs83.4% (421)89.9% (454)
151 columns with names not seen in training76.8% (116)79.5% (120), model alone

With the model, Ghostrow changed 65 of the rule engine’s meanings: 43 changes fixed a wrong meaning, 10 replaced a correct one with a wrong one, and 12 swapped one wrong meaning for another. The second labelling pass changed 6 labels after the first results were seen; with the first-pass labels the scores were 84.6% and 91.1%. The set is small, and the rule engine’s answer was visible while labelling, which favours the rule engine.

Evaluation suite, results as each one is measured
MetricWhat it measuresResult
Column meaningShare of held-out columns labelled correctly89.9%, against 83.4% for the rule engine
Run timeTime for the model step on a desktop CPU (Intel Core i7-13700K), including loading the model0.37 s for 53 columns; 20.2 s for 12,878 columns (1.57 ms per column)
Rule recallShare of known cross-column rules foundBeing measured
Constraint validityGenerated rows that pass every constraintBeing measured

The method, results by source and by meaning, every disagreement and both models we trained are published with the code.

Read the research roadmap

Try it on your own schema. Nothing leaves your machine.

npm i -g ghostrow && ghostrow model pull && ghostrow seed --schema schema.sql