Reads the hyperparameters and weights of a llama-architecture 'GGUF' file
into an rllm_model object usable with rllm_forward(). 2-d weight
tensors are imported with Rgguf::gguf_tensor(as = "native"): their
payloads keep the GGUF storage density (still q4_k/f32/... encoded) in
Rfmalloc-backed, memory-mapped storage, and the forward pass points
GGML tensors at them zero-copy. 1-d norm weights are small and are staged
as packed f32 buffers.
Arguments
- path
Path to a GGUF file.
- runtime
Optional
Rfmalloc::open_fmalloc()runtime for the weight payloads;NULLuses Rfmalloc's default runtime.- rope_mode
RoPE flavour:
0(normal/interleaved, llama) or2(NEOX-style, e.g. qwen2). Defaults to0.
Value
An object of class rllm_model: a list with hparams (named
numeric list), tensors (named list of weight payloads), and
rope_mode.
Details
The loader expects the standard llama tensor names (token_embd.weight,
blk.<i>.attn_q.weight, ..., output_norm.weight) and hyperparameter keys
(<arch>.block_count, <arch>.embedding_length, ...). Models with tied
embeddings (no output.weight) reuse token_embd.weight as the output
projection.