llamacpp

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package llamacpp is the llama.cpp embedder for the memory store: a GGUF embedding model driven through cgo against the static libraries under build/llama.cpp. It is the module's only cgo dependency on llama.cpp and only cmd/ask imports it, so a consumer of pkg/memory that supplies its own memory.Embedder never links llama.cpp.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultModelPath

func DefaultModelPath() (string, error)

DefaultModelPath returns the standard local embedding model GGUF location.

Types

type EmbeddingModel

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

EmbeddingModel manages an in-memory llama.cpp embedding model instance.

func LoadEmbeddingModel

func LoadEmbeddingModel(path string) (*EmbeddingModel, error)

LoadEmbeddingModel initializes the llama.cpp backend and loads the GGUF model from path.

func (*EmbeddingModel) Close

func (m *EmbeddingModel) Close()

Close releases the llama context and model resources.

func (*EmbeddingModel) EmbdSize

func (m *EmbeddingModel) EmbdSize() int

EmbdSize returns the embedding dimension of the model.

func (*EmbeddingModel) Embed

func (m *EmbeddingModel) Embed(text string) ([]float32, error)

Embed generates an embedding vector for the provided text.

Jump to

Keyboard shortcuts

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