Welvet examples

39. model/hf — snapshots

Open original example ↗Recorded results · not a live execution

Part: VI · Model IO
Package: github.com/openfluke/welvet/model/hf
Status: ok — ✅

When

Checkpoints, HF import, tokenize, sample, or decode (model/hf).

Where

import "github.com/openfluke/welvet/model/hf"

cd 39-hf && source ../env.sh && go run .

Why

Import starts with probing HF/MLX layouts before packing ENTITY.

What

InspectSnapshot, DetectArchitecture, safetensors/MLX loaders, Qwen3.5 hybrid helpers.

Sample output (captured)

hf: config.json: stat /path/to/hf-snapshot/config.json: no such file or directory

Live capture from go run ./cmd/runall on local ../../welvet (exit 0).

Source

Copied from the Welvet feature book examples (openfluke.github.io/welvet/examples/39-hf).

main.go

Download source ↓
package main

import (
	"fmt"

	"github.com/openfluke/welvet/model/hf"
)

func main() {
	info, err := hf.InspectSnapshot("/path/to/hf-snapshot")
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(info)
}