modelregistry

package
v0.32.2 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("model not found in registry")

Functions

This section is empty.

Types

type ModelDescriptor

type ModelDescriptor struct {
	ID        string `json:"id,omitempty" example:"m1a2b3c4-d5e6-f7g8-h9i0-j1k2l3m4n5o6"`
	Name      string `json:"name" example:"qwen2.5-1.5b"`
	SourceURL string `json:"sourceUrl" example:"https://huggingface.co/Qwen/..."`
	SizeBytes int64  `json:"sizeBytes" example:"934000000"`
	Curated   bool   `json:"curated" example:"true"`
	// Backend is the local backend this model targets: "" or "llama" for GGUF,
	// "openvino" for an OpenVINO IR model. It selects the models/<backend>/
	// directory and the pull strategy (single GGUF file vs multi-file IR repo).
	Backend string `json:"backend,omitempty" example:"openvino"`
	// Repo is the Hugging Face repo id for multi-file pulls (OpenVINO IR). For
	// GGUF models SourceURL points at the single file and Repo is empty.
	Repo string `json:"repo,omitempty" example:"OpenVINO/Qwen2.5-Coder-0.5B-Instruct-int4-ov"`
	// ToolProtocol is the model-native tool-call output protocol (e.g. "qwen").
	// Set for curated models certified for tool calls; `model pull` writes it into
	// the model's profile so the local provider enables tool calls out of the box.
	ToolProtocol string `json:"toolProtocol,omitempty" example:"qwen"`
}

func (ModelDescriptor) BackendType added in v0.32.2

func (d ModelDescriptor) BackendType() string

BackendType returns the local backend this model targets, defaulting empty to "llama" (the historical GGUF default).

type Registry

type Registry interface {
	// Resolve returns the descriptor for name from curated or user-added entries.
	Resolve(ctx context.Context, name string) (*ModelDescriptor, error)
	// List returns all known descriptors (curated + user-added). User entries override curated SourceURL.
	List(ctx context.Context) ([]ModelDescriptor, error)
	// OptimalFor returns the best registry name for an arbitrary model name string.
	// Exact match → family mapping → fallback.
	OptimalFor(ctx context.Context, modelName string) (string, error)
}

Jump to

Keyboard shortcuts

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