char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
7992aa7c8
char/aliceai-t5-moe
1#pragma once 2 3#include "ggml-cpp.h" 4#include "gguf.h" 5 6#include <cstdint> 7#include <optional> 8#include <string> 9#include <vector> 10 11struct gguf_remote_tensor { 12std ::string name ; 13ggml_type type = GGML_TYPE_F32 ; 14int64_t ne [4 ]= {1 ,1 ,1 ,1 };// dimensions, unused dims = 1 15uint32_t n_dims = 0 ; 16}; 17 18struct gguf_remote_model { 19// Selected KV metadata 20std ::string architecture ;// general.architecture 21uint32_t n_embd = 0 ;// <arch>.embedding_length 22uint32_t n_ff = 0 ;// <arch>.feed_forward_length 23uint32_t n_vocab = 0 ;// inferred from token_embd.weight ne[1] 24uint32_t n_layer = 0 ;// <arch>.block_count 25uint32_t n_head = 0 ;// <arch>.attention.head_count 26uint32_t n_head_kv = 0 ;// <arch>.attention.head_count_kv 27uint32_t n_expert = 0 ;// <arch>.expert_count (0 if absent) 28uint32_t n_embd_head_k = 0 ;// <arch>.attention.key_length 29uint32_t n_embd_head_v = 0 ;// <arch>.attention.value_length 30uint16_t n_split = 0 ;// split.count (0 = not split) 31uint32_t n_split_tensors = 0 ;// split.tensors.count (0 if not split) 32 33std ::vector < gguf_remote_tensor > tensors ; 34}; 35 36// Fetch model metadata from HuggingFace with local caching. 37// repo: e.g., "ggml-org/Qwen3-32B-GGUF" 38// quant: e.g., "Q8_0" -- auto-detects filename (including first shard of split models) 39// Returns nullopt if download fails or network is unavailable. 40std ::optional < gguf_remote_model > gguf_fetch_model_meta ( 41const std ::string & repo , 42const std ::string & quant = "Q8_0" , 43const std ::string & cache_dir = "" ,// empty = default 44bool verbose = true); 45 46gguf_context_ptr gguf_fetch_gguf_ctx ( 47const std ::string & repo , 48const std ::string & quant = "Q8_0" , 49const std ::string & cache_dir = "" , 50bool verbose = true);