embedding

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package embedding provides text embedding capabilities using local GGUF models.

Index

Constants

View Source
const (
	// DefaultGPULayers is the default number of GPU layers (0 = CPU only).
	DefaultGPULayers = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Embedder

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

Embedder provides text embedding capabilities using llama.cpp via kelindar/search.

func New

func New(modelPath string, gpuLayers int) (*Embedder, error)

New creates a new Embedder with the given GGUF model file path. Set gpuLayers > 0 to enable GPU acceleration (requires Vulkan).

func (*Embedder) Close

func (e *Embedder) Close() error

Close releases resources held by the embedder.

func (*Embedder) Embed

func (e *Embedder) Embed(text string) ([]float32, error)

Embed returns the embedding vector for a single text string.

Jump to

Keyboard shortcuts

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