Instructions to run Inkling 2 Mini.

#2
by danielhanchen - opened

Hey guys, you can now run the model locally via Unsloth Desktop: https://github.com/unslothai/llama.cpp/releases/tag/b12588-mix-c0c3de8

Update 4:30PM PST time: Context for Inkling should now be properly detected in Unsloth!
You can now load the model with proper contexts. Please update to the latest version.

We also updated unsloth desktop with less memory usage and more speed!

Here's a short snippet of Blender + MCP + Unsloth + 4-bit Inkling Mini:

inkling mini in unsloth

β€’
This comment has been hidden (marked as Resolved)

latest llama.cpp can not load this model and raise errors. which version did you use?

0.00.283.155 E llama_model_load: error loading model: unknown model architecture: 'inkling2'
0.00.283.164 E llama_model_load_from_file_impl: failed to load model
0.00.283.167 E cmn common_init_: failed to load model 'Inkling-2-Mini-UD-IQ3_XXS.gguf'
0.00.283.169 E srv load_model: failed to load model, 'Inkling-2-Mini-UD-IQ3_XXS.gguf'
0.00.283.172 I srv operator(): operator(): cleaning up before exit...
0.00.289.575 E srv llama_server: exiting due to model loading error

Doesn't work for me either on the latest unsloth studio and latest llama nightly

support hasn't been merged yet, a few open PRs to I think, so should come soon

Will be up in a few mins sorry guys, the compiling took MUCH longer than we expected

Binaries are now up! Please update your llama.cpp runtimes. Sorry guys for the delays

Edit: It should be fully fixed, ensure you're using the latest unsloth version

CC: @coder543 @hellminster @hojnikb @rinoa @GiusTex @zhibo7 @MadMike477 @Linukso1D

Using 132k context at Q_K_XL with Q_8 cache, it will only run on a single 5090 if I offload most of the expert weights to system ram. If I put Unsloth in manual and force it to load to GPU, it will fail. Putting Unsloth on Auto, it will fit it into memory and I get the following results:

Inkling-2-Mini-GGUF loaded
All 49 layers are on the GPU. The expert weights of 47 layers are on the CPU. Model weights: 1.8 GiB on the GPU, 15 GiB on the CPU.

This will run but it's not usable.

Hey, thanks for the GGUFs! Got Inkling-2-Mini UD-Q8_K_XL running on 2Γ— RTX 3090 with your b12568-mix-8eebad4 prebuild. I hit two memory issues along the way, sharing in case it helps:

  1. Layer split with the looped layers puts almost all weights on GPU 0. With --split-mode layer and no --tensor-split, CUDA0 got 20029 MiB of weights and CUDA1 got just 884 MiB (basically the output layer). Meanwhile the KV cache was split evenly, 2176 MiB per card. My guess is the split is computed over the 48 layer visits, while weights only exist for 24 physical layers. --tensor-split 1,3 works around it (7.8 / 13.1 GiB).
  2. Huge compute buffer at long context. At -c 262144 with q8_0 KV and FA on, the compute buffer on one card was ~26 GiB at the default -ub 512 (and ~42 GiB with pipeline parallelism). At -ub 128 it's still ~6.9 GiB per card. Looks like the dense relative-bias thing from your PR #385. Would be great to get #385 into the next prebuild. Also, #386 says quantized K/V stays on the dense path. Any chance the banded path will support q8_0 KV?

With -ub 128 + --tensor-split 1,3 it loads and the answers look sane. Decode is ~25 t/s on a short prompt, which feels slow for 3.4B active. Not sure if that's expected for the looped arch or if it's the dense bias over the full cache. Happy to help with testing if needed.

shimmyshimmer pinned discussion
shimmyshimmer changed discussion title from Run Inkling 2 Mini via Unsloth Desktop! to Instructions to run Inkling 2 Mini.

I compiled it from source and just got this
image

This is what my garbage free cloud clanker said:

Root cause
The failure is not the looped-layers part of PR 32695. It is a second, separate patch that is missing from this branch:
done_getting_tensors: wrong number of tensors; expected 734, got 714
The GGUF itself is fine: it has 734 tensors. The loader only requests 714. The 20 skipped tensors are exactly:
blk.0.ffn_gate_up_exps.scale
blk.1.ffn_gate_up_exps.scale
...
blk.19.ffn_gate_up_exps.scale
They are F32 per-expert scale tensors ({128}), and blocks 20-23 do not have them.
The generic .scale pass in src/llama-model.cpp loads scales for ffn_gate_exps, ffn_up_exps, and ffn_down_exps, but not for the merged ffn_gate_up_exps. In addition, src/models/inkling2.cpp does not pass any expert scale tensors to build_moe_ffn.
That fix exists, but on another branch in this fork:
- branch origin/gate-up-exps-scales
- fork PR #7: model: Add ffn_gate_up_exps scales
- commits 82d7e54d8, 1ddcaf614, f95a9946e
Your repeating-layers branch is based on 7e960f40f; the scale branch is based on 9d6f04fa9, so a plain merge is not clean.
Fix
The net change is two hunks:
1. In src/llama-model.cpp, request ffn_gate_up_exps.scale and reuse ffn_up_exps_s:
if (!layer.ffn_up_exps_s && layer.ffn_up_exps) {
    layer.ffn_up_exps_s = create_tensor(tn(LLM_TENSOR_FFN_UP_EXPS, "scale", i), {n_expert}, TENSOR_NOT_REQUIRED);
    if (layer.ffn_up_exps_s && layer.ffn_gate_up_exps) {
        throw std::runtime_error(format("ffn_up_exps.scale and ffn_gate_up_exps.weight both exist for layer %d", i));
    }
}
if (!layer.ffn_up_exps_s && layer.ffn_gate_up_exps) {
    layer.ffn_up_exps_s = create_tensor(tn(LLM_TENSOR_FFN_GATE_UP_EXPS, "scale", i), {n_expert}, TENSOR_NOT_REQUIRED);
}
2. In src/models/inkling2.cpp, pass the scales to build_moe_ffn:
                nullptr,
                layer.ffn_gate_up_exps,
                layer.ffn_up_exps_s,
                layer.ffn_gate_exps_s,
                layer.ffn_down_exps_s);
I generated the patch from those commits and confirmed it applies cleanly to your current repeating-layers HEAD:
/tmp/opencode/gate_up_scales.patch
git apply /tmp/opencode/gate_up_scales.patch
cmake --build build -j
Without the second hunk the model may load (if the tensor count check is bypassed) but use wrong expert scaling, so both parts are needed.
Want me to apply it and rebuild/test?

That fixed it but for some reason it's using way more VRAM that I would expect, I can't load it with any reasonable context window even with --no-kv-offload just way too fat for some reason getting Qwen 3.8 27B to load with somewhat acceptable settings seems easier hopefully just broken

llama.cpp repeating-layers  ❯ ./build/bin/llama-server -m ~/Downloads/Inkling-2-Mini-UD-Q4_K_M.gguf -ngl 1 -c 102400 --no-kv-offload
0.00.012.581 I srv  llama_server: initializing ...
0.00.012.594 I cmn  common_param: common_params_print_info: verbosity = 3 (adjust with the `-lv N` CLI arg)
0.00.012.878 W srv  server_setup: security: no API key is set and CORS allows all origins (see https://github.com/ggml-org/llama.cpp/pull/25655)
0.00.014.593 I srv    load_model: loading model '/home/noah/Downloads/Inkling-2-Mini-UD-Q4_K_M.gguf'
0.00.238.125 W common_fit_params: failed to fit params to free device memory: n_gpu_layers already set by user to 1, abort
0.00.359.316 W load: special_eos_id is not in special_eog_ids - the tokenizer config may be incorrect
0.00.725.102 E ggml_backend_cuda_buffer_type_alloc_buffer: allocating 17507.75 MiB on device 0: cudaMalloc failed: out of memory
0.00.725.107 E ggml_gallocr_reserve_n_impl: failed to allocate ROCm0 buffer of size 18358209280
0.00.725.108 E graph_reserve: failed to allocate compute buffers
0.00.731.058 E llama_init_from_model: failed to initialize the context: failed to allocate compute pp buffers
0.00.731.068 E cmn  common_init_: failed to create context with model '/home/noah/Downloads/Inkling-2-Mini-UD-Q4_K_M.gguf'
0.00.731.073 E cmn  common_init_: failed to create context with model '/home/noah/Downloads/Inkling-2-Mini-UD-Q4_K_M.gguf'
0.00.731.078 E srv    load_model: failed to create_context with model '/home/noah/Downloads/Inkling-2-Mini-UD-Q4_K_M.gguf'
0.00.731.081 I srv    operator(): operator(): cleaning up before exit...
0.00.731.660 E srv  server_run_i: exiting due to model loading error

Managed to fix it by getting said clanker again to fix it, but it's slow, and I imagine code quality is crap

On 4090 with 135k context speed around 15t/s, compared to gemma 4 26b, where on gemma I have around 65t/s
Model q4 k xl
Looped transformer in action

getting around 11 to 17tk/s on vulkan
i have a 9070 xt

There is a lot of optimization left to be done, from what I’m seeing. Being a looped transformer doesn’t account for that, since the ~5B active parameters is already counting the looping.

There are also some suspicious, large memory allocations which the unsloth fork avoids in some cases, but mainline llama.cpp doesn’t seem to.

I think people just need to give this a few days or a week and it will hopefully be much better.

Definitely seems like it.

Hope once its a bit more optimized its a good accurate model. I've got a 12gb 4070 and 64GB RAM and im dying for something that can trade blows with 27b

Hey everyone, we re-did our prebuilts at https://github.com/unslothai/llama.cpp - read https://unsloth.ai/docs/models/inkling-2-mini#run-inkling-2-mini-in-llama-cpp for how to run them

We also updated unsloth desktop with less memory usage and more speed!

I loaded the updated Unsloth and got this using a 5090 with 128gb of system ram:

Model loaded with a warning
A context of 131,072 tokens does not fit in this GPU's memory with this model. The largest that fits is 77,312 tokens. The GPU cannot hold it, so layers will be moved to the CPU and generation will be slower. Lower the context to 77,312 or less, or leave it on Auto.

Inkling-2-Mini-GGUF loaded with vision on CPU
All 25 layers are on the GPU. The expert weights of 1 layer are on the CPU. Model weights: 15 GiB on the GPU, 1.5 GiB on the CPU. Unsloth is running the vision projector in system memory rather than on the GPU. Image input remains available, but image processing may be slower.

Throwing my evaluations out. Pretty happy with the model overall, but I'm sure there are more optimizations to be done.

First machine: Unsloth studio, windows, 5070ti, Ryzen 5700x, 32GB DDR4 RAM 3200mhz, UD-IQ3_XSS, ~26k context
image

It's actually pretty efficient with its reasoning for simple tasks.

Second machine: llama.cpp (using latest unsloth fork at b12464 b12588-mix-c0c3de8)

RTX PRO 6000 over a PCI 3.0 x16 link (all in VRAM), 120GB DDR4, Xeon E5-2660 v4, UD-Q4_K_XL:
image

Prefill was around ~1,400 tp/s for the first few requests but started falling off later. Dflash spec decoding is helping for for structured text (code), but it's almost no help at all for prose conversations.

GPU is also heavily underutilized for the most part

image

EDIT: Corrected the unsloth llama.cpp tag (copied from the wrong spot in my original post).

Throwing my evaluations out. Pretty happy with the model overall, but I'm sure there are more optimizations to be done.

First machine: Unsloth studio, windows, 5070ti, Ryzen 5700x, 32GB DDR4 RAM 3200mhz, UD-IQ3_XSS, ~26k context
image

It's actually pretty efficient with its reasoning for simple tasks.

Second machine: llama.cpp (using latest unsloth fork at b12464)

RTX PRO 6000 over a PCI 3.0 x16 link (all in VRAM), 120GB DDR4, Xeon E5-2660 v4, UD-Q4_K_XL:
image

Prefill was around ~1,400 tp/s for the first few requests but started falling off later. Dflash spec decoding is helping for for structured text (code), but it's almost no help at all for prose conversations.

GPU is also heavily underutilized for the most part

image

Awesome thanks for sharing, hopefully more optimizations are coming soon

the model likes to think a lot is my first impression. Speed currently worse than Qwen3.8 27B, much room for improvement I assume.

Using the portable linux llama.cpp package it seems there are currently still bugs regarding the management of the kv cache / context during tg, this is on an Ampere Gen A6000 RTX Cuda:

Start command:

./llama-server-unsloth-12588 --model ../models/Inkling-2-Mini-UD-Q4_K_XL.gguf --mmproj ../models/mmproj-BF16.gguf --model-draft ../models/dspark-Inkling-2-Mini-Q8_0.gguf --spec-type draft-dspark --spec-draft-n-max 3 --n-gpu-layers-draft 99 --jinja --ctx-size 131072 --n-gpu-layers 99 --parallel 5 --temp 1.0 --top-p 1.0 --top-k 0 --min-p 0.0 -b 1024 -ub 1024 --host 0.0.0.0 --port 5001

Used package: app-b12588-mix-c0c3de8-linux-x64-cuda13-portable.tar.gz

In pi:

Error: 400: {"code":400,"message":"request (32231 tokens) exceeds the available context size (26368 tokens), try increasing
 it","type":"exceed_context_size_error","n_prompt_tokens":32231,"n_ctx":26368}

In llama.cpp:

15.12.678.360 I slot       select: id  3 | task -1 | selected slot by LCP similarity, f_sim_best = 0.974 (> 0.100 thold), f_keep = 1.000
15.12.678.748 I slot launch_slot_: id  3 | task 8671 | processing task, is_child = 0
15.14.427.481 I slot print_timing: id  3 | task 8671 | prompt eval time =     941.84 ms /   630 tokens (    1.49 ms per token,   668.90 tokens per second)
15.14.427.486 I slot print_timing: id  3 | task 8671 |        eval time =     802.94 ms /    54 tokens (   15.15 ms per token,    66.01 tokens per second)
15.14.427.486 I slot print_timing: id  3 | task 8671 |       total time =    1744.78 ms /   684 tokens
15.14.427.487 I slot print_timing: id  3 | task 8671 |    graphs reused =       8521
15.14.427.488 I slot print_timing: id  3 | task 8671 |   graph reallocs =        119    /     1        (same size) / (changed size)
15.14.427.492 I slot print_timing: id  3 | task 8671 | draft acceptance = 0.92857 (   39 accepted /    42 generated), mean len =  3.79
15.14.428.393 I slot      release: id  3 | task 8671 | stop processing: n_tokens = 23859, truncated = 0
15.14.778.712 I slot       select: id  3 | task -1 | selected slot by LCP similarity, f_sim_best = 0.740 (> 0.100 thold), f_keep = 1.000
15.14.779.040 I slot launch_slot_: id  3 | task 8688 | processing task, is_child = 0
15.14.782.512 E srv    send_error: task id = 8688, error: request (32231 tokens) exceeds the available context size (26368 tokens), try increasing it
15.14.782.519 I slot      release: id  3 | task 8688 | stop processing: n_tokens = 23859, truncated = 0
15.14.782.532 W srv          stop: cancel task, id_task = 8688

Env:

NVIDIA-SMI 590.48.01              Driver Version: 590.48.01      CUDA Version: 13.1
Linux version 6.12.100+deb13-amd64 (debian-kernel@lists.debian.org) (x86_64-linux-gnu-gcc-14 (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44) #1 SMP PREEMPT_DYNAMIC Debian 6.12.100-1 (2026-07-30)
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Tue_Dec_16_07:23:41_PM_PST_2025
Cuda compilation tools, release 13.1, V13.1.115
Build cuda_13.1.r13.1/compiler.37061995_0

Ryzen 3900X - RTX 2070 Super 8GB VRAM

#!/bin/sh

~/app-b12588-mix-c0c3de8-linux-x64-vulkan/llama-server \
  --model ~/models/huggingface/hub/models--unsloth--Inkling-2-Mini-GGUF/snapshots/ae9327c5fbc7333116ba32eee78bb5d2bbefae4f/Inkling-2-Mini-UD-Q4_K_M.gguf \
  --mmproj ~/models/huggingface/hub/models--unsloth--Inkling-2-Mini-GGUF/snapshots/ae9327c5fbc7333116ba32eee78bb5d2bbefae4f/mmproj-F16.gguf \
  --model-draft ~/models/huggingface/hub/models--unsloth--Inkling-2-Mini-GGUF/snapshots/ae9327c5fbc7333116ba32eee78bb5d2bbefae4f/dspark-Inkling-2-Mini-Q8_0.gguf \
  --spec-type draft-dspark --spec-draft-n-max 3 --n-gpu-layers-draft 99 \
  --host 0.0.0.0 --port 8080 \
  --temp 1.0 --top-p 1.0 --top-k 0 --min-p 0.0 \
  --samplers "dry;min_p;temperature" \
  --presence-penalty 0.1 \
  --flash-attn on \
  --reasoning-budget 2048 \
  --reasoning-budget-message "... Stop thinking. Token budget is at 2048 of 8192. Use tools to gather evidence or proceed to the answer." \
  --jinja \
  --load-mode mmap \
  --ctx-size 26000 \
  --cache-ram  2048 \
  --log-colors on \
  --cache-type-k q5_0 \
  --cache-type-v q5_0 \
  -np 1 -b 1024 -ub 512 -n 8192 -t 12 -tb 12 \
  --fit on -fitt 256 \
  --kv-offload --kv-unified --cache-prompt --ctx-checkpoints 2 --cache-idle-slots \

Prompt processing at 50 t/s , generation at 5 t/s. Expected 400 t/s prompt processing and 30 t/s generation, from other similar size models.

On load it uses 7.9GB VRAM and then when working it drops to 5.8GB VRAM used? Why is it loading 2.1GB unneeded stuff?

--n-cpu-moe seems to be broken, or very hard to interpret

Help figuring out what the issue is much appreciated. Remote agents seem useless for the task.

0.00.184.162 E llama_model_load: error loading model: unknown model architecture: 'inkling2'
0.00.184.169 E llama_model_load_from_file_impl: failed to load model
0.00.184.197 E common_fit_params: encountered an error while trying to fit params to free device mem
ory: failed to load model
0.00.254.832 E llama_model_load: error loading model: unknown model architecture: 'inkling2'
0.00.254.836 E llama_model_load_from_file_impl: failed to load model
0.00.254.841 E cmn  common_init_: failed to load model '/home/gs/llama_models/Inkling-2-Mini-UD-IQ2_
XXS.gguf'
0.00.254.846 E srv    load_model: failed to load model, '/home/gs/llama_models/Inkling-2-Mini-UD-IQ2
_XXS.gguf'
0.00.254.847 I srv    operator(): operator(): cleaning up before exit...
0.00.255.289 E srv  server_run_i: exiting due to model loading error

built on the specified tag b12588-mix-c0c3de8 from github.com:unslothai/llama.cpp.

Why is it not working?

image
Compute buffers are blowing up if selecting quantized kv cache...

@icyveins7 had the same issues, and was discussing it in another thread. It appears, for whatever reason the binary that is being distributed as being tag b12588-mix-c0c3de8 doesn't correspond to the source code in github. If you look at the github code at tag b12588-mix-c0c3de8 there's no way this produce the binary that is distributed as b12588-mix-c0c3de8. Looked quickly but the source code for the entire binary doesn't seem to be, at least cleanly, in any tag or branch when I went through it. The features seem there but not the entire thing together somewhere. It is possible the binary was assembled and the final source not pushed upstream, we all done this at one time or another.

Also observed what most others observed, it seems unlike qwen 3.8 27B it doesn't have some layers in linear attention so the VRAM goes up a lot faster and can fit a lot less token, and it's similar speed in the end. Nowhere near say what a successor to Qwen 3.6 35BA3B would have potentially looked like. The drafter was slowing things down on the hardware I was using even at 2 or 3 draft token, which shouldn't happen. It's also likely as others are saying there's optimization to be had in llama.cpp, it's possible that the looping is preventing some fuse kernel to be used. In any case even if this is fixed it won't address the VRAM used as the context grow. It's likely by the time all of that is fixed the smaller Qwen 4 27B models will be out.

I wouldn't count on Qwen to release anything smaller than a 27B with their new management, at least they're better than other labs and give us something a tiddlywink or mere morsel anything. But it seems others with custom engines have gotten like 100+ TPS on consumer hardware, and seems others like VLLM are better. I'm on AMD so not sure what best option is, I haven't had good luck with anything other than llama cpp generally, maybe I'll try making my own engine for laughs, but I don't have much confidence on Deepseek Flash doing anything remotely good

For me its almost unusable because of overthinking, as my max context is 60k. Going back to qwen3.8 27b medium thinking, is just a relief... It just does everything much quicker.

Update: i realized a bit later that it has reasoning efforts. Someone on youtube said, its a good idea to use "minimal" effort, or 0.1 out of possible 0.99. And yes it works, i just need more time to compare it to qwen3.8 at medium effort, which i find similar.

Hey we're fixing the KV cache issue - it's currently a limitation of mainline ggml-org/llama.cpp, so we're investigating if we can fix the KV cache quantization memory usage ourselves and will provide an update soon

I have a branch where Opus helped me run and optimize Inkling 2 Mini on an Arc Pro B70: https://github.com/ljedrz/llama.cpp/tree/inkling2-loop-scale-reshare.

@danielhanchen feel free to reuse any of it if it's helpful, I was able to run with a 256K context and over 2x the initial llama.cpp speed using the recommended Unsloth quant.

Sign up or log in to comment