1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
use clap::Subcommand;
use std::path::PathBuf;
use crate::MeshGuardrailCliMode;
#[derive(Subcommand, Debug)]
pub enum RuntimeCommand {
/// List available or locally discoverable native runtimes.
List {
/// List release-manifest or bundled runtimes instead of installed runtimes.
#[arg(long, conflicts_with = "installed")]
available: bool,
/// List locally discoverable native runtimes. This is the default.
#[arg(long, conflicts_with = "available")]
installed: bool,
/// Release manifest JSON to inspect.
#[arg(long)]
manifest: Option<PathBuf>,
/// Packaged native runtime directory to inspect. Repeatable.
#[arg(long = "bundle-dir")]
bundle_dirs: Vec<PathBuf>,
/// Override the native runtime cache root.
#[arg(long)]
cache_dir: Option<PathBuf>,
/// Print machine-readable JSON.
#[arg(long)]
json: bool,
},
/// Install the recommended native runtime, or an explicit flavor/runtime ID.
Install {
/// Optional runtime flavor or native runtime ID. Omit to install the recommended runtime.
runtime: Option<String>,
/// Release manifest JSON to resolve against.
#[arg(long)]
manifest: Option<PathBuf>,
/// Packaged native runtime directory to install from. Repeatable.
#[arg(long = "bundle-dir")]
bundle_dirs: Vec<PathBuf>,
/// Override the native runtime cache root.
#[arg(long)]
cache_dir: Option<PathBuf>,
/// Print machine-readable JSON.
#[arg(long)]
json: bool,
},
/// Remove an installed native runtime.
Remove {
/// Native runtime ID to remove.
native_runtime_id: String,
/// MeshLLM version. Defaults to the running MeshLLM version.
#[arg(long)]
mesh_version: Option<String>,
/// Override the native runtime cache root.
#[arg(long)]
cache_dir: Option<PathBuf>,
/// Print machine-readable JSON.
#[arg(long)]
json: bool,
},
/// Prune old native runtimes from the cache.
Prune {
/// Remove every runtime not matching the active MeshLLM version.
#[arg(long)]
active_only: bool,
/// Override the active MeshLLM version. Defaults to the running version.
#[arg(long)]
mesh_version: Option<String>,
/// Override the native runtime cache root.
#[arg(long)]
cache_dir: Option<PathBuf>,
/// Print machine-readable JSON.
#[arg(long)]
json: bool,
},
/// Show local model status on a running mesh-llm instance.
#[command(hide = true)]
Status {
/// Console/API port of the running mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
},
/// Show the local-only owner-control bootstrap policy for a running mesh-llm instance.
#[command(hide = true)]
Bootstrap {
/// Console/API port of the running mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print the raw JSON payload.
#[arg(long)]
json: bool,
},
/// Fetch config from a remote owner-control endpoint through the local management API.
#[command(hide = true)]
GetConfig {
/// Explicit owner-control endpoint token for the target node.
#[arg(long)]
endpoint: String,
/// Console/API port of the local mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print the raw JSON payload.
#[arg(long)]
json: bool,
},
/// Scan and refresh inventory on a remote owner-control endpoint.
ScanRefresh {
/// Explicit owner-control endpoint token for the target node.
#[arg(long)]
endpoint: String,
/// Console/API port of the local mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print the raw JSON payload.
#[arg(long)]
json: bool,
},
/// Load a model on a remote node through owner-control.
LoadModel {
/// Explicit owner-control endpoint token for the target node.
#[arg(long)]
endpoint: String,
/// Model canonical reference to load.
#[arg(long)]
model: String,
/// Optional runtime profile to apply.
#[arg(long)]
profile: Option<String>,
/// Console/API port of the local mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print machine-readable JSON.
#[arg(long)]
json: bool,
},
/// Unload a model on a remote node through owner-control.
UnloadModel {
/// Explicit owner-control endpoint token for the target node.
#[arg(long)]
endpoint: String,
/// Model canonical reference to unload.
#[arg(
long,
required_unless_present = "instance_id",
conflicts_with = "instance_id"
)]
model: Option<String>,
/// Exact instance ID to unload.
#[arg(long, required_unless_present = "model", conflicts_with = "model")]
instance_id: Option<String>,
/// Console/API port of the local mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print machine-readable JSON.
#[arg(long)]
json: bool,
},
/// Ensure a model is loaded on a remote node through owner-control.
EnsureModel {
/// Explicit owner-control endpoint token for the target node.
#[arg(long)]
endpoint: String,
/// Model canonical reference to ensure loaded.
#[arg(long)]
model: String,
/// Optional runtime profile to maintain.
#[arg(long)]
profile: Option<String>,
/// Console/API port of the local mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print machine-readable JSON.
#[arg(long)]
json: bool,
},
/// Drain and unload a model on a remote node through owner-control.
DrainModel {
/// Explicit owner-control endpoint token for the target node.
#[arg(long)]
endpoint: String,
/// Model canonical reference to drain.
#[arg(
long,
required_unless_present = "instance_id",
conflicts_with = "instance_id"
)]
model: Option<String>,
/// Exact instance ID to drain.
#[arg(long, required_unless_present = "model", conflicts_with = "model")]
instance_id: Option<String>,
/// Console/API port of the local mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print machine-readable JSON.
#[arg(long)]
json: bool,
},
/// Refresh local inventory on a remote owner-control endpoint through the local management API.
#[command(hide = true)]
RefreshInventory {
/// Explicit owner-control endpoint token for the target node.
#[arg(long)]
endpoint: String,
/// Console/API port of the local mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print the raw JSON payload.
#[arg(long)]
json: bool,
},
/// Apply config to a remote owner-control endpoint through the local management API.
#[command(hide = true)]
ApplyConfig {
/// Explicit owner-control endpoint token for the target node.
#[arg(long)]
endpoint: String,
/// Expected remote config revision for CAS.
#[arg(long)]
expected_revision: u64,
/// TOML config file to apply remotely.
#[arg(long)]
config: PathBuf,
/// Console/API port of the local mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print the raw JSON payload.
#[arg(long)]
json: bool,
},
/// Load a local model into a running mesh-llm instance.
#[command(hide = true)]
Load {
/// Model name/path/url to load
name: String,
/// Console/API port of the running mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
},
/// Unload a local model from a running mesh-llm instance.
#[command(alias = "drop", hide = true)]
Unload {
/// Model name to unload
name: String,
/// Console/API port of the running mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
},
/// Set mesh guardrail mode on running Skippy-backed models without restart.
#[command(hide = true)]
Guardrails {
/// Guardrail mode to apply to active Skippy-backed OpenAI surfaces.
#[arg(long, value_enum)]
mode: MeshGuardrailCliMode,
/// Console/API port of the running mesh-llm instance (default: 3131)
#[arg(long, default_value = "3131")]
port: u16,
/// Print the raw JSON payload.
#[arg(long)]
json: bool,
},
}