How it works
From a failure you can reproduce to an adapter you can remove.
A Retoque patch is a LoRA adapter trained to fix one narrow, testable mistake on one exact open-weight checkpoint. Every patch goes through these six steps. The running example is the first-party payment tool-call patch.
Step 01
Diagnose
A patch starts from a failure you can check with a program, not with an opinion. For the first patch the task is turning a sentence such as "Pay Northwind Traders $1,250.00 for the office rent, due next Friday" into one strict create_payment JSON call with six fields.
The unpatched base is measured first. It tends to write major units where the schema asks for cents, copy "next Friday" instead of resolving it to a date, and drop the category. If the base already handles a task, there is nothing to patch and the project stops here.
Step 02
Build and test
Training data is split by sentence template and by payee before training starts, so held-out cases use sentence shapes and names the adapter never saw. The adapter is trained with supervised fine-tuning on assistant tokens only, with a fixed seed and recorded hyperparameters.
Evaluation loads the same base checkpoint once and runs every arm in one process: the base model, the base with three worked examples in the prompt, the patched model, and the patched model with the adapter switched off. A separate regression suite of unrelated tasks checks what the patch broke. The details are on the methodology page.
Step 03
Publish
A version is packaged only from a held-out evaluation that references the exact adapter bytes it tested. The package contains data and weights, never code. Every file is hashed into the manifest, and the manifest digest is signed with the publisher's ed25519 key.
$ tar -tf ledger-tool-call-1.0.0.tarREADME.mdLICENSE.txtadapter_config.jsonadapter_model.safetensorschecksums.txteval-report.jsonretoque.manifest.jsonsignature.json{ "algorithm": "ed25519", "signedPayload": "sha256(retoque.manifest.json)", "manifestSha256": "<64 hex>", "publicKey": "<64 hex>", "signature": "<128 hex>", "role": "publisher"}Published versions are immutable. Changing any byte, including the license text, means a new version number. A reviewer then checks rights, provenance and the regression results before the version appears in the catalog.
Step 04
License
Free patches use a click-through license: you read the terms, accept their digest, and the entitlement is recorded against your account. No wallet is involved.
Paid licenses settle on Robinhood Chain. The registry contract records each version's manifest and adapter digests, and the license market records who paid for which version under which terms digest. Retoque grants access only after its server reads the confirmed purchase event from the chain. License contracts are not deployed for this environment yet.
Step 05
Install
The CLI checks the base model you name against the manifest, downloads the package with a single-use link, verifies the signature and every file hash, and only then moves the files into place. A mismatched revision is refused unless you pass an explicit override.
$ retoque login$ retoque install ledger-tool-call@1.0.0 \ --model 'Qwen/Qwen2.5-1.5B-Instruct@989aa7980e4cf806f80c7fef2b1adb7bc71aa306'Install writes retoque.lock in the current directory, pinning the exact package, manifest, adapter and base digests so a teammate or a CI job gets the same bytes.
{ "lockfileVersion": 1, "patches": { "ledger-tool-call": { "version": "1.0.0", "packageSha256": "<64 hex>", "manifestSha256": "<64 hex>", "adapterSha256": "<64 hex>", "baseModel": { "repository": "Qwen/Qwen2.5-1.5B-Instruct", "revision": "989aa7980e4cf806f80c7fef2b1adb7bc71aa306", "tokenizerSha256": "<64 hex>" }, "preflight": "SUPPORTED_EXACT", "experimentalOverride": false } }}Step 06
Measure and roll back
Run the same input with and without the adapter on your own hardware. Disabling a patch keeps its files and makes the runtime use the pure base model. Rolling back switches to an earlier installed version and re-pins the lockfile. The base weights are never written to.
$ retoque run --patch ledger-tool-call --input task.json$ retoque run --patch ledger-tool-call --input task.json --no-patch$ retoque disable ledger-tool-call$ retoque rollback ledger-tool-call --to 0.9.0$ retoque statusThe version numbers above show command shape only. Check the catalog for what is actually published.