Module: GgufKV
- Defined in:
- lib/toy/io/gguf_kv.rb
Overview
GGUF metadata FFI — slim, independent of lib/toy/ffi/tinynn.rb / Mat.
Exists to work around a Spinel cross-class type-inference issue where loading lib/tokenizer.rb alongside lib/transformer.rb (which pulls in Mat-using FFNFFICache via lib/toy/ffi/tinynn.rb) triggers polymorphic dispatch widening Mat#nrows to sp_RbVal, producing generated C that fails to compile.
This module binds ONLY the GGUF metadata kv-read FFI (handle open + scalar/array reads + close). No tensor types, no Mat, no FFNFFICache. Callers requiring just metadata access load this module standalone.