Repository navigation
What's Changed
Minor Changes
- Added
nanotune benchmark review [report], which turns failed benchmark tests into training data. It loads a saved run (the latest by default, or one named the same waybenchmark compareaccepts) and walks each failure one at a time, showing the prompt or full conversation, the acceptable answers, and what the model actually said. Type a corrected answer and it is appended totrain.jsonlwith the project's context message, the same way/keepdoes innanotune chat; multi-turn failures keep their earlier turns. Leave the input blank to skip a failure, or press Esc to stop early and see how many were saved. A run with no failures says so and exits. The benchmark run itself is untouched, so a report can be reviewed any time after it was produced. Thanks to @addyCooks. Closes #178. - Added
nanotune clean --target <fused|base|all>to also cover the shared base-model cache alongside the fused-model cache, and hardened the completeness checks behind both: an interrupted multi-shard fuse or a permission error reading a cache directory no longer produces a false "usable" or crashesnanotune status/nanotune clean. Thanks to @rohanshrma222. Closes #125. nanotune data importgains a--headerlessflag for CSV files. The importer used to auto-detect a header by checking whether the first row was exactlyinput/output, which meant a headerless file whose first data row genuinely was that literal pair got silently dropped as a "header". Passing--headerlessskips auto-detection entirely so that row always imports as data; default behaviour is unchanged. Thanks to @akramcodez. Closes #136.- Stop a training run when validation loss stops improving, and atomically restore the exact weights evaluated as best over
adapters.safetensors. Selection uses a private per-run snapshot at the MLX validation callback rather than numbered checkpoints from earlier runs. Record early-stop and restoration outcomes in training history. Patience defaults to 0, so existing runs are unchanged. Closes #207. - Generate a Hugging Face-style model card beside exported GGUF files, including training settings, dataset counts, and matching saved benchmark results. Publish the card atomically while preserving existing README files, and report card-generation failures as warnings without failing a completed GGUF export.
nanotune benchmark --jsonnow prints the finished run as a single JSON document on stdout — the same document already written to.nanotune/benchmarks/benchmark-<timestamp>.json, so there is one schema rather than two. Progress goes to stderr, since a suite can take minutes and stdout must stay one document. The run itself moves out of the command component intorunBenchmarkinsrc/lib/benchmark-run.ts, an async generator both the Ink view and the JSON path consume, andBenchmarkResultgains an optionalwarningso a partial run is distinguishable from a complete one with a worse pass rate. A bad--presetnow fails immediately instead of after the base model downloads. Thanks to @yashksaini-coder. Closes #69 forbenchmark.nanotune status --jsonandnanotune data validate --jsonnow print a single JSON document to stdout, so the read-only commands can be consumed by scripts and CI. Diagnostics and the unknown-config-key warnings go to stderr; Ink never renders in this mode. The schema is documented indocs/guides/json-output.mdand theValidationResultnow exposesduplicateInputsandinconsistentContextMessagescounts that both views read rather than pattern-matching warning prose. Thanks to @yashksaini-coder. Closes #69 forstatusanddata validate.- Persist local training run history with the effective model settings, dataset counts, duration, outcome, and separate training/validation loss reports. Records are saved before training and refreshed during the run so interrupted runs retain their history.
nanotune statusshows settings and outcome for the current adapter, including checkpoints from failed runs, andnanotune runslists recent runs or exports their complete loss histories as JSON. Resumed runs reference the prior adapter run when available. nanotune data validatenow intersects the normalized user inputs of
train.jsonlandvalid.jsonland warns when any appear in both. A split
produces disjoint sets, but the two files can drift apart afterwards — a
hand-edit, a re-import, or an interrupted split — and an example the model
trained on scores misleadingly well in validation. The report gains a
trainValidOverlapcount and achecks.noTrainValidOverlapverdict, so the
finding is machine-readable rather than only prose, and--evalreports the
same overlap from the validation side. Warning-only:valid, the exit code and
what is on disk are all unchanged.- Warn during
data validatewhen an example looks longer thanmaxSeqLength. The check estimates tokens from the character count and does not fail validation. Closes #206.
Patch Changes
- Appending a training example to
train.jsonlorvalid.jsonlno longer glues it onto the previous line when the file does not end in a newline, which corrupted both examples.nanotune data add,data importand chat's/keepnow start a new line first. Thanks to @addyCooks. Closes #217. - Fix a crash-safety gap where an interrupted train/validation split could
permanently lose the held-back validation examples.saveTrainingDatanow
writes through the existing atomic file-write helper, and the split writes
valid.jsonlbefore truncatingtrain.jsonl, so an interruption between the
two writes can at worst leave a recoverable duplicate — never a loss. - Leave the benchmark display prompt empty when a multi-turn test contains no user message, instead of showing an assistant answer or system instructions as the prompt. Closes #143.
nanotune benchmark --timeoutnow also bounds the LLM-judge call. Previously--timeoutonly covered inference, so a judge provider that accepted the connection but never answered would lock the whole run on a single test, with the AI SDK's default retry policy sitting on top re-issuing the request nobody was timing. Judging gets its own budget of--timeout(a second model call, not the inference one),callJudgeforwards the signal intogenerateTextso retries are cancelled too, and a timed-out judge fails the sample, leavesjudgeScoreunset, and records the reason ("Judge timed out after Nms") injudgeReasoningso the report does not read as the model scoring 0. Thanks to @addyCooks. Closes #132.- Use a unique, private temporary file for each judge configuration save so concurrent processes cannot overwrite or remove each other's pending API-key configuration. Failed saves clean up their own temporary file, and the final configuration remains atomically replaced with owner-only permissions.
Closes #145.
- Writes to the training data are now serialized between
nanotuneprocesses, fixing silent data loss when two of them ran at once.
Starting a data import and then using /keep in a chat session, or pressing d in data list while an import was running, lost examples without any error. A split reads train.jsonl and writes both halves back through a temp file and a rename; an append landing between the read and the rename went to the file the rename had already replaced, and vanished. Every command that writes now takes a lock on .nanotune/data.lock for the length of one read-modify-write, so the second waits instead of overwriting.
Also fixed, and not named in the issue:
nanotune data importtook the lock once per row, so a split starting halfway through would leave the rows imported before it invalid.jsonland the rows after it intrain.jsonl— an import that reported success and had silently become part of the validation set. An import is now one locked step.deleteExample,updateTrainingExample,dedupeExamplesandfixContextMessageslost the same way, which isdata listpressingdore, anddata validate --fix, during an import.nanotune traincounted the validation set and then decided to split, without a lock in between. Twotrainruns on a fresh project both saw no validation set, both split, and the second discarded the first's.data validate --fixrewrote context messages and then deduped as two separate steps, so a write in between left the reported counts describing a file that no longer matched.appendTrainingExamplechecked whether the file ended in a newline and then appended. Two processes both seeing no trailing newline both wrote one, leaving a blank line thatdata validatethen reported as malformed.
A lock left behind by a process that was killed is taken over by the next command, so a crash mid-import no longer leaves the project permanently unwritable. A lock held by another machine is never taken over, because on a shared home directory that process's pid means nothing here.
One deliberate consequence: /keep, data list and data validate now wait for a long data import to finish rather than writing alongside it. There is no "waiting" message, because every command that can block is an interactive screen that owns the terminal.
Reads are deliberately not locked. A read that races a write can only observe a state that genuinely existed, and locking them would stop nanotune status answering for the length of an import.
Closes #196.
- Detach the training
abortlistener once a run finishes, so aborting a reused signal later no longer sends SIGINT to a closed subprocess. nanotune benchmarknow errors withBenchmark dataset is empty (<path>). Add at least one test.whentests.jsonis an empty array, before any model is loaded or downloaded. Previously the run would proceed, write a result file withpassRate: null(the result of0/0 = NaNserialised byJSON.stringify), andbenchmark comparewould later read it as a believable 0% regression against any healthy baseline. The dataset is now also validated before any model/sampling work, so a bad file fails immediately rather than after a multi-gigabyte download. Closes #163.- Fix
data listedit overwriting the first turn when editing any other turn of a multi-turn example.mergeEditedTurnused to locate the turn to replace withmessages.findIndex(m => m.role === 'user'/'assistant'), which always resolved to the first turn regardless of which one was being edited — the UI worked around this by only ever allowing turn 1 to be edited.mergeEditedTurnnow takes an explicit turn index and locates that turn's messages by position, anddata list'sekey now shows a turn picker for multi-turn examples so any turn can be selected and edited without disturbing the others. Closes #135. - Warn about unknown configuration keys inside nested array objects and union branches.
- Fixes found by a release smoke test. llama.cpp installs again: releases are picked from the recent list rather than GitHub's placeholder "latest", and the convert script's
conversionpackage is installed with it. GGUF conversion now installs PyTorch when it is missing, soexportandbenchmark --baseno longer fail with atorchimport error. A download that fails no longer crashestrainwith a stack dump.data importexits 1 when nothing was imported, andvalidate --fixreports unreadable data instead of crashing. Numeric flags tobenchmarkandchatare checked before anything runs, so--ctx-size 4096xand--gpu-layers abcare rejected rather than passed to llama-server. Training loop settings must be positive, which stops--save-every 0from failing deep in mlx_lm. If you upgrade: these are checked wheneverconfig.jsonloads, so a hand-edited value that is now out of range (a zero or negative count, ornumLayersother than -1 or a positive integer) makes every command reportInvalid config.jsonuntil it is corrected. Imported records without a context message get the project's. Ctrl+C stopsbenchmarkandexportinstead of leaving the work running. A data lock left by a process that crashed on the same machine is reclaimed at once, and one with no readable owner after a minute; a lock held elsewhere is reported after 60 seconds rather than 5 minutes, and a read-only project fails at once. A benchmark whose server dies mid-run leaves the interrupted test out of the score. Fixes #137, #134 and #219. - Fixed an issue where
judge configurecould save an API key without a project directory or fail to ignore it in git. Thanks to @addyCooks. Closes #127. - Literal API keys in
judge.jsonthat contain a$are no longer truncated by environment-variable expansion. Only the documented${VAR}and${VAR:-default}forms are expanded, and an unset variable with no default now fails with an error naming the variable instead of sending a blank bearer token. Closes #128. If you upgrade: a bare$VAR(as in"apiKey": "$OPENROUTER_API_KEY") or a${VAR}inside a longer value (as in"baseUrl": "https://${HOST}/v1") is no longer expanded and is sent as written, so the provider will reject it. Change it to a whole-value${VAR}. nanotune benchmarkandnanotune chatnow startllama-serverwith--alias <model-name>, so the server's own API (chat-completion responses,/v1/models,/props) reports which model/quantization is actually loaded instead of defaulting to the raw file path. Closes #197.- Small LoRA
scaleanddropoutvalues are now written to the temporarylora.yamlwith exactly their own digits, instead of being padded to 20 decimals bytoFixed(20). Values below 1e-20 also no longer lose their digits or round to0. Closes #151. - Fixes from a full run of the release smoke test on Apple Silicon. Installing PyTorch or
mlx-lminside a virtualenv no longer fails with "Can not perform a '--user' install", which broke the venv remedy that the externally-managed-environment error recommends. The exit hint onexport,benchmark,benchmark compare,benchmark review,judge test,statusanddata validatenow names the keys that really exit (Enter, Esc, andqwhere it applies) instead of "Press any key".benchmark reviewoffers the latest run of your model instead of a newer--basecontrol, andbenchmark comparewith no or one argument always treats a--basecontrol as the before side (and, when the two latest runs are both controls, pairs the newest control with the newest run of your model), so an improvement is no longer reported as a regression. Theinitsuccess screen no longer shows "[Esc] Cancel". The docs now state thattrain --resumeloads the checkpoint weights and runsiterationsmore from a fresh counter. Also pins the transitiveundicidependency of the AI SDK providers to 7.30.1 or later, which clears four high-severity advisories that were failing the package audit. - The MiniMax Coding Plan judge template now defaults to
MiniMax-M3.1-Flashinstead ofMiniMax-M2.5, which MiniMax retires on November 18, 2026. Existing judge configs keep the model they were saved with; runnanotune judge configureagain, or edit the model in your judge config, to switch. - Fixes from a pre-release review.
data importskips a record whose messages aren't all text (an OpenAI tool-call turn withcontent: null, a numericoutput) instead of importing a row that then stopped edit, dedupe,validate --fixand the first train split from loading the dataset.benchmark --json --baseno longer lets pip's install output into its JSON. Inpartialmatch mode an empty reply no longer passes every test. A benchmark cut short on a category's first test no longer saves a 0/0 category, which showed as NaN% and as a −100% change inbenchmark compare. An export that fails or is cancelled no longer leaves a truncated GGUF forbenchmarkto pick up as the newest model. The model card is refreshed on every export unless you've edited it, so it no longer describes an earlier artifact. Two processes can no longer both take over the same stale data lock, and a lock is only released by its owner. Rewriting a dataset that is a symlink writes through the link and keeps the file's permissions, instead of replacing the link with a plain file. - An empty string in a benchmark test's
acceptablearray no longer makes the test pass no matter what the model says. Undercontains,startsWithandpartial(and thesemanticdelimiter branch) an empty answer matches everything, so a stray""intests.jsonquietly inflated the pass rate.checkPassnow skips blank answers, andnanotune benchmarkrejects a dataset containing one at load time withTest #N: "acceptable" contains an empty string.before any model is loaded. Thanks to @addyCooks. Closes #164. - A benchmark test that sets both
promptandmessagesis now rejected before the run starts, naming the test. Previously themessagesconversation was dropped without a word and the test ran as a single-turn prompt. A test with apromptand an emptymessagesarray now sends that prompt to the LLM judge instead of an empty one. Thanks to @inahus99. Closes #142. nanotune status,nanotune train,nanotune export,nanotune data validateandnanotune data listno longer crash with a React reconciler stack trace whenconfig.jsonis malformed, andnanotune data validateno longer crashes whentrain.jsonlcontains a bad line — instead each command reports the file (and line, where applicable) and exits with code 1. Malformed lines intrain.jsonlare preserved so the mutating helpers never silently delete user data;--fix/--rewrite-contextand edit/delete skip when the data does not fully parse. Thanks to @addyCooks. Closes #126.- Require
isEvalon every helper insrc/lib/data.tsthat writes to the dataset. A caller that forgot the flag used to silently append to, or overwrite, the wrong file; the type checker now catches it at compile time. Read-only helpers (loadTrainingData,countExamples,validateTrainingData, the exporters) keep theisEval = falsedefault — a missing flag shows the wrong set but destroys nothing. No runtime behaviour change. Thanks to @addyCooks. Closes #129. - Retry transient network failures while installing llama.cpp, instead of failing the
whole run. A single502from GitHub releases or a reset socket mid-transfer
previously discarded an entire multi-gigabyte download, and the user started from
zero.installLlamaCppnow wraps its four fetches in a 3-attempt exponential
backoff (1s and 2s waits, with serverRetry-Afterhints honoured), and only genuine transients are retried:
server errors, 408/425/429, a 403 that carriesRetry-After(GitHub's
unauthenticated rate limit), and reset/timeout socket errors. A 404 on a missing
asset still fails immediately, because retrying it only makes the user wait for
an error that cannot change. Failed transfers never publish partial scripts or
archives. Ctrl+C is never retried. Addresses the llama.cpp installation portion
of #215; Hugging Face model downloads remain a separate follow-up. nanotune chat,benchmarkandbenchmark --jsonno longer hang for up to the full startup timeout (60s by default) after reporting thatllama-serverexited during startup. The health-check loop that raced against the child's exit was never cancelled, so it kept polling a dead port until its own deadline. It is now aborted as soon as the race ends. Thanks to @addyCooks. Closes #220.nanotunenow reaps orphaned.tmp-<pid>files left behind by a crashed or SIGKILL'd atomic write. The temp file created bywriteFileAtomicis normally removed in the same call, but a process killed between its temp write and rename never reaches the cleanup — those leftovers used to accumulate forever in.nanotune/benchmarks/. On startup every command sweeps dead-pid temps in the benchmarks directory, andwriteFileAtomicitself sweeps dead-pid temps for its own target path before each write, so a crashed run is healed on the next invocation. Live-pid temps are left alone, so concurrent writes remain safe. Thanks to @ig-imanish.- Include the JSON parser's syntax detail when training data contains malformed JSON.
nanotune data validate(including--fixand--json) andnanotune data listno longer crash with a rawTypeErrorwhen a line oftrain.jsonlparses as JSON but has the wrong shape (null, an object withoutmessages, anullmessage, or a non-stringrole/content). Such lines are now reported asExample N: invalid structureand, like unparseable lines, are left untouched on disk. Thanks to @addyCooks. Closes #218.nanotune data validate --fixand--rewrite-contextnow run their dataset rewrites exactly once per invocation. Previously the call tocollectValidationlived directly in the component's render body; a render body carries no guarantee about how many times it runs, and any future state, context, or parent re-render would have replayed the entiretrain.jsonlwrite without a user action behind it. The command now computes its report behind auseRefand renders from that, so the first frame already reflects the fixed file anduseAutoExitreads the same value the user saw. Separately,saveTrainingDatanow writes through the samewriteFileAtomichelper used for configs and benchmark reports, so an interrupted save can no longer leavetrain.jsonltruncated. Thanks to @addyCooks. Closes #133.
Contributors
This release shipped thanks to @addyCooks, @akramcodez, @AniketR10, @DeepamJha, @Devesh36, @Dhirenderchoudhary, @ig-imanish, @inahus99, @Piyushrathoree, @rohanshrma222, @sagarpjpt, @SAY-5, @tusharui, @will-lamerton and @yashksaini-coder.
First-time contributors: @AniketR10, @DeepamJha, @Devesh36, @Dhirenderchoudhary, @ig-imanish, @inahus99, @Piyushrathoree, @sagarpjpt, @SAY-5, @tusharui and @will-lamerton. Welcome, and thank you!
Install
npm install -g @nanocollective/nanotuneFull Changelog: v1.7.0...v1.8.0