Skip to main content

Crate weirdnet_model

Crate weirdnet_model 

Source
Expand description

Weirdnet local models.

  • catalog: pinned Gemma 4 E2B and E4B GGUF files (Hugging Face repo, file, size, SHA-256).
  • store and download: where model files live, and a consent-gated download that resumes a .part file and checks size and SHA-256 before the file appears.
  • hf: read a Hugging Face repo’s GGUF files, so any repo can become a ModelSpec.
  • 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: an Engine on its own thread, streaming text with cancel.
  • cpu: whether this CPU can run the compiled-in llama.cpp (checked before it loads).
  • llama (feature): the llama.cpp Engine.
  • agent (feature): weirdnet_agent::ModelBackend over the worker.

Nothing here knows an app: callers pass paths, consent and callbacks.

Re-exports§

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 prompt::ChatMessage;
pub use prompt::ChatRole;
pub use store::ModelStore;
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§

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: resumes a .part, checks the size and the SHA-256, and only then renames it into place.
hf
Reading a Hugging Face repo’s GGUF files, so any repo can become a ModelSpec.
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.
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.

Type Aliases§

Result