okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-clean-3 (321794636): docs and history (cleanup step 3, items 3.0-3.10); release manifest and capability table with checks, history/ with pointers, link check, tools/ split, bench index; owner OK'd the wording 11-082b36e8a02

main
4.2 KiB72 linesraw

Local GGUF import — 14 October 2026

User flow

Models → Version → Use a local model… opens a local file browser. It starts in the configured model directory, offers Home / Up a folder, and lets users paste a full folder or file path. It lists folders and GGUF files; no upload, copy, remote request, or weight download is involved.

Users choose the GGUF file. For standard split GGUFs, choosing any shard resolves the first shard and checks the full set in its directory. The review shows the name, declared architecture, quantization, total size, context limit, and file locations. Use this model saves a reference and selects it; Load model is still an explicit separate action. Normal mode retains one-model semantics.

Local entries appear in the Version dropdown and under Local models in the family switcher. Names can be edited during review. They do not inherit a catalog family's identity, accuracy claims, measured speeds, or optimization approval. Generic tuning uses their own GGUF geometry. New local selections begin at up to 32K, limited by the file's declared context and the app's supported presets.

Host integration

  • server/gguf.mjs reads bounded GGUF v2/v3 little-endian metadata and tensor directories. It skips tokenizer array contents and tensor weights, checks metadata/tensor bounds and expected tensor payload extents, and rejects truncated files, unsupported encodings, duplicate keys, and invalid geometry.
  • server/local-models.mjs validates text architectures, tokenizer presence, context, layers and attention geometry; validates split numbering/counts and aggregate tensor counts; and persists references atomically in <dataDir>/local-models.json. IDs come from the canonical first-file path.
  • Supported import metadata: qwen2, qwen2moe, qwen3, qwen3moe, qwen3next, qwen35, qwen35moe, llama, gemma, gemma2, gemma3 and phi3. This is the importer's scope, not a claim about the installed engine build. Engine support is checked at load.
  • Browse: GET /api/local-models/browse?directory=…; inspect: POST /api/local-models/inspect {path}; register: POST /api/local-models {path,name?}. Registration reinspects the file rather than trusting renderer metadata, and cannot replace an active reference whose file signature changed.
  • The model catalog and normal loader resolve imported IDs to the exact local first-file path. llama.cpp handles the remaining standard shards. File size, modification time and change time guard stale references; a moved/changed file requires reconnecting through Use a local model…. Canonical paths dedupe.
  • Default model-directory changes preserve these explicit local references.
  • Removing a local model removes its reference only. Original weights and other folder files stay intact. Every loaded instance must be unloaded first.

The file declares its architecture; metadata does not prove model provenance or that it is an authentic fine-tune of a named catalog model. Tensor geometry checks are structural, not a cryptographic integrity check. Hybrid/recurrent working memory remains approximate; actual allocation and adapter compatibility need the native engine. LoRA adapters, projectors, image models, unsupported architectures, big-endian GGUFs, and nonstandard shard filenames get a clear error.

Sources

Verification

Focused parser/service/API tests cover single/split files, missing and mismatched shards, truncated tensor payloads, unknown architectures, invalid context, malformed metadata bounds, folder filtering, persistence, path deduplication, missing-file detection, explicit loading, active-reference protection, native path resolution, directory changes and preserving files on removal.

Browser flow uses a disposable simulated host and tiny GGUF fixtures. No real inference weights were imported into the live library or executed. The live host remains on its original one-model setup. Evidence: docs/evidence/local-model-import-2026-10-14/.

1# Local GGUF import — 14 October 2026
2
3## User flow
4
5Models → Version → **Use a local model…** opens a local file browser. It starts
6in the configured model directory, offers Home / Up a folder, and lets users
7paste a full folder or file path. It lists folders and GGUF files; no upload,
8copy, remote request, or weight download is involved.
9
10Users choose the GGUF file. For standard split GGUFs, choosing any shard resolves
11the first shard and checks the full set in its directory. The review shows the
12name, declared architecture, quantization, total size, context limit, and file
13locations. **Use this model** saves a reference and selects it; **Load model**
14is still an explicit separate action. Normal mode retains one-model semantics.
15
16Local entries appear in the Version dropdown and under **Local models** in the
17family switcher. Names can be edited during review. They do not inherit a catalog
18family's identity, accuracy claims, measured speeds, or optimization approval.
19Generic tuning uses their own GGUF geometry. New local selections begin at up
20to 32K, limited by the file's declared context and the app's supported presets.
21
22## Host integration
23
24- `server/gguf.mjs` reads bounded GGUF v2/v3 little-endian metadata and tensor
25  directories. It skips tokenizer array contents and tensor weights, checks
26  metadata/tensor bounds and expected tensor payload extents, and rejects
27  truncated files, unsupported encodings, duplicate keys, and invalid geometry.
28- `server/local-models.mjs` validates text architectures, tokenizer presence,
29  context, layers and attention geometry; validates split numbering/counts and
30  aggregate tensor counts; and persists references atomically in
31  `<dataDir>/local-models.json`. IDs come from the canonical first-file path.
32- Supported import metadata: qwen2, qwen2moe, qwen3, qwen3moe, qwen3next, qwen35,
33  qwen35moe, llama, gemma, gemma2, gemma3 and phi3. This is the importer's scope,
34  not a claim about the installed engine build. Engine support is checked at load.
35- Browse: `GET /api/local-models/browse?directory=…`; inspect:
36  `POST /api/local-models/inspect {path}`; register:
37  `POST /api/local-models {path,name?}`. Registration reinspects the file rather
38  than trusting renderer metadata, and cannot replace an active reference whose
39  file signature changed.
40- The model catalog and normal loader resolve imported IDs to the exact local
41  first-file path. llama.cpp handles the remaining standard shards. File size,
42  modification time and change time guard stale references; a moved/changed file
43  requires reconnecting through **Use a local model…**. Canonical paths dedupe.
44- Default model-directory changes preserve these explicit local references.
45- Removing a local model removes its reference only. Original weights and other
46  folder files stay intact. Every loaded instance must be unloaded first.
47
48The file declares its architecture; metadata does not prove model provenance or
49that it is an authentic fine-tune of a named catalog model. Tensor geometry checks
50are structural, not a cryptographic integrity check. Hybrid/recurrent working
51memory remains approximate; actual allocation and adapter compatibility need the
52native engine. LoRA adapters, projectors, image models, unsupported architectures,
53big-endian GGUFs, and nonstandard shard filenames get a clear error.
54
55## Sources
56
57- [GGUF specification](https://github.com/ggml-org/ggml/blob/master/docs/gguf.md)
58- [GGUF metadata and quantization constants](https://github.com/ggml-org/llama.cpp/blob/master/gguf-py/gguf/constants.py)
59- [llama.cpp split-file behavior](https://github.com/ggml-org/llama.cpp/blob/master/tools/gguf-split/gguf-split.cpp)
60
61## Verification
62
63Focused parser/service/API tests cover single/split files, missing and mismatched
64shards, truncated tensor payloads, unknown architectures, invalid context,
65malformed metadata bounds, folder filtering, persistence, path deduplication,
66missing-file detection, explicit loading, active-reference protection, native
67path resolution, directory changes and preserving files on removal.
68
69Browser flow uses a disposable simulated host and tiny GGUF fixtures. No real
70inference weights were imported into the live library or executed. The live
71host remains on its original one-model setup. Evidence:
72`docs/evidence/local-model-import-2026-10-14/`.