llama

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package llama provides embedding via llama.cpp CGo bindings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

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

Embedder implements embedding.Embedder using llama.cpp via CGo.

func New

func New(modelPath string, nThreads, nGPULayers int) (*Embedder, error)

New creates a new embedder backed by llama.cpp. modelPath: path to GGUF model file. nThreads: inference threads (0 = number of CPUs). nGPULayers: layers to offload (-1 = all).

func (*Embedder) Close

func (e *Embedder) Close() error

func (*Embedder) Dimensions

func (e *Embedder) Dimensions() int

func (*Embedder) Embed

func (e *Embedder) Embed(ctx context.Context, text string) ([]float32, error)

func (*Embedder) EmbedBatch

func (e *Embedder) EmbedBatch(ctx context.Context, texts []string) ([][]float32, error)

Jump to

Keyboard shortcuts

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