Skip to content

[Other] setup: --custom-gguf accepts any Inkling 2 Mini GGUF (e.g. IQ4_NL) - #254

Draft
okada-shogo wants to merge 5 commits into
simplexai-labs:mainfrom
okada-shogo:port/setup-custom-gguf-iq4
Draft

okada-shogo wants to merge 5 commits into
simplexai-labs:mainfrom
okada-shogo:port/setup-custom-gguf-iq4

Conversation

@okada-shogo

@okada-shogo okada-shogo commented Nov 23, 2026 •

Copy link
Copy Markdown

Stacked on #225 (--custom-gguf support for Unsloth's top-level layout needs #225's engine change). Until #225 merges, this diff also shows #225's commits; its own change is the last commit(s).

Problem and result

setup.py --custom-gguf refused every Inkling 2 Mini GGUF, including the ones setup itself downloads, because
tools/strata_inspect.py did not map Inkling's architectures to a family. A user with an IQ4_NL file had to hard-link
it under the published name Inkling-2-Mini-UD-Q4_K_XL.gguf and use --gguf-dir --model UD-Q4_K_XL instead.

File (general.architecture) Before After
Inkling-2-Mini-IQ4_NL.gguf (inkling2_loop) refused Inkling 2 Mini, size IQ4_NL (its own)
Inkling-2-Mini-UD-Q2_K_XL.gguf (inkling2, Unsloth top level) refused Inkling 2 Mini, size UD-Q2_K_XL
Inkling-2-Mini-UD-IQ3_XXS.gguf (inkling2) refused Inkling 2 Mini, size UD-IQ3_XXS (its own)
Inkling-2-Mini-UD-Q2_K_XL.loop.gguf (inkling2_loop) refused Inkling 2 Mini, size UD-Q2_K_XL
Inkling-2-Mini-Q2_K.gguf (inkling2_loop, test only) refused Inkling 2 Mini, size Q2_K (its own, not UD-Q2_K_XL)
Exact messages, before and after

Before (the top-level files say 'inkling2'):

PolyStrata: not Qwen3.8-Flash-Next (architecture 'inkling2_loop'): PolyStrata runs only that model

  [X]  cannot install this GGUF with --custom-gguf
       use --inspect to read the full explanation, or give it to --gguf-dir

After, Inkling-2-Mini-IQ4_NL.gguf:

  [!]  Inkling 2 Mini (architecture 'inkling2_loop'): your file's quant 'IQ4_NL' is not one setup offers (UD-Q2_K_XL, UD-Q3_K_XL, UD-Q4_K_XL): installed as its own size, IQ4_NL; the RAM and VRAM estimates are read from its header

After, Inkling-2-Mini-UD-Q2_K_XL.gguf (inkling2): no message, resolved to --family inkling --model UD-Q2_K_XL.

After, setup.py --inspect Inkling-2-Mini-IQ4_NL.gguf:

Strata: Inkling 2 Mini (architecture 'inkling2_loop'): PolyStrata runs it on the strata-poly engine; install it with setup's --custom-gguf <file> (a size setup does not offer becomes a size of its own)

Related discussion

none. Found while installing an IQ4_NL file on Windows. Needs #225 for the inkling2 files.

Approach

  • POLY_ARCHS in strata_inspect.py maps inkling2_loop and inkling2 (the architectures in setup's
    POLY_GGUF_ARCHS["inkling"] after [Engine] Inkling 2: read Unsloth's top-level inkling2 GGUF files #225) to "Inkling 2 Mini", so resolve_custom_gguf() reaches its "family" branch.
  • That branch picks the size from the file name's quant. With no match it used the first offered size (here
    UD-Q2_K_XL) and its estimates. For Inkling only (a "custom_sizes" flag in FAMILIES["inkling"]), the quant must
    equal a size's whole name (Q2_K is not UD-Q2_K_XL), a .loop before .gguf is skipped, and an unknown quant
    now becomes a size of its own: experts' bytes and file size from the header, VRAM beside the experts from the
    offered size with the closest expert bytes, ram_gb computed the same way as for the offered sizes. Other families
    keep the old behaviour.
  • --inspect points an Inkling file to --custom-gguf (--gguf-dir takes only the offered sizes' file names).
  • docs/models/inkling.md names --custom-gguf beside --gguf-dir.

Validation

Passed: (revision 74f7a5f on #225's head 42af77e; Linux, CPU only, Python 3.10)

  • cd terminal && python -m unittest over all tools/test_setup*.py: 1364 tests OK (1 skipped). New tests in
    tools/test_setup_custom_gguf.py: IQ4_NL as its own size, an offered name kept, Q2_K as its own size, .loop
    names, top-level inkling2 files taken, every architecture in POLY_GGUF_ARCHS["inkling"] mapped in POLY_ARCHS,
    --inspect naming --custom-gguf.
  • python -m unittest tools.test_strata_inspect: 7 OK. tests/terminal/test_own_files*.py: 34 OK.
  • python3 tools/check --only docs: 6 of 6.
  • resolve_custom_gguf() on the four real files in the table: the results shown there (and
    Inkling-2-Mini-UD-IQ3_XXS.loop.gguf: UD-IQ3_XXS, the same estimates as its top-level file). Estimates for IQ4_NL: 15.80 GB
    of experts, 3.7 GB VRAM beside them, 21 GB RAM; for UD-IQ3_XXS: 10.30, 3.6, 16.
  • setup.py --custom-gguf Inkling-2-Mini-IQ4_NL.gguf --check (RTX 2070 Super 8 GB, 63 GB RAM): "Inkling 2 Mini IQ4_NL:
    EXPERIMENTAL, fits by setup's estimate (~21 GB of RAM on this card)".
  • main() with --custom-gguf Inkling-2-Mini-IQ4_NL.gguf --yes --no-start --context 32768, stopped at step 3 (pip
    install mocked): step 2 shows "about 5 of its 16 GB of experts fit this card" and "size: IQ4_NL".

Failed: none observed.

Not run:

  • A full install and start (engine build, pack, chat) with these files: the steps after step 2 do not depend on the
    size name for a --custom-gguf file (no download, no SHA-256 check).
  • Windows and macOS.

Limits

  • A file name with no quant token gets the size name custom.
  • A custom size exists only while setup runs: a saved config of one is not mapped back to a size in a new run
    (model: None, so a new copy is not "set up like the last one"). A plain start uses the config as it is. Every
    --custom-gguf install already behaves like this.
  • On a Mac without the app, --custom-gguf is not applied (setup_mac.py does not read it), as before.

🤖 Generated with Claude Code

okada-shogo and others added 2 commits November 23, 2026 05:42
Unsloth's files at the top of unsloth/Inkling-2-Mini-GGUF (UD-Q2_K_XL,
UD-IQ3_XXS, ...) say general.architecture inkling2.  They are the same
weights as the Mainline_Support inkling2_loop files under other names:
block_count counts the 48 applications, the loop's keys are num_loops /
loop.core_start / loop.core_end, the controllers are loop_{attn,k,v,mlp}_*
(attn = q, mlp = ffn), and the message queries are two global tensors,
loop_res_query and loop_kv_res_query (core layer 6+i: q = res[2i],
k = kv[2i], v = kv[2i+1], ffn = res[2i+1]).  Open() refused them.

Inkling2 now takes them: n_layer_ is block_count less the core's later
passes, meta_alias()/tensor_alias() give the other names (only for an
inkling2 file), each application's sliding_window_pattern entry is
checked against its layer, and msg_query() puts the four rows of a core
layer in the dense arena.  inkling2_loop files run the same code as
before.  Setup's --gguf-dir and serve's registry take the architecture.

The mapping is the one our first engine (simplexai-labs#200) used, by bytes against
ggml-org's inkling2_loop file.  Engine by VecSzn; files by Unsloth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An Unsloth file's attention.sliding_window_pattern lists the 48
applications, not the 24 layers, but swa_[il] read entry il: for layers
18 to 23 that is an application of the loop's layers 6 to 11.  It was
right only because the pattern's period (6) divides the loop's length
(12); with another pattern the check below would refuse a valid file.
Read visit_of(il, 0) instead.  The same values for the published files
(period 6), so the same bits.

Found by an independent review of the PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@okada-shogo
okada-shogo force-pushed the port/setup-custom-gguf-iq4 branch from 5b217ef to e1c5ceb Compare November 23, 2026 04:20
@okada-shogo
okada-shogo marked this pull request as draft November 23, 2026 04:22
okada-shogo and others added 3 commits November 23, 2026 13:23
The table's strata-poly rows are made from setup.py's POLY_GGUF_ARCHS
(tools/strata_inspect.py --poly-rows), which now takes inkling2 too;
tests/terminal/test_own_files_poly.py compares the two.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
strata_inspect's POLY_ARCHS had no Inkling architecture, so its verdict
for every Inkling 2 Mini file was "not Qwen3.8-Flash-Next" and
resolve_custom_gguf refused it. With the architecture mapped, a quant
setup does not offer would still have been taken for the first offered
size (UD-Q2_K_XL).

- POLY_ARCHS maps inkling2_loop and inkling2 (Unsloth's top-level
  layout, read by the engine since the previous commits) to
  "Inkling 2 Mini".
- FAMILIES["inkling"] has "custom_sizes": a file of another quant
  (IQ4_NL, Q4_K_M, ...) becomes a size of its own, its experts' bytes
  and file size read from the header (custom_size()).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the review of simplexai-labs#254:
- For a family with custom_sizes the quant must equal a size's name:
  Q2_K was taken for UD-Q2_K_XL (its letters are inside that name),
  with that size's estimates instead of the file's own.
- A ".loop" before ".gguf" (a file rewritten to inkling2_loop) is
  skipped when the quant is read: ...UD-Q2_K_XL.loop.gguf is UD-Q2_K_XL,
  not a size called "custom".
- --inspect points an Inkling file to --custom-gguf, not --gguf-dir
  (which takes only the offered sizes' file names).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@okada-shogo
okada-shogo force-pushed the port/setup-custom-gguf-iq4 branch from e1c5ceb to 74f7a5f Compare November 23, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant