Documentation
¶
Index ¶
- func ApplyFeedback(recs []Recommendation, feedback map[string]Feedback)
- func DefaultQuery(task string) string
- func FeedbackFromHistory(st *state.DB, task, query, hardwareKey string) (map[string]Feedback, error)
- func FeedbackKey(uri string) string
- func FormatBytes(n int64) string
- func HardwareKey(hw HardwareProfile) string
- func MemoryBudgetBytes(hw HardwareProfile) int64
- func NormalizeTask(task string) string
- func Recommend(ctx context.Context, opts Options) ([]Recommendation, HardwareProfile, error)
- func RecordHistory(st *state.DB, task, query, hardwareKey string, recs []Recommendation, ...) error
- func RoundedGiB(bytes int64) int64
- type Feedback
- type HardwareProfile
- type Options
- type Recommendation
- type RuntimeHint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyFeedback ¶
func ApplyFeedback(recs []Recommendation, feedback map[string]Feedback)
func DefaultQuery ¶
func FeedbackFromHistory ¶
func FeedbackKey ¶
func FormatBytes ¶
func HardwareKey ¶
func HardwareKey(hw HardwareProfile) string
func MemoryBudgetBytes ¶
func MemoryBudgetBytes(hw HardwareProfile) int64
func NormalizeTask ¶
func Recommend ¶
func Recommend(ctx context.Context, opts Options) ([]Recommendation, HardwareProfile, error)
func RecordHistory ¶
func RoundedGiB ¶
Types ¶
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 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
Click to show internal directories.
Click to hide internal directories.