llamarunner

package
v0.0.0-...-e1ffba4 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(args []string) error

Types

type ErrReprocessInputs

type ErrReprocessInputs struct {
	Inputs []input
}

func (*ErrReprocessInputs) Error

func (e *ErrReprocessInputs) Error() string

type ImageContext

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

func NewImageContext

func NewImageContext(llamaContext *llama.Context, modelPath string) (*ImageContext, error)

func (*ImageContext) BatchSize

func (c *ImageContext) BatchSize(configuredBatchSize int) int

func (*ImageContext) EmbedSize

func (c *ImageContext) EmbedSize(llamaContext *llama.Context) int

func (*ImageContext) Free

func (c *ImageContext) Free(modelPath string)

func (*ImageContext) MultimodalTokenize

func (c *ImageContext) MultimodalTokenize(llamaContext *llama.Context, data []byte) ([]llama.MtmdChunk, error)

type InputCache

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

func NewInputCache

func NewInputCache(lc *llama.Context, kvSize int, numSlots int, multiUserCache bool) (*InputCache, error)

func (*InputCache) LoadCacheSlot

func (c *InputCache) LoadCacheSlot(prompt []input, cachePrompt bool) (*InputCacheSlot, []input, error)

func (*InputCache) ShiftCacheSlot

func (c *InputCache) ShiftCacheSlot(slot *InputCacheSlot, numKeep int) error

ShiftCacheSlot frees up space in the KV cache by deleting the oldest half of history and shifting the newest half into that space (saving numKeep inputs at the beginning).

Assumes that at least 1 entry can be freed up by shifting (i.e. numKeep < numCtx)

func (*InputCache) ShiftDiscard

func (c *InputCache) ShiftDiscard(inputLen int, numKeep int) int

type InputCacheSlot

type InputCacheSlot struct {
	// Index in the KV cache
	Id int

	// Inputs that are stored in the KV cache
	Inputs []input

	// is this cache actively being processed as part of a sequence?
	InUse bool
	// contains filtered or unexported fields
}

type NewSequenceParams

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

type Sequence

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

type Server

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

func (*Server) NewSequence

func (s *Server) NewSequence(prompt string, images []llm.ImageData, params NewSequenceParams) (*Sequence, error)

Jump to

Keyboard shortcuts

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