server

package
v0.0.0-...-0e1d3c2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 12 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 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