server

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Host string
	Port string

	Vocab *ml.Vocab
	Model *llama.Model

	Ctx    *llama.Context
	Params *llama.ModelParams

	MaxPods     int64
	RunningPods int64 // number of pods running right now in parallel

	// TODO: Background watcher which will make waiting jobs obsolete after some deadline
	Jobs  map[string]*Job     // all seen jobs in any state
	Queue map[string]struct{} // queue of job IDs waiting for start
)

Functions

func Colorize

func Colorize(format string, opts ...interface{}) (n int, err error)

Colorize is a wrapper for colorstring.Color() and fmt.Fprintf() Join colorstring and go-colorable to allow colors both on Mac and Windows TODO: Implement as a small library

func Do

func Do(jobID string)

func Engine

func Engine()

func GetJob

func GetJob(ctx *fiber.Ctx) error

func GetStatus

func GetStatus(ctx *fiber.Ctx) error

func NewJob

func NewJob(ctx *fiber.Ctx) error

func PlaceJob

func PlaceJob(jobID, prompt string)

func Run

func Run()

Types

type Job

type Job struct {
	ID         string
	Status     string
	Prompt     string
	Output     string
	CreatedAt  int64
	StartedAt  int64
	FinishedAt int64
}

Jump to

Keyboard shortcuts

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