Documentation
¶
Overview ¶
Package compatmigrate converts older Ollama-format GGUF manifests already present in a local model store into llama.cpp-compatible manifest-list children.
This exists to bridge the llama-server transition without forcing users to re-pull large models they already have on disk. The first load can still use the temporary llama.cpp compatibility patch, while a best-effort background migration materializes a clean llamacpp child for later loads.
Once manifest-list publishing has been live for enough releases and stale legacy-only local stores are no longer a practical concern, this code should be removed and users with unmigrated local artifacts should re-pull.
Index ¶
- func EnsureLocalCompatibilityMigration(name model.Name) (bool, error)
- func RewriteLlama3MetadataLayer(layer manifest.Layer) (manifest.Layer, bool, error)
- func RunnerForManifest(source model.Name, mf *manifest.Manifest) (string, error)
- func SetMigratorsForTesting(migrators map[string][]Migrator) func()
- func StartLocalCompatibilityMigration(name model.Name) bool
- type Migrator
- type Result
- type SourceModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RewriteLlama3MetadataLayer ¶
RewriteLlama3MetadataLayer rewrites a GGUF layer with the legacy Llama 3 tokenizer metadata gap.
func RunnerForManifest ¶
RunnerForManifest reports the runner a GGUF manifest should carry: ggml when a compatibility detector fires, llamacpp otherwise. It reads GGUF headers only, so it is cheap enough to run whenever a manifest is written.
func SetMigratorsForTesting ¶
SetMigratorsForTesting replaces the migration registry for tests.
Types ¶
type Migrator ¶
type Migrator interface {
NeedsMigration(*SourceModel) bool
Migrate(*SourceModel) (*Result, error)
}
type SourceModel ¶
type SourceModel struct {
Source model.Name
Manifest *manifest.Manifest
Config model.ConfigV2
GGUFPath string
GGUF *gguf.File
GGUFData io.ReaderAt
GGUFDataOffset int64
ProjectorPath string
ProjectorGGUF *gguf.File
ProjectorData io.ReaderAt
ProjectorDataOffset int64
}
func (*SourceModel) Close ¶
func (src *SourceModel) Close() error
Source Files
¶
- bakllava.go
- deepseek_ocr.go
- disk_unix.go
- embeddinggemma.go
- gemma3.go
- gemma3n.go
- gemma4.go
- glm47_flash.go
- glm_ocr.go
- gptoss.go
- laguna.go
- lfm25_thinking.go
- llama3.go
- llama4.go
- manifest.go
- migrate.go
- mistral_pixtral.go
- nemotron3.go
- nemotron_h_moe.go
- olmo3.go
- qwen25vl.go
- qwen35.go
- qwen3next.go
- qwen3vl.go
- snowflake_arctic_embed2.go
- source_model.go
- source_tensor.go
- tensor_layout.go
- tensor_ops.go
- tensor_row.go
- writer.go