SpawnDev.Hive
0.2.10
Prefix Reserved
See the version list below for details.
dotnet add package SpawnDev.Hive --version 0.2.10
NuGet\Install-Package SpawnDev.Hive -Version 0.2.10
<PackageReference Include="SpawnDev.Hive" Version="0.2.10" />
<PackageVersion Include="SpawnDev.Hive" Version="0.2.10" />
<PackageReference Include="SpawnDev.Hive" />
paket add SpawnDev.Hive --version 0.2.10
#r "nuget: SpawnDev.Hive, 0.2.10"
#:package SpawnDev.Hive@0.2.10
#addin nuget:?package=SpawnDev.Hive&version=0.2.10
#tool nuget:?package=SpawnDev.Hive&version=0.2.10
SpawnDev.Hive
A hive of trusted devices - browser tabs and desktop apps joined over WebRTC - where each device loads the models the hive needs and serves them to the others. As devices come and go, or as demand shifts, the hive re-plans which device holds which model.
Status: early (M2). The placement planner, the Hive wire and HiveNode work over real SpawnDev.Swarm sessions on desktop and in the browser; the real-model gates with SpawnDev.AI and SpawnGen are next. Design and status: Plans/PLAN-Hive.md.
How it fits
- SpawnDev.Swarm gives each device an identity in an owner-signed registry, authenticated sessions, and a term-and-lease coordinator.
- SpawnDev.Hive (this) runs on top: every member advertises what it can hold, the member holding the Swarm lease plans where each skill (a set of models) lives, and each member's router picks the peer for a request.
- Requests never pass through Hive. The router hands back a Swarm session; the consumer sends on its own message types (SpawnDev.AI 0x100, SpawnGen 0x200).
Use
// Per member, alongside its SwarmCoordinator:
var node = new HiveNode(swarmCoordinator, deviceKey.PublicKey, myHost); // myHost : IHiveSkillHost; null for a member that only sends requests
// For every session, before session.Start():
swarmCoordinator.Attach(session);
node.Attach(session);
session.Start();
swarmCoordinator.Start();
node.Start();
// Route one request:
var skill = new HiveSkill("chat-qwen3-8b", new[] { new HiveModel("qwen3-8b", 5_000_000_000) });
using var route = await node.PickAsync(skill, expectedSecondsPerRequest: 2.0, requestId: Guid.NewGuid());
// route.Session: send the request on your own message type; null means serve it on this device.
// A "not loaded here" answer: node.ReportStale(route.PeerId, skill.Key) and pick again.
A skill is a set of models that must be on one peer: HiveFitMode.Sum (resident together, as SpawnDev.AI) or HiveFitMode.Turns (each model fits alone, as SpawnGen), with an optional required backend for byte-identical results.
Built on SpawnDev.Swarm and SpawnDev.RTC. First consumers: SpawnDev.AI and SpawnGen.
License
MIT. See LICENSE.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- SpawnDev.Swarm (>= 0.2.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.3.5 | 54 | 12/2/2026 |
| 0.3.4 | 57 | 12/2/2026 |
| 0.3.3 | 57 | 12/1/2026 |
| 0.3.2 | 62 | 12/1/2026 |
| 0.3.1 | 61 | 12/1/2026 |
| 0.3.0 | 59 | 12/1/2026 |
| 0.2.11 | 60 | 12/1/2026 |
| 0.2.10 | 63 | 12/1/2026 |
| 0.2.9 | 55 | 12/1/2026 |
| 0.2.8 | 55 | 12/1/2026 |
| 0.2.7 | 55 | 12/1/2026 |
| 0.2.6 | 67 | 12/1/2026 |
| 0.2.5 | 66 | 11/30/2026 |
| 0.2.4 | 60 | 11/30/2026 |
| 0.2.3 | 66 | 11/30/2026 |
| 0.2.2 | 63 | 11/30/2026 |
| 0.2.1 | 65 | 11/30/2026 |
| 0.2.0 | 61 | 11/30/2026 |
| 0.1.2 | 60 | 11/30/2026 |
| 0.1.1 | 64 | 11/30/2026 |
v0.2.10 - Fix (regression since 0.2.6): a host that loads and serves a skill but never lists its model as resident (SpawnGen's measured residency, a tiny model) was sent the same Load every plan and, with 0.2.6's routable filter, never routed. A Ready-acked Load now counts as assigned: planned as resident and routable until a stale report, a real unload (an advert that had listed the model no longer does), the pair leaving the plan, or a new term. v0.2.9 - Membership pieces lifted from SpawnGen (Lore): HiveMembership (key, pinned root, hive id, registry, tracker) with VerifierAsync; HiveMember.StartAsync (connector + coordinator + HiveNode, HiveMemberOptions incl. OnSession) which keeps every newer registry it adopts, from any path (KeepRegistry); HiveTabLeadership, the browser tab election and handover over Web Locks + BroadcastChannel. On SpawnDev.Swarm 0.2.11. v0.2.8 - Stale reports carry a report id (HiveStalePair.ReportId, wire extension 2): a new refusal of a pair reported before, even one since resolved, re-opens it at the coordinator, and a router clears a mark only when the echo answers that report. Additive; 0.2.7 members read the pairs as before. v0.2.7 - A stale report names the refusing (peer, skill) (HiveDemandReport.Stale, wire extension 1), and the coordinator plans that skill as not resident there until the peer acknowledges a Load of it (or RetryAfter passes): each placement echoes the reports it was planned with (StaleSeen), and a router clears its stale mark only then, so a re-plan no longer sends the request back to the refusing peer. Additive; interoperates with 0.2.x. v0.2.6 - Coordinator: a placed peer becomes routable only once it acknowledged receiving its Load (a peer now acks a Load at once, Progress 0), so a request no longer reaches a peer with no assignment yet (409 + ReportStale + resend). Planner: a grown shared-device share uses the same rule as a resident one, so SetBudget no longer swings while a load completes. No API change; wire-compatible. v0.2.5 - Planner fix (shared devices): a skill needing more than an equal part of a shared device's free memory was never placed, though the device had room (a stale re-placement stayed unplaced). When nothing fits within the shares, a host that applies SetBudget now takes the device's unclaimed memory and its SetBudget covers the load; ordinary plans are unchanged. v0.2.4 - On SpawnDev.Swarm 0.2.7 / SpawnDev.RTC 2.5.3: desktop hive sessions no longer stall ~30 ms per packet (DTLS receive polled), so adverts, directives, requests and failover detection answer faster. No API or wire change. v0.2.3 - IHiveSkillHost.CanServeLocally (default false): a host that could serve a skill for its own requests although not placed there makes this device a zero-transfer router candidate, so a large request stays local when that is cheaper. v0.2.2 - The router weighs transfer: PickAsync(skill, seconds, requestId, transferBytes, ...) adds transferBytes over the measured link speed to each placed peer (ReportTransfer), with this device costing none. Additive. v0.2.1 - Per-device budgets (finding F): hosts sharing a GPU advertise a DeviceId and the device total, the planner splits the device and sends SetBudget to hosts that list the "set-budget" feature (IHiveSkillHost.SetBudgetAsync, default refuses). Turns swap state (finding G): a Turns peer that would swap does not count its models as resident. Wire-compatible with 0.2.0 (both ride on wire version 2 extensions). v0.2.0 - BREAKING (whole hive upgrades together): Hive wire version 2, forward-compatible from now on. Every message ends with a Swarm extension list (unknown tags skipped); unknown directive kinds are refused, unknown ack statuses count as failed, unknown model states as loading, unknown fit modes as unplaceable; the advert carries the wire version and a feature list; HiveNode reserves 0x400-0x4FF so an unknown Hive message type is ignored. On SpawnDev.Swarm 0.2.5. v0.1.2 - Placements from a different coordinator in the same term win (two members can coordinate one term before the lease converges). Wire-compatible. v0.1.1 - A HiveNode may have no host (a member that only sends requests): it is never placed on, but it routes and can coordinate. v0.1.0 - First release (early, M2): HivePlanner (pure, deterministic placement of model sets by estimated completion time over each peer's whole queue, budgets with named evictions, stability, hot-skill redundancy, required backends); the Hive wire 0x400-0x4FF; HiveNode (advertise, carry out directives, route requests, and plan on the Swarm lease holder). Desktop and browser.