Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
C++
setup: images on by default for Unsloth's files where the encoder has room (NVIDIA 16 GB and more: the GPU encoder; AMD Linux with every expert in RAM: the CPU encoder); UD-Q4_K_XL's images no longer untested (run end to end on an RTX A4000 and an R9700); the yardstick keeps a config's --resident-budget-gib
Niko122112be1059df38
diff --git a/setup.py b/setup.pyindex ac90993e9..71bfe368a 100644--- a/setup.py+++ b/setup.py@@ -227,9 +227,9 @@ MODELS = {# the quality yardstick and the decode/prompt numbers in docs/QUANTS.md), so it is no longer NVIDIA-only (#429)."UD-Q4_K_XL": {"about": "4-bit (Unsloth Dynamic): K-quant experts, between UD-IQ4_XS and UD-Q5_K_XL in quality","download_gb": 111.3, "ram_gb": 48, "arena_gb": 77.0, "families": ("unsloth",), "budget": True,- # #967: images are allowed (the same base model and image encoder as UD-IQ4_XS), with a warning:- # reported working by hand (#967, #971), not tested by us on this file- "vision": True, "vision_untested": True},+ # #967 / MODEL-UPDATE: images run end to end with this file (CUDA: RTX A4000, GPU encoder; HIP:+ # R9700, CPU encoder; the test picture's text and shapes as the IQ3_XXS pack answers them)+ "vision": True},# MODEL-UPDATE: Unsloth's larger files (docs/QUANTS.md). The same GGUF-in-place mode: every expert in RAM where it# fits with UNSLOTH_RESIDENT_BESIDE_GB more (unsloth_budget), else a RAM budget of them and the rest read from the# SSD while it answers - so "ram_gb" is the all-in-RAM need, and below it setup asks first (default no). Their@@ -1733,6 +1733,22 @@ def unsloth_budget(model, ram, gpu=None, asked=None) -> bool:ram < MODELS[model]["arena_gb"] / 1.073741824 + UNSLOTH_RESIDENT_BESIDE_GB+UNSLOTH_IMAGES_MIN_VRAM_GB = 15.5 # a 16 GB card: the GPU encoder's ~1.4 GB is under a tenth of it+++def unsloth_images_default(model, family, ram, gpu=None) -> bool:+ """MODEL-UPDATE: is "images on" setup's default answer for this choice: Unsloth's files (the same base model and+ image encoder as ISTA's, run end to end on CUDA and on HIP), on an NVIDIA card of 16 GB or more (the GPU encoder+ keeps ~1.4 GB free) or, on AMD, wherever every expert stays in RAM (the CPU encoder takes no VRAM). Smaller cards+ keep "no" as the default (asked, as for the other families)."""+ if family != "unsloth" or not MODELS.get(model, {}).get("budget") or MODELS[model].get("vision") is False:+ return False+ g = gpu or {}+ if str(g.get("arch", "")).startswith("gfx"):+ return not unsloth_budget(model, ram, g) and not WIN+ return g.get("vram_gb", 0.0) >= UNSLOTH_IMAGES_MIN_VRAM_GB++UMA_EXPERTS = 24576 # the Flash-Next model's experts (48 layers x 512): the most an expert cache can hold@@ -5468,14 +5484,19 @@ def main() -> int:if a.vision not in (None, "no", "none"):warn(f"images are not available with {model} yet: off")elif hip:- vision = hip_vision(a.vision)+ # MODEL-UPDATE: Unsloth's files on AMD (Linux) read images with the CPU encoder by default where their experts+ # all stay in RAM (it takes no VRAM; measured on an R9700 with UD-Q4_K_XL and UD-Q5_K_XL, docs/QUANTS.md)+ vision = hip_vision(a.vision if a.vision is not None or not unsloth_images_default(model, family, ram, gpu)+ else "cpu")elif a.vision:vision = {"yes": "gpu", "no": "none"}.get(a.vision, a.vision)else:say()say(" Images: the model can also read pictures (screenshots, photos, scanned pages). This adds a 0.9 GB")say(" download and keeps ~1.4 GB of VRAM free for the image encoder, so text is a few % slower.")- vision = "gpu" if ask("Do you want images?", ["y", "n"], "n", a.yes) == "y" else "none"+ # MODEL-UPDATE: on by default for Unsloth's files on a card with room for the encoder (16 GB and more)+ default = "y" if unsloth_images_default(model, family, ram, gpu) else "n"+ vision = "gpu" if ask("Do you want images?", ["y", "n"], default, a.yes) == "y" else "none"ok("images: " + {"none": "off", "gpu": "on", "cpu": "on (encoder on the CPU)"}[vision])if vision != "none" and MODELS[model].get("vision_untested"):warn(f"images with {model} are untested: users report them working, but we have not run this file with "diff --git a/tools/quant_quality.py b/tools/quant_quality.pyindex 07bf1789c..2ab13e639 100644--- a/tools/quant_quality.py+++ b/tools/quant_quality.py@@ -41,7 +41,7 @@ FIXED_ENV = {"STRATA_ROUTE_TAIL_SKIP": "0", "STRATA_PREFILL_CPU_SHARE": "0", "ST# config args the yardstick replaces (value-taking) or drops (flags)DROP_VALUE = {"--expert-cache", "--adapt-every", "--pcie-frac", "--suffix-draft", "--prompt-cache", "--max-context","--prefill", "--prompt-cache-every", "--short-read", "--conversation-cache-mib", "--eos-ids",- "--resident-budget-gib", "--kv", "--kv-resident"}+ "--kv", "--kv-resident"} # (--resident-budget-gib stays: a PC whose RAM does not hold the experts)DROP_FLAG = {"--serve", "--vision", "--resident-experts", "--resident-cpu-experts"}diff --git a/tools/test_setup_golden.json b/tools/test_setup_golden.jsonindex 39bb06728..a3b089d4d 100644--- a/tools/test_setup_golden.json+++ b/tools/test_setup_golden.json@@ -192,7 +192,10 @@"--kv","int8","--kv-resident",- "32768"+ "32768",+ "--vision",+ "--vram-reserve-mib",+ "700"],"cwd": "<T>","exe": "<T>/engine/<EXE>",@@ -204,7 +207,14 @@"log": "<T>/strata-unsloth-ud-q4_k_xl.log","model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl","port": 8080,- "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer"+ "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer",+ "vision": {+ "exe": "<T>/engine/strata-vision.exe",+ "gpu": true,+ "max_tokens": 1024,+ "mmproj": "<T>/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",+ "model": "<T>/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"+ }}},"32GB-2x24GB qwen IQ3_S": {@@ -412,7 +422,10 @@"--kv","int8","--resident-budget-gib",- "8"+ "8",+ "--vision",+ "--vram-reserve-mib",+ "700"],"cwd": "<T>","exe": "<T>/engine/<EXE>",@@ -424,7 +437,14 @@"log": "<T>/strata-unsloth-ud-q4_k_xl.log","model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl","port": 8080,- "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer"+ "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer",+ "vision": {+ "exe": "<T>/engine/strata-vision.exe",+ "gpu": true,+ "max_tokens": 1024,+ "mmproj": "<T>/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",+ "model": "<T>/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"+ }}},"47GB-2x16GB qwen IQ3_S": {@@ -630,7 +650,10 @@"--kv","int8","--resident-budget-gib",- "23"+ "23",+ "--vision",+ "--vram-reserve-mib",+ "700"],"cwd": "<T>","exe": "<T>/engine/<EXE>",@@ -642,7 +665,14 @@"log": "<T>/strata-unsloth-ud-q4_k_xl.log","model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl","port": 8080,- "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer"+ "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer",+ "vision": {+ "exe": "<T>/engine/strata-vision.exe",+ "gpu": true,+ "max_tokens": 1024,+ "mmproj": "<T>/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",+ "model": "<T>/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"+ }}},"64GB-1x32GB qwen IQ3_S": {@@ -836,7 +866,10 @@"--kv","int8","--resident-budget-gib",- "40"+ "40",+ "--vision",+ "--vram-reserve-mib",+ "700"],"cwd": "<T>","exe": "<T>/engine/<EXE>",@@ -848,7 +881,14 @@"log": "<T>/strata-unsloth-ud-q4_k_xl.log","model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl","port": 8080,- "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer"+ "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer",+ "vision": {+ "exe": "<T>/engine/strata-vision.exe",+ "gpu": true,+ "max_tokens": 1024,+ "mmproj": "<T>/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",+ "model": "<T>/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"+ }}},"96GB-1x16GB qwen IQ3_S": {@@ -1044,7 +1084,10 @@"--kv","int8","--kv-resident",- "32768"+ "32768",+ "--vision",+ "--vram-reserve-mib",+ "700"],"cwd": "<T>","exe": "<T>/engine/<EXE>",@@ -1056,7 +1099,14 @@"log": "<T>/strata-unsloth-ud-q4_k_xl.log","model_name": "qwen3.8-flash-next-unsloth-ud-q4_k_xl","port": 8080,- "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer"+ "tokenizer": "<T>/data/packs/unsloth-ud-q4_k_xl/tokenizer",+ "vision": {+ "exe": "<T>/engine/strata-vision.exe",+ "gpu": true,+ "max_tokens": 1024,+ "mmproj": "<T>/models/mmproj-Qwen3.8-Flash-Next-BF16.gguf",+ "model": "<T>/models/unsloth-UD-Q4_K_XL/Qwen3.8-Flash-Next-UD-Q4_K_XL-00001-of-00004.gguf"+ }}}}diff --git a/tools/test_setup_unsloth.py b/tools/test_setup_unsloth.pyindex 5acb150b1..59a403d80 100644--- a/tools/test_setup_unsloth.py+++ b/tools/test_setup_unsloth.py@@ -336,13 +336,13 @@ class Main(Base):self.assertIsNone(cfg)def test_one_gpu_and_images_with_a_warning(self):- """#967: images are allowed with UD-Q4_K_XL, said to be untested."""+ """#967: images are allowed with UD-Q4_K_XL (tested end to end since MODEL-UPDATE)."""code, out, cfg = self.main(["--context", "8192", "--vision", "yes", "--low-ram", "on"], n_gpus=2)self.assertEqual(code, 0, out)self.assertIn("(NVIDIA GeForce RTX 5070, 12 GB) only (--gpus 0,1 shares it across", out)self.assertNotIn("images are not available", out)self.assertIn("images: on", out)- self.assertIn("images with UD-Q4_K_XL are untested", out)+ self.assertNotIn("are untested", out) # MODEL-UPDATE: run end to end (CUDA, HIP)self.assertIn("--low-ram on does not apply", out)self.assertNotIn("layer_split", cfg)self.assertIn("--vision", cfg["args"])