runner

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildArgs

func BuildArgs(rc *config.RunConfig) []string

BuildArgs converts a RunConfig into the argv slice for the appropriate backend binary. This is a pure function — both --dry-run and inspect use it.

The "ik_llama" backend is treated as a llama.cpp drop-in: it shares the llama-server CLI and reuses every flag buildLlamaArgs produces, then layers on the ik-only flags from cfg.IKLlama at the end. The fork is forgiving of unknown flags it has dropped from upstream, so we don't filter the base set; if a specific upstream flag becomes incompatible, gate it here.

func DeriveCLIBinary

func DeriveCLIBinary(serverBin, backend string) string

DeriveCLIBinary is the exported version for use in cmd/.

func FormatArgs

func FormatArgs(binaryPath string, rc *config.RunConfig) string

FormatArgs returns the BuildArgs result as a human-readable command string.

func FormatInteractiveArgs

func FormatInteractiveArgs(cliBin string, rc *config.RunConfig) string

FormatInteractiveArgs returns the llama-cli command as a human-readable string.

func WaitHealthy

func WaitHealthy(ctx context.Context, host string, port int, backend string) error

WaitHealthy polls the backend's health endpoint until it returns 200 or times out.

Types

type Runner

type Runner interface {
	Start(ctx context.Context, rc *config.RunConfig) (*state.ModelState, error)
	Stop(ctx context.Context, ms *state.ModelState, timeout time.Duration) error
	IsAlive(ms *state.ModelState) bool
}

Runner manages the llama-server process lifecycle.

func New

func New() Runner

New returns the default Runner implementation.

func NewInteractive

func NewInteractive() Runner

NewInteractive returns a runner that launches llama-cli in the foreground.

Jump to

Keyboard shortcuts

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