Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CivitaiBaseForTest ¶
func CivitaiBaseForTest() string
CivitaiBaseForTest returns the current base for tests.
func ClearCache ¶
ClearCache removes all resolver cache entries.
func SetCivitaiBaseForTest ¶
func SetCivitaiBaseForTest(u string)
SetCivitaiBaseForTest overrides the base URL for CivitAI API (tests only).
Types ¶
type HuggingFace ¶
type HuggingFace struct{}
func (*HuggingFace) CanHandle ¶
func (h *HuggingFace) CanHandle(u string) bool
Accepts URIs of the form:
hf://{owner}/{repo}/{path}?rev=main&quant={quantization}
If rev is omitted, defaults to "main". If quant is specified, selects that specific quantization variant. If path points to a directory or is omitted, will list and detect quantizations.
type Quantization ¶ added in v0.6.1
type Quantization struct {
Name string // Detected quantization (e.g., "Q4_K_M", "fp16", "Q5_0")
FilePath string // Path in repository
Size int64 // File size in bytes
FileType string // File extension type (e.g., "gguf", "safetensors", "bin")
}
Quantization represents a specific quantization variant of a model file.
type Resolved ¶
type Resolved struct {
URL string
Headers map[string]string
// Optional metadata (primarily for CivitAI) — may be empty for other resolvers
ModelName string
VersionName string
VersionID string
FileName string
FileType string // Source-specific type (e.g., CivitAI file.type: Model|VAE|TextualInversion)
SuggestedFilename string
// Optional metadata for Hugging Face
RepoOwner string
RepoName string
RepoPath string
Rev string
// Quantization support (HuggingFace)
AvailableQuantizations []Quantization // List of detected quantization variants
SelectedQuantization string // Which quantization was selected (if any)
}
Click to show internal directories.
Click to hide internal directories.