recommend

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFeedback

func ApplyFeedback(recs []Recommendation, feedback map[string]Feedback)

func DefaultQuery

func DefaultQuery(task string) string

func FeedbackFromHistory

func FeedbackFromHistory(st *state.DB, task, query, hardwareKey string) (map[string]Feedback, error)

func FeedbackKey

func FeedbackKey(uri string) string

func FormatBytes

func FormatBytes(n int64) string

func HardwareKey

func HardwareKey(hw HardwareProfile) string

func MemoryBudgetBytes

func MemoryBudgetBytes(hw HardwareProfile) int64

func NormalizeTask

func NormalizeTask(task string) string

func Recommend

func Recommend(ctx context.Context, opts Options) ([]Recommendation, HardwareProfile, error)

func RecordHistory

func RecordHistory(st *state.DB, task, query, hardwareKey string, recs []Recommendation, action string, selectedIndex int) error

func RoundedGiB

func RoundedGiB(bytes int64) int64

Types

type Feedback

type Feedback struct {
	Selected int
	Skipped  int
	Shown    int
}

type HardwareProfile

type HardwareProfile struct {
	OS            string `json:"os"`
	Arch          string `json:"arch"`
	CPU           string `json:"cpu,omitempty"`
	RAMBytes      int64  `json:"ram_bytes,omitempty"`
	VRAMBytes     int64  `json:"vram_bytes,omitempty"`
	UnifiedMemory bool   `json:"unified_memory,omitempty"`
	Source        string `json:"source,omitempty"`
}

func DetectHardware

func DetectHardware(ctx context.Context) HardwareProfile

type Options

type Options struct {
	Query    string
	Task     string
	Provider string
	Limit    int
	Hardware HardwareProfile
	Feedback map[string]Feedback
}

type Recommendation

type Recommendation struct {
	Index             int              `json:"index"`
	Provider          string           `json:"provider"`
	ModelID           string           `json:"model_id"`
	Name              string           `json:"name"`
	URI               string           `json:"uri"`
	FileName          string           `json:"file_name,omitempty"`
	FileType          string           `json:"file_type,omitempty"`
	Size              int64            `json:"size,omitempty"`
	Downloads         int64            `json:"downloads,omitempty"`
	Likes             int64            `json:"likes,omitempty"`
	Score             int              `json:"score"`
	Fit               string           `json:"fit"`
	EstimatedRequired int64            `json:"estimated_required_bytes,omitempty"`
	MemoryBudget      int64            `json:"memory_budget_bytes,omitempty"`
	ParameterCount    string           `json:"parameter_count,omitempty"`
	Quantization      string           `json:"quantization,omitempty"`
	RuntimeHints      []RuntimeHint    `json:"runtime_hints,omitempty"`
	Reasons           []string         `json:"reasons,omitempty"`
	DownloadCommand   string           `json:"download_command"`
	Raw               discovery.Result `json:"raw,omitempty"`
}

func Rank

func Rank(results []discovery.Result, hw HardwareProfile, task string) []Recommendation

type RuntimeHint

type RuntimeHint struct {
	Runtime         string `json:"runtime"`
	Reason          string `json:"reason"`
	PlacementPreset string `json:"placement_preset,omitempty"`
	SetupCommand    string `json:"setup_command,omitempty"`
}

Jump to

Keyboard shortcuts

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