Image-Text-to-Text
Trellis
Safetensors
glm5_next
lex4
sub-4-bit
Mixture of Experts
blackwell
dgx-spark
nvme-paging
vllm
glm
conversational
modelopt
Run this model with HF Jobs
Run Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Trellis
How to use Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw with Trellis:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
|
Download README.md from Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw: direct link, hf CLI and curl.
- Browser
- Download file 8.84 kB
-
https://huggingface.co/Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw/resolve/main/README.md
- Command line
-
hf download hf://Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw/README.md
-
curl -L -o README.md https://huggingface.co/Lex4-dev/GLM-5.3-Flash-LEX4-3.5bpw/resolve/main/README.md
8.84 kB
| license: other | |
| license_name: nvidia-open-model-agreement | |
| license_link: https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-agreement/ | |
| pipeline_tag: image-text-to-text | |
| base_model: | |
| - zai-org/GLM-5.3-Flash | |
| - nvidia/GLM-5.3-Flash-FP4-Local | |
| tags: | |
| - lex4 | |
| - trellis | |
| - sub-4-bit | |
| - moe | |
| - blackwell | |
| - dgx-spark | |
| - nvme-paging | |
| - vllm | |
| - glm | |
| # GLM-5.3-Flash-LEX4-3.5bpw | |
| **Run the 320B-parameter `GLM-5.3-Flash` frontier MoE on a single 128 GB NVIDIA DGX Spark** with **262K context**, **zero swap**, **near-2-Spark NVFP4 quality**, and a live per-request **`fast / balanced / exact`** NVMe dial — powered by [**Lex4**](https://github.com/lex4-dev/lex4) ([lex4.dev](https://lex4.dev)). | |
| | Spec | Value | | |
| |---|---| | |
| | **Base Model** | [`zai-org/GLM-5.3-Flash`](https://huggingface.co/zai-org/GLM-5.3-Flash) via [`nvidia/GLM-5.3-Flash-FP4-Local`](https://huggingface.co/nvidia/GLM-5.3-Flash-FP4-Local) | | |
| | **MoE Format** | `.lex4` v4.3 Trellis-L14 (`3.50 bpw` Hessian-allocated across 42 MoE layers × 288 routed experts = 12,096 experts) | | |
| | **Disk Footprint** | `133.2 GB` MoE (`.lex4`, 4096B `O_DIRECT` aligned) + `10.6 GB` untouched NVIDIA non-MoE weights | | |
| | **Recommended Runtime** | 1× NVIDIA DGX Spark (128 GB, Blackwell GB10 / SM121a) with **`lex4 up --preset balanced`** | | |
| | **Default Preset (`balanced`)** | **83 GB** resident experts (`62.7%`) · **262,144** context (`8.0 GiB` FP8 KV ≈ 347K tokens) · **~9.8 GiB** free RAM · **0 swap** | | |
| | **Boot Load Time** | **20.1 seconds** (`4.16 GB/s` via double-buffered `O_DIRECT` `QD=4` NVMe streaming) | | |
| --- | |
| ## Quick Start (1× DGX Spark) | |
| ```bash | |
| # 1. Install the zero-dependency Lex4 CLI | |
| curl -fsSL https://raw.githubusercontent.com/lex4-dev/lex4/main/install.sh | bash | |
| # 2. Launch the flagship 83 GB / 262K preset (pulls model + pre-compiled SM121a container) | |
| lex4 up --preset balanced | |
| ``` | |
| - **OpenAI API:** `http://127.0.0.1:8888/v1` (with smart `auto` mode routing + `/fast`, `/balanced`, `/exact` prefixes) | |
| - **Browser Chat UI:** add `--with-webui` for Open WebUI on `http://127.0.0.1:3000` | |
| - **Terminal Chat:** `lex4 chat` | |
| - **100% Commercial-Clean Mode:** add `--no-drafter` (skips the optional `CC-BY-NC-ND-4.0` DFlash2 drafter) | |
| --- | |
| ## Choosing Your RAM & Context Preset | |
| This single `.lex4` checkpoint adapts seamlessly to **any RAM budget on the fly** via Shannon entropy water-filling + RTAQ termination-expert pinning (`246` pinned experts at `0.00 GB` extra RAM): | |
| | Preset | Flag | Resident Experts | Context Window | FP8 KV Cache | Free OS RAM | Recommended Use | | |
| |---|---|---:|---:|---:|---:|---| | |
| | **`balanced`** *(primary)* | `--preset balanced` | **83 GB** (`62.7%`) | **262,144** (`262K`) | `8.0 GiB` (~347K tok) | **~9.8 GiB** | **Default flagship** — best balance of quality, speed & 262K context | | |
| | **`low-ram`** | `--preset low-ram` | **64 GB** (`48.0%`) | **262,144** (`262K`) | `8.0 GiB` (~347K tok) | **~29–31 GiB** | Running IDEs, browsers, or extra containers alongside the model | | |
| | **`max-quality`** | `--preset max-quality` | **86 GB** (`64.9%`) | **102,400** (`102K`) | `4.0 GiB` (~171K tok) | **~11.4 GiB** | Maximum warm-cache hit rate when ≤102K context is enough | | |
| --- | |
| ## Measured Benchmarks (1× NVIDIA DGX Spark, 128 GB) | |
| Evaluated cold (zero prefix cache reuse between modes) on the 40-task held-out suite (`chat`, `tools`, `coding`, `hard_math`) with `GLM-5.3-Flash-LEX4-3.5bpw` + `incoai/GLM-5.3-Flash-DFlash2` on a single 128 GB DGX Spark. | |
| ### Primary Flagship (`83 GB / 262K`) vs. `64 GB / 262K` & `86 GB / 102K` | |
| <!-- MC_BENCH_TABLE_START --> | |
| | Preset (RAM / Context) | Mode (Effort) | Chat | Tools | Coding | Cold Hard Math | Overall | Decode Speed | Avg TTFT | NVMe Read | Free RAM | | |
| |---|---|---:|---:|---:|---:|---:|---:|---:|---:|---:| | |
| | **`balanced` (83 GB / 262K)** | `fast` (low) | `8/8` (`100%`) | `8/8` (`100%`) | `6/10` (`60%`) | `4/14` (`28.6%`) | `26/40` (`65.0%`) | `25.6 tok/s` | `0.54 s` | `0.0 GB` | `9.9 GiB` | | |
| | **`balanced` (83 GB / 262K)** | `balanced` (high) | `8/8` (`100%`) | `8/8` (`100%`) | **`9/10` (`90%`)** | `7/14` (`50.0%`) | **`32/40` (`80.0%`)** | **`28.3 tok/s`** | **`0.76 s`** | `438 GB` | `9.9 GiB` | | |
| | **`balanced` (83 GB / 262K)** | `exact` (high) | — | — | — | **`12/14` (`85.7%`)** | — | **`8.6 tok/s`** | **`3.47 s`** | `5.2 TB` | `9.9 GiB` | | |
| | **`low-ram` (64 GB / 262K)** | `fast` (low) | `8/8` (`100%`) | `8/8` (`100%`) | `3/10` (`30%`) | `5/14` (`35.7%`) | `24/40` (`60.0%`) | `29.6 tok/s` | `0.50 s` | `0.0 GB` | `31.5 GiB` | | |
| | **`low-ram` (64 GB / 262K)** | `balanced` (high) | `8/8` (`100%`) | `8/8` (`100%`) | `7/10` (`70%`) | `5/14` (`35.7%`) | `28/40` (`70.0%`) | `28.7 tok/s` | `0.75 s` | `658 GB` | `31.5 GiB` | | |
| | **`low-ram` (64 GB / 262K)** | `exact` (high) | — | — | — | **`11/14` (`78.6%`)** | — | `5.2 tok/s` | `6.11 s` | `8.6 TB` | `31.5 GiB` | | |
| | **`max-quality` (86 GB / 102K)** | `fast` (low) | `8/8` (`100%`) | `8/8` (`100%`) | `6/10` (`60%`) | `5/14` (`35.7%`) | `27/40` (`67.5%`) | `26.2 tok/s` | `0.57 s` | `0.0 GB` | `11.3 GiB` | | |
| | **`max-quality` (86 GB / 102K)** | `balanced` (high) | `8/8` (`100%`) | `8/8` (`100%`) | `8/10` (`80%`) | `9/14` (`64.3%`) | `33/40` (`82.5%`) | `30.0 tok/s` | `0.80 s` | `559 GB` | `11.4 GiB` | | |
| | **`max-quality` (86 GB / 102K)** | `exact` (high) | — | — | — | **`12/14` (`85.7%`)** | — | `8.6 tok/s` | `3.92 s` | `5.9 TB` | `11.4 GiB` | | |
| <!-- MC_BENCH_TABLE_END --> | |
| ### Perplexity / Quality vs. 2-Spark NVFP4 & 1-Spark 2-Bit Builds | |
| | Checkpoint | Hardware | Code PPL Delta vs. NVFP4 | Prose PPL Delta vs. NVFP4 | | |
| |---|---|---:|---:| | |
| | NVIDIA `GLM-5.3-Flash-FP4-Local` (`4.27 bpw`) | 2× DGX Spark | `0.00%` (ref) | `0.00%` (ref) | | |
| | **Lex4 `.lex4` (`3.50 bpw` Trellis-L14, full residency / `exact`)** | **1× DGX Spark** | **`+0.27%`** | **`+0.91%`** | | |
| | **Lex4 `.lex4` (`3.50 bpw`, `balanced` paged)** | **1× DGX Spark** | **`+0.17%` – `+1.00%`** | **`+2.91%`** *(Les Mis)* | | |
| | Ultra-low-bit `2.01 bpw` all-in-RAM | 1× DGX Spark | `+26.6%` | `+142.3%` | | |
| --- | |
| ## Live Mode Dial (`fast` / `balanced` / `exact`) | |
| Switch quality vs. speed on any single prompt with zero restarts: | |
| - **Chat prefixes:** `/fast <prompt>`, `/balanced <prompt>`, `/exact <prompt>` (alias `/ultra`) | |
| - **API parameter:** `"lex4_mode": "fast" | "balanced" | "exact"` on `POST /v1/chat/completions` | |
| - **Auto mode (enabled by default in `lex4 up`):** automatically sends quick logs, greetings, short casual Q&A, and `enable_thinking=False` compressions to `fast` (`0 GB` NVMe, `~0.36 s` TTFT), while keeping coding, math, tools, and long prompts on `balanced`. | |
| --- | |
| ## Checkpoint Contents | |
| - `lex4-layer-00003.lex4` … `lex4-layer-00044.lex4` — 42 Trellis-L14 `.lex4` MoE layer files (`4096B`-aligned for `O_DIRECT` NVMe DMA) | |
| - `lex4-manifest.json` — Layer table, effective bpw, and per-layer geometry | |
| - `expert_priority.json` — Empirical routing frequency & Shannon water-filling priority map | |
| - `rtaq_pin_experts.json` — 246 RTAQ termination-critical experts pinned into RAM at `0.00 GB` extra memory | |
| - `model-00001-of-00002.safetensors`, `model-00002-of-00002.safetensors` — Untouched non-MoE layers (embeddings, dense layers, hybrid sparse/linear attention, vision encoder, router gates) from `nvidia/GLM-5.3-Flash-FP4-Local` | |
| - Tokenizer, processor, and chat template configs | |
| --- | |
| ## License & Attribution | |
| - **Model Weights:** This checkpoint is a `.lex4`-quantized derivative of [`nvidia/GLM-5.3-Flash-FP4-Local`](https://huggingface.co/nvidia/GLM-5.3-Flash-FP4-Local), which is derived from [`zai-org/GLM-5.3-Flash`](https://huggingface.co/zai-org/GLM-5.3-Flash) *(MIT License)*. Use of these weights is governed by the [**NVIDIA Open Model Agreement**](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-agreement/), which permits both **commercial and non-commercial use**. | |
| - **Inference Engine & Format:** [`lex4-dev/lex4`](https://github.com/lex4-dev/lex4) is open-sourced under **Apache-2.0**. | |
| - **Runtime Ecosystem:** Runs on [vLLM](https://github.com/vllm-project/vllm) and the community [`eugr/spark-vllm-b12x`](https://hub.docker.com/r/eugr/spark-vllm-b12x) DGX Spark container stack. | |
| - **Optional Speculative Drafter (Not Included Here):** For personal and research use, `lex4 up` defaults to pulling [`incoai/GLM-5.3-Flash-DFlash2`](https://huggingface.co/incoai/GLM-5.3-Flash-DFlash2) ([`z-lab/dflash`](https://github.com/z-lab/dflash)) directly from Hugging Face. That draft model is published by Inco AI under **`CC-BY-NC-ND-4.0`** (Non-Commercial, No-Derivatives) and is **not redistributed in this repository**. For commercial deployments, run `lex4 up --no-drafter` for a 100% commercial-clean stack. | |
| - **Research Credits:** Inspired by QuIP# / QTIP (Tseng et al.), ExLlamaV3, and RTAQ (`arXiv:2611.37751`). | |