Expand description
Weirdnet local models.
artifact: inspect and hash model files a person brings (GGUF models, split models, LoRA adapters and projectors; safetensors and MLX model directories; PEFT adapters), refusing pickles, code and symlinks, and theProvenancerecord kept next to them;ModelStore::importplaces them in the store.catalog: pinned Gemma 4 E2B and E4B GGUF files (Hugging Face repo, file, size, SHA-256).storeanddownload: where model files and LoRA adapters live (list and remove them too), and a consent-gated download that resumes a.partfile and checks size and SHA-256 before the file appears, for single and split models and for adapters.hf: search the Hugging Face Hub, read a repo’s GGUF files (split files grouped) and a file’s header, so any repo can become aModelSpec; find a repo’s LoRA adapters (GGUF and PEFT), which are never listed as models;HfTokenfor gated repos, read on the downloading node only.gguf: the GGUF header fields that size the KV cache, and whether a file is a model or a LoRA adapter.fit: pick the largest file whose weights and KV cache fit the memory budget.prompt: render chat turns with the model’s own Jinja template, and the<tool_call>tag format for tools (prompt text and a streaming parser).worker: anEngineon its own thread, streaming text with cancel.cpu: whether this CPU can run the compiled-in llama.cpp (checked before it loads).hw: what accelerators and memory this machine has, the memory budget for models, a tiered catalog with footprints, andhw::planto pick models that fit.llama(feature): the llama.cppEngine.agent(feature):weirdnet_agent::ModelBackendover the worker.
Nothing here knows an app: callers pass paths, consent and callbacks.
Re-exports§
pub use artifact::Artifact;pub use artifact::ArtifactFile;pub use artifact::ArtifactFormat;pub use artifact::ArtifactKind;pub use artifact::Provenance;pub use artifact::inspect;pub use catalog::Device;pub use catalog::ModelSpec;pub use catalog::human;pub use download::Consent;pub use download::Progress;pub use download::download;pub use download::download_adapter;pub use download::download_parts;pub use hf::AdapterFormat;pub use hf::Hub;pub use hf::RepoAdapter;pub use prompt::ChatMessage;pub use prompt::ChatRole;pub use store::DiskSpace;pub use store::Imported;pub use store::ModelLayout;pub use store::ModelStore;pub use store::StoredAdapter;pub use store::StoredModel;pub use store::StoredProjector;pub use token::HfToken;pub use worker::Chunk;pub use worker::Engine;pub use worker::GenerateRequest;pub use worker::Generation;pub use worker::Stats;pub use worker::Worker;
Modules§
- artifact
- Model files a person brings themselves (a fine-tune made elsewhere, a trainer’s output):
inspectreads and hashes them,Provenancerecords where they came from, andModelStore::importplaces them in the store. - catalog
- Which model files Weirdnet knows how to fetch.
- cpu
- Can this CPU run the llama.cpp compiled into this build?
- download
- Consent-gated download of one model file, or every part of a split model, or a LoRA adapter
(
download_adapter): resumes a.part, checks the size and the SHA-256, and only then renames it into place. Requests carry the store’s Hugging Face token when it may go to the store’s Hub (seeModelStore::from_env). - fit
- Which file of a repo to download: the largest quantization whose weights plus KV cache fit
the node’s memory
Budget. - gguf
- The parts of a GGUF header that size a model’s KV cache, read from the start of the file
(over HTTP with a
Rangerequest, seeHub::gguf_info), and whether a file is a model or a LoRA adapter (read_header). - hf
- Hugging Face Hub: search for GGUF repos, read a repo’s GGUF files (split files grouped into
one model), read a file’s header for KV sizing, so any repo can become a
ModelSpec; and find a repo’s LoRA adapters (Hub::adapters: GGUF LoRA files and PEFT safetensors), which are never listed as models. - hw
- Hardware detection and model sizing.
- prompt
- Chat prompts: the model’s own Jinja template, a Gemma-style fallback, and the
<tool_call>tag format for tools. - store
- Where model files live on disk, and which Hub they come from. LoRA adapters live apart, in
adapters/<id>/(ModelStore::adapters), and are never listed as models. - token
- A Hugging Face access token, for gated and private repos.
- worker
- Inference on a worker thread: callers submit a request and read streamed text, and can cancel.
Enums§
- Error
- Everything that can go wrong here.