@flop-labs/cli 0.4.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/README.md +22 -1
  3. package/dist/cli.js +1438 -467
  4. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,100 @@ and this package follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.0] - 2026-11-12
11
+
12
+ ### Added
13
+
14
+ - `flop miner capacity-rate show [address]` prints the miner's D-0542 reservation rate and free
15
+ capacity at the finalized head; `flop miner capacity-rate set <rate> | --whole-cap [--dry-run]`
16
+ submits `set_capacity_reservation_rate`, or prints the encoded call without signing.
17
+
18
+ - `flop model mirrors set --model-hash <hash> --source <mirror>...` submits
19
+ `modelRegistry.setModelMirrors`, which replaces a model's mirror hint list. Sources are
20
+ `https://`, `hf:<owner>/<model>`, `modelscope:<owner>/<model>` and `da:<commitment>`. A `da:`
21
+ source must be a live Leased DA blob; its provider comes from finalized state. Input is
22
+ checked before signing: each entry is at most 512 bytes, there are no duplicates, and the
23
+ final list holds 1 to 8 entries. `--clear` sends the empty list that removes every mirror.
24
+ The signer must be the model's publisher. The pallet admits no one else, so neither a
25
+ registrar nor Root can set mirrors. `--append` keeps the finalized list verbatim and is a
26
+ no-op once every source is present; a DA entry counts as present only at the same commitment
27
+ and provider. Every run reports the finalized list it read as `registered`. `--dry-run` prints
28
+ the encoded call without signing.
29
+ `--json` prints the result.
30
+
31
+ - `flop model onboard` and `flop model preflight` report the model's paid throughput
32
+ ceiling: the completion tokens per second one channel can be paid for at a live accepted
33
+ calibration cap (`hwCalibration.benchmarkBurstCaps` at finality, `cap × 1e9 × 1000 /
34
+ (babe.expectedBlockTime × 2 × active parameters)`). The per-token work is not rounded up
35
+ to whole G_n, because the meter truncates only after summing a turn; `gnPerToken` is that
36
+ exact value. The median live cap is used unless
37
+ `--miner <address>` names one (`capSource`); the best live cap is reported beside it but
38
+ never gated. It appears as `throughputCeiling`
39
+ (onboard) or `throughput_ceiling` (preflight) in JSON output and as a stderr line.
40
+ `preflight` reads the chain only with an explicit `--rpc`; otherwise the ceiling is
41
+ `unknown (no chain connection)`, never a default. `--min-tokens-per-second <n>` makes it a
42
+ gate: a ceiling below `n`, or unknown, exits non-zero, and `onboard` fails before any chain
43
+ write. Without the flag it only warns.
44
+ - `flop miner doctor --running` checks a miner that is already serving, from a release
45
+ pack or another host, instead of its setup prerequisites. `--address` checks that the
46
+ account is registered, active and holds an accepted calibration cap at finality.
47
+ `--endpoint https://host` checks that the public name refuses anonymous
48
+ `/session/info` and answers a fresh `/session/info-proof` challenge with a ready proof
49
+ signed by the worker's own session key for its own model identity, as read on
50
+ `--session-url` with `SESSION_AUTH_TOKEN`. `--endpoint` needs `--session-url`, and none
51
+ of these run with `--offline`.
52
+
53
+ ### Changed
54
+
55
+ - Depends on `@flop-labs/sdk` 0.6.0, so every `flop` command connects to runtimes `1014015`
56
+ through `1014020`, including `flop miner capacity-rate` on the capacity-reservation runtime.
57
+
58
+ - `flop model onboard --approve` now works on a metadata-only run (a Hugging Face
59
+ `--source` without `--download`) once its DA backup is bound. That means after
60
+ `flop model backup`, `flop model upload --commitment` and
61
+ `flop model mirrors set --append --source da:<table>`. Approval runs the same finalized
62
+ checks as before: a Leased image of the packed size, a live lease, and a file table that
63
+ hashes to `model_hash` and is named by a DA mirror. Without a bound image the flag is
64
+ refused before capture or any chain write. Before, it was refused even after the backup was
65
+ bound. `--paid-admission` still fails closed at `independent-audit-unavailable`.
66
+ Because a metadata run never packed the image, it then spot-checks 2 random chunks of the
67
+ bound image before approving, using `da-validator retrieve --chunk` (each chunk checked
68
+ against the DA commitment). Whole files must match their sha256, files cut by a chunk edge
69
+ must equal the hub's bytes at the pinned revision, and padding must be zero. It then rereads
70
+ the evidence and refuses if the bound image or file table changed. The result is reported as
71
+ `daSpotCheck`. It is a sample, not a proof. It needs a `da-validator` with `--chunk`.
72
+ - Approval now reads `ModelMirrors` strictly: a failed read reports
73
+ `cannot read ModelMirrors at finality` instead of a missing file-table mirror.
74
+ - `flop model backup` now ends by printing the `flop model mirrors set` command, not the raw
75
+ call.
76
+
77
+ ### Fixed
78
+
79
+ - `flop gateway renew` now checks up to four miner identities and deployments at
80
+ once, so slow endpoints delay the next paid tools probe less. Paid probes
81
+ still run one at a time in the original miner order.
82
+ - `flop model fetch` and `flop model upload --source hf:<repo>` no longer download a
83
+ Hugging Face mirror from `main` into memory. They take `--revision <40-hex sha>`,
84
+ read that commit's published sha256 table, and stream every file at that one commit,
85
+ each held to its SHA-256. Without `--revision`, `main` is used only when its table
86
+ reproduces the registered `content-v1` root. Any other result is refused before any
87
+ weight byte moves, and the error names the resolved commit. With `--revision`, a
88
+ `verity-v1` root is measured after the transfer. `fetch` writes into an empty
89
+ `--output-dir` only once the bytes verify.
90
+ - `flop model onboard --hf-repo` checks the repo's sha256 table against the local
91
+ content root before downloading anything. It then pins the download to that commit.
92
+ A local source now accepts `--revision` together with `--hf-repo`.
93
+
94
+ ## [0.4.4] - 2026-11-10
95
+
96
+ ### Fixed
97
+
98
+ - Gateway tools probes now reconcile ambiguous cooperative closes against finalized
99
+ channel events without submitting a second close.
100
+ - Model backup keeps download receipts beside `--model-dir` unless `--state-dir`
101
+ selects another location on the same filesystem; metadata-only onboarding now
102
+ passes the registered precision to the suggested backup command.
103
+
10
104
  ## [0.4.3] - 2026-11-09
11
105
 
12
106
  ### Fixed
package/README.md CHANGED
@@ -93,6 +93,9 @@ flop agent session create --delegate <address>
93
93
  # Miners: sim first, measured TDX for verified production, cloud is non-attested.
94
94
  flop miner init --mode sim
95
95
  flop miner doctor --mode sim
96
+ # A serving miner: chain state plus the public proof gateway admission checks.
97
+ # SESSION_AUTH_TOKEN comes from the environment, never the command line.
98
+ flop miner doctor --running --session-url http://127.0.0.1:8645/session/info --endpoint https://<miner-host>
96
99
  flop miner status [address]
97
100
  flop --signer <MINER-URI> miner register --commission 10
98
101
  flop --signer <MINER-URI> miner calibrate-start
@@ -172,6 +175,19 @@ A registered miner publishes the GPUs it runs as a signed `flop.gpu-inventory.v1
172
175
  self-reported and display-only: calibration caps, SKU ceilings and rewards never read it. The CLI
173
176
  image cannot run the host's `nvidia-smi`, so pass its output with `--nvidia-smi` (`-` reads stdin).
174
177
 
178
+ #### Capacity reservation rate
179
+ ```bash
180
+ flop miner capacity-rate show [address] # rate, cap, reserved and free G_n/s at the finalized head
181
+ flop --keystore miner.json --password-env FLOP_KEY_PASSWORD miner capacity-rate set 25 --dry-run # encoded call only
182
+ flop --keystore miner.json --password-env FLOP_KEY_PASSWORD miner capacity-rate set 25
183
+ flop --keystore miner.json --password-env FLOP_KEY_PASSWORD miner capacity-rate set --whole-cap # clear it
184
+ ```
185
+
186
+ Each channel opened against a miner reserves this rate from its accepted cap until the channel
187
+ lapses; unset, it reserves the whole cap, so only one channel fits at a time. `miner-worker` keeps
188
+ it at `floor(cap / MINER_MAX_CONCURRENT_SESSIONS)` unless you set a lower one. The call exists only
189
+ on a runtime with capacity reservations; elsewhere the command refuses.
190
+
175
191
  #### Stake Info
176
192
  ```bash
177
193
  flop info 5Grwva8... # Get miner stake info
@@ -212,7 +228,9 @@ flop model list
212
228
  flop model get <hash-or-name> --precision FP16
213
229
  flop model fetch <hash-or-name> --output-dir ./weights
214
230
  flop model fetch <hash> --source hf:org/repo --precision INT8
231
+ flop model fetch <hash> --revision <40-hex sha> --output-dir ./weights
215
232
  flop --signer <PUBLISHER> model upload --model-hash <hash> --path ./weights
233
+ flop --signer <PUBLISHER> model mirrors set --model-hash <hash> --append --source da:<table> --dry-run
216
234
  BASE=http://miner:8000 DECODE_POLICY_HASH=0x<hash> \
217
235
  flop --network local model onboard --source org/model --precision BF16
218
236
 
@@ -222,7 +240,10 @@ flop --signer <PUBLISHER> model upload \
222
240
  ```
223
241
 
224
242
  Fetch accepts `hf:`, `modelscope:`, HTTPS, and `da:` sources and writes only
225
- after dm-verity matches the registered root. Full upload builds the canonical
243
+ after dm-verity matches the registered root. A Hugging Face mirror streams at one
244
+ commit: `--revision <sha>` pins it, and without it `main` is used only when its
245
+ sha256 table reproduces a `content-v1` root (`upload --source hf:` likewise; see
246
+ `docs/onboarding/model.md`). Full upload builds the canonical
226
247
  image, runs `da-validator submit`, registers its leased blob, and binds it.
227
248
  Onboard additionally registers the model, mirrors, per-precision measured root,
228
249
  and decode policy, but only after the serving endpoint passes capture replay,