Documentation
¶
Index ¶
- func EstimateParamCount(fileSize int64, quant model.QuantType) int64
- func EstimateSafeTensorsBytes(meta *model.SafeTensorsMetadata) int64
- func EstimateVRAM(info *model.ModelInfo) float64
- func FormatParamCount(params int64) string
- func IsGGUF(filePath string) bool
- func MetadataKeysByPrefix(raw map[string]any, prefix string) []string
- func ParseGGUF(filePath string) (*model.GGUFMetadata, error)
- func ParseSafeTensors(filePath string) (*model.SafeTensorsMetadata, error)
- type AppDefinition
- type ContextVRAM
- type DiscoveredFile
- type OllamaLayer
- type OllamaManifest
- type ScanError
- type ScanOptions
- type ScanResult
- type Scanner
- type VRAMTableRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EstimateParamCount ¶
EstimateParamCount estimates parameter count from file size and quantization.
func EstimateSafeTensorsBytes ¶
func EstimateSafeTensorsBytes(meta *model.SafeTensorsMetadata) int64
EstimateSafeTensorsBytes estimates total tensor data size from metadata.
func EstimateVRAM ¶
EstimateVRAM estimates the VRAM required for inference in GB.
func FormatParamCount ¶
FormatParamCount formats a parameter count as "7B", "1.5B", "70B", etc.
func MetadataKeysByPrefix ¶
MetadataKeysByPrefix returns all raw metadata keys matching a prefix.
func ParseGGUF ¶
func ParseGGUF(filePath string) (*model.GGUFMetadata, error)
ParseGGUF reads a GGUF file header and metadata without reading tensor data.
func ParseSafeTensors ¶
func ParseSafeTensors(filePath string) (*model.SafeTensorsMetadata, error)
ParseSafeTensors reads a SafeTensors file header and returns metadata.
Types ¶
type AppDefinition ¶
type AppDefinition struct {
Name model.SourceApp
SearchPaths func(homeDir string) []string
FilePatterns []string
// ManifestBased means we discover models through manifests (Ollama).
ManifestBased bool
}
AppDefinition describes how to find models for a specific AI application.
func KnownApps ¶
func KnownApps() []AppDefinition
KnownApps returns definitions for all supported AI applications.
type ContextVRAM ¶
ContextVRAM holds VRAM estimates for a specific context length.
type DiscoveredFile ¶
DiscoveredFile represents a raw found file before parsing.
func DiscoverOllamaModels ¶
func DiscoverOllamaModels(baseDir string) ([]DiscoveredFile, error)
DiscoverOllamaModels discovers models by reading Ollama manifests.
type OllamaLayer ¶
type OllamaLayer struct {
MediaType string `json:"mediaType"`
Digest string `json:"digest"`
Size int64 `json:"size"`
}
OllamaLayer represents a layer in an Ollama manifest.
type OllamaManifest ¶
type OllamaManifest struct {
SchemaVersion int `json:"schemaVersion"`
MediaType string `json:"mediaType"`
Config OllamaLayer `json:"config"`
Layers []OllamaLayer `json:"layers"`
}
OllamaManifest represents the Ollama manifest JSON structure.
type ScanOptions ¶
type ScanOptions struct {
ExtraPaths []string
SkipApps []model.SourceApp
Concurrency int
ProgressFunc func(scanned, total int, current string)
}
ScanOptions configures the scanner.
type ScanResult ¶
type ScanResult struct {
Models []model.ModelInfo
Errors []ScanError
Duration time.Duration
AppsFound map[model.SourceApp]int
}
ScanResult holds the complete scan output.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner performs model discovery and parsing.
func (*Scanner) Scan ¶
func (s *Scanner) Scan() (*ScanResult, error)
Scan performs the full discovery and parsing pipeline.
type VRAMTableRow ¶
type VRAMTableRow struct {
Quant string
BPW float64
ContextVRAM []ContextVRAM
}
VRAMTableRow represents one row of the VRAM estimation table.
func VRAMContextTable ¶
func VRAMContextTable(info *model.ModelInfo) []VRAMTableRow
VRAMContextTable generates a VRAM estimation table for different context sizes, similar to the screenshot reference. Returns rows of [quant, BPW, ctx2k, ctx8k, ...].