models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadModel

func DownloadModel(url string, filename string, progressChan chan<- DownloadStatus) (string, error)

DownloadModel fetches a GGUF file from a URL. progressChan is used to send updates back to the UI.

Types

type DownloadStatus

type DownloadStatus struct {
	ModelName   string
	TotalBytes  int64
	Downloaded  int64
	Progress    float64
	IsCompleted bool
	Error       string
}

NOTE: This is the primary and only definition for DownloadStatus in this package. Any other definition (e.g., in manifest.go) must be removed to fix the "redeclared" compiler error. DownloadStatus represents the download progress and is sent through a channel.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) Download

func (m *Manager) Download(url string, name string) (<-chan DownloadStatus, error)

func (*Manager) List

func (m *Manager) List() ([]ModelInfo, error)

type ModelInfo

type ModelInfo struct {
	ID          string    `json:"id"`          // Unique identifier (usually filename)
	Name        string    `json:"name"`        // Display name
	Filename    string    `json:"filename"`    // Actual file name on disk
	FilePath    string    `json:"filepath"`    // Full absolute path
	Size        int64     `json:"size"`        // File size in bytes
	Modified    time.Time `json:"modified"`    // Last modified date
	IsDownloads bool      `json:"is_download"` // True if currently downloading
}

ModelInfo represents a local BitNet model file

func ScanModels

func ScanModels() ([]ModelInfo, error)

ScanModels looks for .gguf files in the models directory

type WriteCounter

type WriteCounter struct {
	Total      int64
	Downloaded int64
	OnProgress func(int64, int64) // callback
}

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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