Documentation
¶
Index ¶
Constants ¶
const ConfigurationLlamaCpp = ``
ConfigurationLlamaCpp is the sandbox configuration for llama.cpp processes.
const ConfigurationPython = ``
ConfigurationPython is the sandbox configuration for Python-based inference backends. On non-Darwin platforms no sandboxing is applied.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sandbox ¶
type Sandbox interface {
// Command returns the sandboxed process handle.
Command() *exec.Cmd
// Close closes the sandbox, terminating the process if it's still running.
Close() error
}
Sandbox encapsulates a single running sandboxed process.
func Create ¶
func Create(ctx context.Context, configuration string, modifier func(*exec.Cmd), updatedBinPath, name string, arg ...string) (Sandbox, error)
Create creates a sandbox containing a single process that has been started. The ctx, name, and arg arguments correspond to their counterparts in os/exec.CommandContext. The configuration argument specifies the sandbox configuration, for which a pre-defined value should be used. The modifier function allows for an optional callback (which may be nil) to configure the command before it is started.