Plato includes a Nanochat integration for federated training plus optional CORE evaluation.
This guide documents the working end-to-end setup for the current repository state.
Reference files:
configs/Nanochat/synthetic_micro.toml
configs/Nanochat/parquet_micro.toml
examples/nanochat/README.md
external/nanochat/
What you need to know first
There are two separate pieces of setup:
Running Nanochat training inside Plato
Running Nanochat CORE evaluation
The current synthetic_micro.toml configuration already enables:
[evaluation]type="nanochat_core"
So if you run that config as-is, you need both:
the Nanochat Rust tokenizer extension (rustbpe)
a trained tokenizer under ~/.cache/nanochat/tokenizer/
The CORE evaluation bundle itself is downloaded automatically on first use, but the tokenizer is not.
Step 5A: Run the training-only synthetic smoke test
If you only want to verify that Nanochat training works and do not need CORE evaluation yet, first make a local copy of the config and disable the evaluation block there:
Nanochat's tokenizer training script uses all but the last shard for the training split and reserves the last shard for validation. With only one shard, the training split is empty and tokenizer training produces an unusable tokenizer.
5B.2 Train the tokenizer
For the micro config, use a small vocabulary size matching the smoke-test setup:
it reuses Nanochat's cached base data under ~/.cache/nanochat/base_data/
it also requires the tokenizer prepared in Step 5B, because Parquet tokenization and CORE evaluation both depend on it
by default it will reuse the tokenizer trained in Step 5B; if you train a different tokenizer or vocabulary, keep the tokenizer, cached data flow, and model settings aligned
it defaults to device = "cuda"
it performs many more rounds than the synthetic smoke test
it is intended for a more realistic run than the CPU micro smoke test
You may need to adjust device, batch counts, rounds, and data volume for your hardware.
Common failure modes
ModuleNotFoundError: No module named 'nanochat'
This usually happens when running upstream Nanochat scripts directly.
Use the commands in this guide from the Plato repository root and include:
PYTHONPATH=external/nanochat:$PYTHONPATH
when calling upstream scripts such as:
external/nanochat/nanochat/dataset.py
external/nanochat/scripts/tok_train.py
You do not need this extra PYTHONPATH prefix when running plato.py, because Plato's Nanochat integration adds the submodule path internally.
AttributeError: module 'rustbpe' has no attribute 'Tokenizer'
The Rust extension was not built for Plato's active Python environment.