gguf

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FileExtension is the file extension for GGUF model files
	FileExtension = ".gguf"
)

Variables

View Source
var (
	ErrInvalidContext  = llama.ErrInvalidContext
	ErrInvalidArgument = llama.ErrInvalidArgument
	ErrKeyNotFound     = llama.ErrKeyNotFound
	ErrIndexOutOfRange = llama.ErrIndexOutOfRange
	ErrTypeMismatch    = llama.ErrTypeMismatch
	ErrOpenFailed      = llama.ErrOpenFailed
)

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context represents a GGUF file context for reading metadata

func Open

func Open(path string) (*Context, error)

Open opens a GGUF file and returns a Context for reading metadata. The caller must call Close() when done.

func (*Context) AllMetadata

func (c *Context) AllMetadata() (map[string]any, error)

AllMetadata returns all key-value pairs as a map

func (*Context) Architecture

func (c *Context) Architecture() string

Architecture returns the model architecture, or empty string if not found

func (*Context) ChatTemplate

func (c *Context) ChatTemplate() string

ChatTemplate returns the chat template, or empty string if not found

func (*Context) Close

func (c *Context) Close() error

Close releases the GGUF context resources

func (*Context) Description

func (c *Context) Description() string

Description returns the model description, or empty string if not found

func (*Context) MetaCount

func (c *Context) MetaCount() int

MetaCount returns the number of key-value pairs in the GGUF metadata

func (*Context) MetaKey

func (c *Context) MetaKey(index int) (string, error)

MetaKey returns the key at the given index

func (*Context) MetaValue

func (c *Context) MetaValue(key string) (any, error)

MetaValue returns the value for a given key as an interface{}

func (*Context) Name

func (c *Context) Name() string

Name returns the model name from metadata, or empty string if not found

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL