Expand description
/weirdnet-backends/models/1: the owner manages a model node’s model files over
weirdnet-net: search the Hugging Face Hub, see which files fit the node, pull one (split
GGUFs too) and serve it without a restart, list and remove what is on disk. LoRA adapters
too: Pull::adapter_for pulls one for a served base model and adds it to that base;
ModelsCommand::ServeAdapter, ModelsCommand::UnserveAdapter and
ModelsCommand::AdapterScale add a stored one to a base, take one off and change its scale
while the base keeps running where the engine allows (see Supervisor::add_adapter_live).
Only the owner may use it: ModelsService takes an Authorize and runs nothing before
it admits the caller. Pass weirdnet_agent::serve::RosterAuth for the owner’s linked devices
(with require_roles to narrow it to devices holding a role the owner granted).
The Hugging Face token never travels: the node uses its own (ModelStore::from_env), and
nothing in this protocol carries one.
Models made elsewhere are uploaded (ModelsCommand::Upload, see upload for the
stream), copied node to node (PullSource::Peer over ModelsCommand::Fetch), and
writes follow the service’s WritePolicy. ModelsCommand::List carries each entry’s
provenance; ModelsCommand::Disk reports free space, limits and usage.
Each stream carries one ModelsRequest (CBOR, with the caller’s certificate) and its
answers (ModelsReply): one answer, or for ModelsCommand::Pull a stream of
ModelsReply::Progress then ModelsReply::Pulled. Closing the stream cancels a pull;
the partial file is kept, so pulling again resumes it.
Re-exports§
pub use placed::OnPlaced;pub use placed::Placed;pub use placed::PlacedVia;pub use upload::CHUNK;pub use upload::DiskReport;pub use upload::KeepFree;pub use upload::PullSource;pub use upload::Upload;pub use upload::UploadFrame;pub use upload::WritePolicy;pub use upload::refusal;pub use upload::refusal_reason;
Modules§
- placed
- Placement hooks: the app hears about every entry a
ModelsServiceputs in its store. - upload
- models/1 uploads: local files sent to a node in chunks, resumable, checked before anything is
placed;
ModelsCommand::Fetchso a node can pull an upload or a stored entry from another node (PullSource::Peer);ModelsCommand::Disk; and theWritePolicyfor all writes.
Structs§
- Models
Client - The owner’s side of models/1, over a
Dialer(weirdnet_agent::pool::NetDialeron Weirdnet). - Models
Request - What a client sends: its certificate and one command.
- Models
Server - Serves a
ModelsServiceon aweirdnet-netnode. Dropping it stops serving. - Models
Service - A model node’s models/1 side. Transport-neutral (
ModelsService::servetakes a channel);ModelsServerruns it on aweirdnet-netnode. Its methods also work in-process (a local CLI on the node itself). - Pull
- What to pull.
- Pulled
- A finished pull.
- Repo
Fits - A repo’s models against this node.
- Stored
Entry - A stored model or LoRA adapter and, when the supervisor serves it, its state.
Enums§
- Models
Command - A models/1 request. Nodes before 0.4.1 refuse the adapter commands.
- Models
Reply - What a models/1 node answers.
Constants§
- MODELS_
PROTOCOL - The protocol id.