mesh-llm-protocol 0.68.0

Mesh LLM wire protocol types, constants, and frame helpers
Documentation
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
// This file is @generated by prost-build.
/// Stream 0x01 — Gossip
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GossipFrame {
    #[prost(uint32, tag = "1")]
    pub r#gen: u32,
    #[prost(message, repeated, tag = "2")]
    pub peers: ::prost::alloc::vec::Vec<PeerAnnouncement>,
    /// must be exactly 32 bytes; must match QUIC peer identity
    #[prost(bytes = "vec", tag = "3")]
    pub sender_id: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PeerAnnouncement {
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "1")]
    pub endpoint_id: ::prost::alloc::vec::Vec<u8>,
    #[prost(enumeration = "NodeRole", tag = "2")]
    pub role: i32,
    #[prost(uint32, optional, tag = "3")]
    pub http_port: ::core::option::Option<u32>,
    #[prost(string, optional, tag = "4")]
    pub version: ::core::option::Option<::prost::alloc::string::String>,
    /// Deprecated in v0.60.0: prefer hardware.gpus\[\].name
    #[prost(string, optional, tag = "5")]
    pub gpu_name: ::core::option::Option<::prost::alloc::string::String>,
    /// Deprecated in v0.60.0: prefer hardware.hostname
    #[prost(string, optional, tag = "6")]
    pub hostname: ::core::option::Option<::prost::alloc::string::String>,
    /// Deprecated in v0.60.0: prefer hardware.is_soc; true for system-on-chip / unified-memory hosts such as Apple Silicon and Jetson
    #[prost(bool, optional, tag = "7")]
    pub is_soc: ::core::option::Option<bool>,
    /// Deprecated in v0.60.0: prefer hardware.gpus\[\].vram_bytes
    #[prost(string, optional, tag = "8")]
    pub gpu_vram: ::core::option::Option<::prost::alloc::string::String>,
    /// Deprecated in v0.55.0 for protobuf gossip; compatibility surface only
    #[prost(string, repeated, tag = "9")]
    pub available_models: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Deprecated in v0.55.0: prefer served_model_identities and served_model_runtime
    #[prost(string, repeated, tag = "10")]
    pub serving_models: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "11")]
    pub requested_models: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, repeated, tag = "12")]
    pub available_model_metadata: ::prost::alloc::vec::Vec<CompactModelMetadata>,
    #[prost(message, optional, tag = "13")]
    pub experts_summary: ::core::option::Option<ExpertsSummary>,
    #[prost(uint32, optional, tag = "14")]
    pub rtt_ms: ::core::option::Option<u32>,
    /// GGUF model names (mesh catalog contribution; was JSON `models`)
    #[prost(string, repeated, tag = "15")]
    pub catalog_models: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// GPU VRAM in bytes
    #[prost(uint64, tag = "16")]
    pub vram_bytes: u64,
    /// how to obtain this node's model
    #[prost(string, optional, tag = "17")]
    pub model_source: ::core::option::Option<::prost::alloc::string::String>,
    /// primary serving model (backward compat; was JSON `serving`)
    #[prost(string, optional, tag = "18")]
    pub primary_serving: ::core::option::Option<::prost::alloc::string::String>,
    /// stable mesh identity (self entry only)
    #[prost(string, optional, tag = "19")]
    pub mesh_id: ::core::option::Option<::prost::alloc::string::String>,
    /// demand map entries (self entry only)
    #[prost(message, repeated, tag = "20")]
    pub demand: ::prost::alloc::vec::Vec<ModelDemandEntry>,
    /// file sizes (bytes) per GGUF model name
    #[prost(map = "string, uint64", tag = "21")]
    pub available_model_sizes: ::std::collections::HashMap<::prost::alloc::string::String, u64>,
    /// JSON-serialized EndpointAddr (includes network addresses for peer discovery)
    #[prost(bytes = "vec", tag = "22")]
    pub serialized_addr: ::prost::alloc::vec::Vec<u8>,
    /// actually routable / healthy
    #[prost(string, repeated, tag = "23")]
    pub hosted_models: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// false/absent when relayed from legacy JSON peers
    #[prost(bool, optional, tag = "24")]
    pub hosted_models_known: ::core::option::Option<bool>,
    #[prost(message, repeated, tag = "25")]
    pub served_model_descriptors: ::prost::alloc::vec::Vec<ServedModelDescriptor>,
    #[prost(message, repeated, tag = "26")]
    pub served_model_identities: ::prost::alloc::vec::Vec<ServedModelIdentity>,
    #[prost(message, repeated, tag = "27")]
    pub served_model_runtime: ::prost::alloc::vec::Vec<ModelRuntimeDescriptor>,
    #[prost(message, optional, tag = "28")]
    pub owner_attestation: ::core::option::Option<SignedNodeOwnership>,
    /// Deprecated in v0.60.0: prefer hardware.gpus\[\].mem_bandwidth_gbps
    #[prost(string, optional, tag = "29")]
    pub gpu_mem_bandwidth_gbps: ::core::option::Option<::prost::alloc::string::String>,
    /// Deprecated in v0.60.0: prefer hardware.gpus\[\].compute_tflops_fp32
    #[prost(string, optional, tag = "30")]
    pub gpu_compute_tflops_fp32: ::core::option::Option<::prost::alloc::string::String>,
    /// Deprecated in v0.60.0: prefer hardware.gpus\[\].compute_tflops_fp16
    #[prost(string, optional, tag = "31")]
    pub gpu_compute_tflops_fp16: ::core::option::Option<::prost::alloc::string::String>,
    /// Deprecated in v0.60.0: prefer hardware.gpus\[\].reserved_bytes
    #[prost(string, optional, tag = "32")]
    pub gpu_reserved_bytes: ::core::option::Option<::prost::alloc::string::String>,
    /// Introduced in v0.60.0; preferred structured hardware inventory
    #[prost(message, optional, tag = "33")]
    pub hardware: ::core::option::Option<HardwareInfo>,
    #[prost(uint64, optional, tag = "34")]
    pub first_joined_mesh_ts: ::core::option::Option<u64>,
    /// Advisory canonical refs this node wants the mesh to consider
    #[prost(string, repeated, tag = "35")]
    pub explicit_model_interests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Additive feature discovery for admitted subsystem protocols
    #[prost(message, repeated, tag = "37")]
    pub subprotocols: ::prost::alloc::vec::Vec<MeshSubprotocol>,
    #[prost(uint32, optional, tag = "40")]
    pub latency_ms: ::core::option::Option<u32>,
    #[prost(enumeration = "LatencySource", tag = "41")]
    pub latency_source: i32,
    #[prost(uint32, optional, tag = "42")]
    pub latency_age_ms: ::core::option::Option<u32>,
    #[prost(bytes = "vec", optional, tag = "43")]
    pub latency_observer_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
    #[prost(message, repeated, tag = "44")]
    pub advertised_model_throughput: ::prost::alloc::vec::Vec<AdvertisedModelThroughput>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AdvertisedModelThroughput {
    #[prost(string, tag = "1")]
    pub model_name: ::prost::alloc::string::String,
    #[prost(uint64, tag = "2")]
    pub avg_tokens_per_second_milli: u64,
    #[prost(uint64, tag = "3")]
    pub throughput_samples: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MeshSubprotocol {
    /// e.g. "skippy-stage"
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// subprotocol major version
    #[prost(uint32, tag = "2")]
    pub major: u32,
    /// e.g. "artifact-transfer"
    #[prost(string, repeated, tag = "3")]
    pub features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MeshSubprotocolOpen {
    #[prost(uint32, tag = "1")]
    pub r#gen: u32,
    /// e.g. "skippy-stage"
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    /// subprotocol major version
    #[prost(uint32, tag = "3")]
    pub major: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HardwareInfo {
    /// True for system-on-chip / unified-memory hosts such as Apple Silicon and Jetson
    #[prost(bool, optional, tag = "1")]
    pub is_soc: ::core::option::Option<bool>,
    #[prost(string, optional, tag = "2")]
    pub hostname: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, repeated, tag = "3")]
    pub gpus: ::prost::alloc::vec::Vec<GpuInfo>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GpuInfo {
    #[prost(string, optional, tag = "1")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub vram_bytes: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "3")]
    pub reserved_bytes: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "4")]
    pub mem_bandwidth_gbps: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "5")]
    pub compute_tflops_fp32: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "6")]
    pub compute_tflops_fp16: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SignedNodeOwnership {
    #[prost(uint32, tag = "1")]
    pub version: u32,
    #[prost(string, tag = "2")]
    pub cert_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub owner_id: ::prost::alloc::string::String,
    /// 32 bytes
    #[prost(bytes = "vec", tag = "4")]
    pub owner_sign_public_key: ::prost::alloc::vec::Vec<u8>,
    /// 32 bytes
    #[prost(bytes = "vec", tag = "5")]
    pub node_endpoint_id: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "6")]
    pub issued_at_unix_ms: u64,
    #[prost(uint64, tag = "7")]
    pub expires_at_unix_ms: u64,
    #[prost(string, optional, tag = "8")]
    pub node_label: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "9")]
    pub hostname_hint: ::core::option::Option<::prost::alloc::string::String>,
    /// Ed25519 signature over canonical claim bytes
    #[prost(bytes = "vec", tag = "10")]
    pub signature: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ServedModelDescriptor {
    #[prost(message, optional, tag = "1")]
    pub identity: ::core::option::Option<ServedModelIdentity>,
    #[prost(message, optional, tag = "2")]
    pub capabilities: ::core::option::Option<ModelCapabilities>,
    #[prost(message, optional, tag = "3")]
    pub topology: ::core::option::Option<ModelTopology>,
    #[prost(bool, optional, tag = "4")]
    pub capabilities_known: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ServedModelIdentity {
    #[prost(string, tag = "1")]
    pub model_name: ::prost::alloc::string::String,
    #[prost(bool, tag = "2")]
    pub is_primary: bool,
    #[prost(enumeration = "ModelSourceKind", tag = "3")]
    pub source_kind: i32,
    #[prost(string, optional, tag = "4")]
    pub canonical_ref: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "5")]
    pub repository: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "6")]
    pub revision: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "7")]
    pub artifact: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "8")]
    pub local_file_name: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "9")]
    pub identity_hash: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ModelCapabilities {
    #[prost(enumeration = "CapabilityLevel", tag = "1")]
    pub vision: i32,
    #[prost(enumeration = "CapabilityLevel", tag = "2")]
    pub reasoning: i32,
    #[prost(enumeration = "CapabilityLevel", tag = "3")]
    pub tool_use: i32,
    #[prost(bool, tag = "4")]
    pub moe: bool,
    #[prost(bool, tag = "5")]
    pub multimodal: bool,
    #[prost(enumeration = "CapabilityLevel", tag = "6")]
    pub audio: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ModelTopology {
    #[prost(message, optional, tag = "1")]
    pub moe: ::core::option::Option<ModelMoeInfo>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ModelRuntimeDescriptor {
    #[prost(string, tag = "1")]
    pub model_name: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub identity_hash: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, optional, tag = "3")]
    pub context_length: ::core::option::Option<u32>,
    #[prost(bool, tag = "4")]
    pub ready: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ModelMoeInfo {
    #[prost(uint32, tag = "1")]
    pub expert_count: u32,
    #[prost(uint32, tag = "2")]
    pub used_expert_count: u32,
    #[prost(uint32, optional, tag = "3")]
    pub min_experts_per_node: ::core::option::Option<u32>,
    #[prost(string, optional, tag = "4")]
    pub source: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "5")]
    pub ranking_source: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, repeated, tag = "6")]
    pub ranking: ::prost::alloc::vec::Vec<u32>,
    #[prost(uint32, optional, tag = "7")]
    pub ranking_prompt_count: ::core::option::Option<u32>,
    #[prost(uint32, optional, tag = "8")]
    pub ranking_tokens: ::core::option::Option<u32>,
    #[prost(string, optional, tag = "9")]
    pub ranking_layer_scope: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "10")]
    pub ranking_origin: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactModelMetadata {
    #[prost(string, tag = "1")]
    pub model_key: ::prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub context_length: u32,
    #[prost(uint32, tag = "3")]
    pub vocab_size: u32,
    #[prost(uint32, tag = "4")]
    pub embedding_size: u32,
    #[prost(uint32, tag = "5")]
    pub head_count: u32,
    #[prost(uint32, tag = "6")]
    pub layer_count: u32,
    #[prost(uint32, tag = "7")]
    pub feed_forward_length: u32,
    #[prost(uint32, tag = "8")]
    pub key_length: u32,
    #[prost(uint32, tag = "9")]
    pub value_length: u32,
    #[prost(string, tag = "10")]
    pub architecture: ::prost::alloc::string::String,
    #[prost(string, tag = "11")]
    pub tokenizer_model_name: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "12")]
    pub special_tokens: ::prost::alloc::vec::Vec<SpecialToken>,
    #[prost(float, tag = "13")]
    pub rope_scale: f32,
    #[prost(float, tag = "14")]
    pub rope_freq_base: f32,
    #[prost(bool, tag = "15")]
    pub is_moe: bool,
    #[prost(uint32, tag = "16")]
    pub expert_count: u32,
    #[prost(uint32, tag = "17")]
    pub used_expert_count: u32,
    /// GGUF quantization type string (e.g. "Q4_K_M")
    #[prost(string, tag = "18")]
    pub quantization_type: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SpecialToken {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub token_id: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExpertsSummary {
    #[prost(uint32, tag = "1")]
    pub total_experts: u32,
    #[prost(uint32, tag = "2")]
    pub expert_count_used: u32,
    #[prost(uint32, repeated, tag = "3")]
    pub top_expert_ids: ::prost::alloc::vec::Vec<u32>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ModelDemandEntry {
    #[prost(string, tag = "1")]
    pub model_name: ::prost::alloc::string::String,
    #[prost(uint64, tag = "2")]
    pub last_active: u64,
    #[prost(uint64, tag = "3")]
    pub request_count: u64,
}
/// Stream 0x03 — Tunnel Map
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TunnelMap {
    #[prost(bytes = "vec", tag = "1")]
    pub owner_peer_id: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, repeated, tag = "2")]
    pub entries: ::prost::alloc::vec::Vec<TunnelEntry>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TunnelEntry {
    #[prost(bytes = "vec", tag = "1")]
    pub target_peer_id: ::prost::alloc::vec::Vec<u8>,
    #[prost(bytes = "vec", optional, tag = "2")]
    pub relay_peer_id: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
    #[prost(uint32, tag = "3")]
    pub tunnel_port: u32,
}
/// Stream 0x05 — Route Table
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RouteTableRequest {
    /// 0 or exactly 32 bytes (passive callers may omit)
    #[prost(bytes = "vec", tag = "1")]
    pub requester_id: ::prost::alloc::vec::Vec<u8>,
    /// must equal NODE_PROTOCOL_GENERATION; rejected otherwise
    #[prost(uint32, tag = "2")]
    pub r#gen: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteTable {
    #[prost(message, repeated, tag = "1")]
    pub entries: ::prost::alloc::vec::Vec<RouteEntry>,
    /// stable mesh identity — passive/client callers learn this here
    #[prost(string, optional, tag = "2")]
    pub mesh_id: ::core::option::Option<::prost::alloc::string::String>,
    /// must equal NODE_PROTOCOL_GENERATION; caller rejects mismatches
    #[prost(uint32, tag = "3")]
    pub r#gen: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RouteEntry {
    /// exactly 32 bytes (peer public key)
    #[prost(bytes = "vec", tag = "1")]
    pub endpoint_id: ::prost::alloc::vec::Vec<u8>,
    /// model being served (empty if node is not actively serving)
    #[prost(string, tag = "2")]
    pub model: ::prost::alloc::string::String,
}
/// Stream 0x06 — Peer Down
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PeerDown {
    /// exactly 32 bytes; the peer being reported as unreachable
    #[prost(bytes = "vec", tag = "1")]
    pub peer_id: ::prost::alloc::vec::Vec<u8>,
    /// must equal NODE_PROTOCOL_GENERATION; rejected otherwise
    #[prost(uint32, tag = "2")]
    pub r#gen: u32,
}
/// Stream 0x07 — Peer Leaving
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PeerLeaving {
    /// exactly 32 bytes; must match the QUIC sender identity
    #[prost(bytes = "vec", tag = "1")]
    pub peer_id: ::prost::alloc::vec::Vec<u8>,
    /// must equal NODE_PROTOCOL_GENERATION; rejected otherwise
    #[prost(uint32, tag = "2")]
    pub r#gen: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeConfigSnapshot {
    /// config schema version (currently 1)
    #[prost(uint32, tag = "1")]
    pub version: u32,
    #[prost(message, optional, tag = "2")]
    pub gpu: ::core::option::Option<NodeGpuConfig>,
    #[prost(message, repeated, tag = "3")]
    pub models: ::prost::alloc::vec::Vec<NodeModelEntry>,
    #[prost(message, repeated, tag = "4")]
    pub plugins: ::prost::alloc::vec::Vec<NodePluginEntry>,
    /// canonical persisted config payload for additive owner-control roundtrip
    #[prost(string, optional, tag = "5")]
    pub config_toml: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NodeGpuConfig {
    #[prost(enumeration = "GpuAssignment", tag = "1")]
    pub assignment: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ConfiguredModelRef {
    #[prost(string, tag = "1")]
    pub declared_ref: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub source_kind: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "3")]
    pub revision: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NodeModelEntry {
    #[prost(string, tag = "1")]
    pub model: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "2")]
    pub mmproj: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint32, optional, tag = "3")]
    pub ctx_size: ::core::option::Option<u32>,
    #[prost(string, optional, tag = "4")]
    pub gpu_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "5")]
    pub model_ref: ::core::option::Option<ConfiguredModelRef>,
    #[prost(message, optional, tag = "6")]
    pub mmproj_ref: ::core::option::Option<ConfiguredModelRef>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NodePluginEntry {
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    #[prost(bool, optional, tag = "2")]
    pub enabled: ::core::option::Option<bool>,
    #[prost(string, optional, tag = "3")]
    pub command: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "4")]
    pub args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlEnvelope {
    /// must equal NODE_PROTOCOL_GENERATION
    #[prost(uint32, tag = "1")]
    pub r#gen: u32,
    #[prost(message, optional, tag = "2")]
    pub handshake: ::core::option::Option<OwnerControlHandshake>,
    #[prost(message, optional, tag = "3")]
    pub request: ::core::option::Option<OwnerControlRequest>,
    #[prost(message, optional, tag = "4")]
    pub response: ::core::option::Option<OwnerControlResponse>,
    #[prost(message, optional, tag = "5")]
    pub error: ::core::option::Option<OwnerControlError>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlHandshake {
    #[prost(message, optional, tag = "1")]
    pub ownership: ::core::option::Option<SignedNodeOwnership>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlRequest {
    #[prost(uint64, tag = "1")]
    pub request_id: u64,
    #[prost(message, optional, tag = "2")]
    pub get_config: ::core::option::Option<OwnerControlGetConfigRequest>,
    #[prost(message, optional, tag = "3")]
    pub watch_config: ::core::option::Option<OwnerControlWatchConfigRequest>,
    #[prost(message, optional, tag = "4")]
    pub apply_config: ::core::option::Option<OwnerControlApplyConfigRequest>,
    #[prost(message, optional, tag = "5")]
    pub refresh_inventory: ::core::option::Option<OwnerControlRefreshInventoryRequest>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlResponse {
    #[prost(uint64, tag = "1")]
    pub request_id: u64,
    #[prost(message, optional, tag = "2")]
    pub get_config: ::core::option::Option<OwnerControlGetConfigResponse>,
    #[prost(message, optional, tag = "3")]
    pub watch_config: ::core::option::Option<OwnerControlWatchConfigResponse>,
    #[prost(message, optional, tag = "4")]
    pub apply_config: ::core::option::Option<OwnerControlApplyConfigResponse>,
    #[prost(message, optional, tag = "5")]
    pub refresh_inventory: ::core::option::Option<OwnerControlRefreshInventoryResponse>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlError {
    #[prost(enumeration = "OwnerControlErrorCode", tag = "1")]
    pub code: i32,
    #[prost(string, tag = "2")]
    pub message: ::prost::alloc::string::String,
    #[prost(uint64, optional, tag = "3")]
    pub request_id: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "4")]
    pub current_revision: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlGetConfigRequest {
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "1")]
    pub requester_node_id: ::prost::alloc::vec::Vec<u8>,
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "2")]
    pub target_node_id: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlGetConfigResponse {
    #[prost(message, optional, tag = "1")]
    pub snapshot: ::core::option::Option<OwnerControlConfigSnapshot>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlWatchConfigRequest {
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "1")]
    pub requester_node_id: ::prost::alloc::vec::Vec<u8>,
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "2")]
    pub target_node_id: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag = "3")]
    pub include_snapshot: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlWatchConfigResponse {
    #[prost(message, optional, tag = "1")]
    pub accepted: ::core::option::Option<OwnerControlWatchAccepted>,
    #[prost(message, optional, tag = "2")]
    pub snapshot: ::core::option::Option<OwnerControlConfigSnapshot>,
    #[prost(message, optional, tag = "3")]
    pub update: ::core::option::Option<OwnerControlConfigUpdate>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlWatchAccepted {
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "1")]
    pub target_node_id: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlApplyConfigRequest {
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "1")]
    pub requester_node_id: ::prost::alloc::vec::Vec<u8>,
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "2")]
    pub target_node_id: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "3")]
    pub expected_revision: u64,
    #[prost(message, optional, tag = "4")]
    pub config: ::core::option::Option<NodeConfigSnapshot>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlApplyConfigResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(uint64, tag = "2")]
    pub current_revision: u64,
    #[prost(bytes = "vec", tag = "3")]
    pub config_hash: ::prost::alloc::vec::Vec<u8>,
    #[prost(string, optional, tag = "4")]
    pub error: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "ConfigApplyMode", tag = "5")]
    pub apply_mode: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlRefreshInventoryRequest {
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "1")]
    pub requester_node_id: ::prost::alloc::vec::Vec<u8>,
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "2")]
    pub target_node_id: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlRefreshInventoryResponse {
    #[prost(message, optional, tag = "1")]
    pub snapshot: ::core::option::Option<OwnerControlConfigSnapshot>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlConfigSnapshot {
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "1")]
    pub node_id: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "2")]
    pub revision: u64,
    /// SHA-256 of canonical proto bytes (32 bytes)
    #[prost(bytes = "vec", tag = "3")]
    pub config_hash: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, optional, tag = "4")]
    pub config: ::core::option::Option<NodeConfigSnapshot>,
    #[prost(string, optional, tag = "5")]
    pub hostname: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OwnerControlConfigUpdate {
    /// exactly 32 bytes
    #[prost(bytes = "vec", tag = "1")]
    pub node_id: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "2")]
    pub revision: u64,
    /// SHA-256 of canonical proto bytes (32 bytes)
    #[prost(bytes = "vec", tag = "3")]
    pub config_hash: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, optional, tag = "4")]
    pub config: ::core::option::Option<NodeConfigSnapshot>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CapabilityLevel {
    Unspecified = 0,
    None = 1,
    Likely = 2,
    Supported = 3,
}
impl CapabilityLevel {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "CAPABILITY_LEVEL_UNSPECIFIED",
            Self::None => "CAPABILITY_LEVEL_NONE",
            Self::Likely => "CAPABILITY_LEVEL_LIKELY",
            Self::Supported => "CAPABILITY_LEVEL_SUPPORTED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CAPABILITY_LEVEL_UNSPECIFIED" => Some(Self::Unspecified),
            "CAPABILITY_LEVEL_NONE" => Some(Self::None),
            "CAPABILITY_LEVEL_LIKELY" => Some(Self::Likely),
            "CAPABILITY_LEVEL_SUPPORTED" => Some(Self::Supported),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ModelSourceKind {
    Unspecified = 0,
    Catalog = 1,
    HuggingFace = 2,
    LocalGguf = 3,
    DirectUrl = 4,
    Unknown = 5,
}
impl ModelSourceKind {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "MODEL_SOURCE_KIND_UNSPECIFIED",
            Self::Catalog => "MODEL_SOURCE_KIND_CATALOG",
            Self::HuggingFace => "MODEL_SOURCE_KIND_HUGGING_FACE",
            Self::LocalGguf => "MODEL_SOURCE_KIND_LOCAL_GGUF",
            Self::DirectUrl => "MODEL_SOURCE_KIND_DIRECT_URL",
            Self::Unknown => "MODEL_SOURCE_KIND_UNKNOWN",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "MODEL_SOURCE_KIND_UNSPECIFIED" => Some(Self::Unspecified),
            "MODEL_SOURCE_KIND_CATALOG" => Some(Self::Catalog),
            "MODEL_SOURCE_KIND_HUGGING_FACE" => Some(Self::HuggingFace),
            "MODEL_SOURCE_KIND_LOCAL_GGUF" => Some(Self::LocalGguf),
            "MODEL_SOURCE_KIND_DIRECT_URL" => Some(Self::DirectUrl),
            "MODEL_SOURCE_KIND_UNKNOWN" => Some(Self::Unknown),
            _ => None,
        }
    }
}
/// Shared enum
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NodeRole {
    Unspecified = 0,
    Worker = 1,
    Host = 2,
    Client = 3,
}
impl NodeRole {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "NODE_ROLE_UNSPECIFIED",
            Self::Worker => "WORKER",
            Self::Host => "HOST",
            Self::Client => "CLIENT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "NODE_ROLE_UNSPECIFIED" => Some(Self::Unspecified),
            "WORKER" => Some(Self::Worker),
            "HOST" => Some(Self::Host),
            "CLIENT" => Some(Self::Client),
            _ => None,
        }
    }
}
/// Latency source type for peer latency data
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LatencySource {
    Unspecified = 0,
    Direct = 1,
    Estimated = 2,
    Unknown = 3,
}
impl LatencySource {
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "LATENCY_SOURCE_UNSPECIFIED",
            Self::Direct => "DIRECT",
            Self::Estimated => "ESTIMATED",
            Self::Unknown => "UNKNOWN",
        }
    }
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "LATENCY_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
            "DIRECT" => Some(Self::Direct),
            "ESTIMATED" => Some(Self::Estimated),
            "UNKNOWN" => Some(Self::Unknown),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GpuAssignment {
    Unspecified = 0,
    Auto = 1,
    Pinned = 2,
}
impl GpuAssignment {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "GPU_ASSIGNMENT_UNSPECIFIED",
            Self::Auto => "GPU_ASSIGNMENT_AUTO",
            Self::Pinned => "GPU_ASSIGNMENT_PINNED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "GPU_ASSIGNMENT_UNSPECIFIED" => Some(Self::Unspecified),
            "GPU_ASSIGNMENT_AUTO" => Some(Self::Auto),
            "GPU_ASSIGNMENT_PINNED" => Some(Self::Pinned),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ConfigApplyMode {
    Unspecified = 0,
    Staged = 1,
    Live = 2,
    Noop = 3,
}
impl ConfigApplyMode {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "CONFIG_APPLY_MODE_UNSPECIFIED",
            Self::Staged => "CONFIG_APPLY_MODE_STAGED",
            Self::Live => "CONFIG_APPLY_MODE_LIVE",
            Self::Noop => "CONFIG_APPLY_MODE_NOOP",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CONFIG_APPLY_MODE_UNSPECIFIED" => Some(Self::Unspecified),
            "CONFIG_APPLY_MODE_STAGED" => Some(Self::Staged),
            "CONFIG_APPLY_MODE_LIVE" => Some(Self::Live),
            "CONFIG_APPLY_MODE_NOOP" => Some(Self::Noop),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OwnerControlErrorCode {
    Unspecified = 0,
    BadRequest = 1,
    Unauthorized = 2,
    RevisionConflict = 3,
    ControlUnsupported = 4,
    ControlEndpointRequired = 5,
    ControlUnavailable = 6,
    UnknownCommand = 7,
    LegacyJsonUnsupported = 8,
    InvalidHandshake = 9,
    TargetNodeMismatch = 10,
}
impl OwnerControlErrorCode {
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "OWNER_CONTROL_ERROR_CODE_UNSPECIFIED",
            Self::BadRequest => "OWNER_CONTROL_ERROR_CODE_BAD_REQUEST",
            Self::Unauthorized => "OWNER_CONTROL_ERROR_CODE_UNAUTHORIZED",
            Self::RevisionConflict => "OWNER_CONTROL_ERROR_CODE_REVISION_CONFLICT",
            Self::ControlUnsupported => "OWNER_CONTROL_ERROR_CODE_CONTROL_UNSUPPORTED",
            Self::ControlEndpointRequired => "OWNER_CONTROL_ERROR_CODE_CONTROL_ENDPOINT_REQUIRED",
            Self::ControlUnavailable => "OWNER_CONTROL_ERROR_CODE_CONTROL_UNAVAILABLE",
            Self::UnknownCommand => "OWNER_CONTROL_ERROR_CODE_UNKNOWN_COMMAND",
            Self::LegacyJsonUnsupported => "OWNER_CONTROL_ERROR_CODE_LEGACY_JSON_UNSUPPORTED",
            Self::InvalidHandshake => "OWNER_CONTROL_ERROR_CODE_INVALID_HANDSHAKE",
            Self::TargetNodeMismatch => "OWNER_CONTROL_ERROR_CODE_TARGET_NODE_MISMATCH",
        }
    }
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "OWNER_CONTROL_ERROR_CODE_UNSPECIFIED" => Some(Self::Unspecified),
            "OWNER_CONTROL_ERROR_CODE_BAD_REQUEST" => Some(Self::BadRequest),
            "OWNER_CONTROL_ERROR_CODE_UNAUTHORIZED" => Some(Self::Unauthorized),
            "OWNER_CONTROL_ERROR_CODE_REVISION_CONFLICT" => Some(Self::RevisionConflict),
            "OWNER_CONTROL_ERROR_CODE_CONTROL_UNSUPPORTED" => Some(Self::ControlUnsupported),
            "OWNER_CONTROL_ERROR_CODE_CONTROL_ENDPOINT_REQUIRED" => {
                Some(Self::ControlEndpointRequired)
            }
            "OWNER_CONTROL_ERROR_CODE_CONTROL_UNAVAILABLE" => Some(Self::ControlUnavailable),
            "OWNER_CONTROL_ERROR_CODE_UNKNOWN_COMMAND" => Some(Self::UnknownCommand),
            "OWNER_CONTROL_ERROR_CODE_LEGACY_JSON_UNSUPPORTED" => Some(Self::LegacyJsonUnsupported),
            "OWNER_CONTROL_ERROR_CODE_INVALID_HANDSHAKE" => Some(Self::InvalidHandshake),
            "OWNER_CONTROL_ERROR_CODE_TARGET_NODE_MISMATCH" => Some(Self::TargetNodeMismatch),
            _ => None,
        }
    }
}