client

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package client provides client-side model creation for safetensors-based models.

This package is in x/ because the safetensors model storage format is under development. It also exists to break an import cycle: server imports x/create, so x/create cannot import server. This sub-package can import server because server doesn't import it.

Index

Constants

View Source
const MinOllamaVersion = "0.14.0"

MinOllamaVersion is the minimum Ollama version required for safetensors models.

Variables

This section is empty.

Functions

func CreateModel

func CreateModel(opts CreateOptions, p *progress.Progress) error

CreateModel imports a model from a local directory. This creates blobs and manifest directly on disk, bypassing the HTTP API. Automatically detects model type (safetensors LLM vs image gen) and routes accordingly.

func QuantizeSupported

func QuantizeSupported() bool

QuantizeSupported returns true if quantization is supported (MLX library available)

Types

type CreateOptions

type CreateOptions struct {
	ModelName string
	ModelDir  string
	Quantize  string           // "int4", "int8", "nvfp4", or "mxfp8" for quantization
	Modelfile *ModelfileConfig // template/system/license/parser/renderer/parameters from Modelfile
}

CreateOptions holds all options for model creation.

type ModelfileConfig

type ModelfileConfig struct {
	Template   string
	System     string
	License    string
	Parser     string
	Renderer   string
	Parameters map[string]any
}

ModelfileConfig holds configuration extracted from a Modelfile.

func ConfigFromModelfile added in v0.18.0

func ConfigFromModelfile(modelfile *parser.Modelfile) (string, *ModelfileConfig, error)

ConfigFromModelfile extracts the model directory and x/create-specific Modelfile configuration from a parsed Modelfile.

Jump to

Keyboard shortcuts

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