Text Generation
MLX
English
diffusion_gemma
nvfp4
diffusion-gemma
diffusion-lm
structured-output
decision-making
conversational
modelopt
Instructions to use GenbaLabs/super-decider-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use GenbaLabs/super-decider-mlx with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("GenbaLabs/super-decider-mlx") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use GenbaLabs/super-decider-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "GenbaLabs/super-decider-mlx"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "GenbaLabs/super-decider-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use GenbaLabs/super-decider-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "GenbaLabs/super-decider-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "GenbaLabs/super-decider-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GenbaLabs/super-decider-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use GenbaLabs/super-decider-mlx with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "GenbaLabs/super-decider-mlx"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default GenbaLabs/super-decider-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use GenbaLabs/super-decider-mlx with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "GenbaLabs/super-decider-mlx"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "GenbaLabs/super-decider-mlx" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download superdecider/weights.py from GenbaLabs/super-decider-mlx: direct link, hf CLI and curl.
- Browser
- Download file 2.94 kB
-
https://huggingface.co/GenbaLabs/super-decider-mlx/resolve/main/superdecider/weights.py
- Command line
-
hf download hf://GenbaLabs/super-decider-mlx/superdecider/weights.py
-
curl -L -o weights.py https://huggingface.co/GenbaLabs/super-decider-mlx/resolve/main/superdecider/weights.py
2.94 kB
| """Reader for artifacts/mlx-nvfp4/ produced by scripts/convert.py. | |
| Tensor names are the artifact's own. Every layer's 128 experts arrive stacked | |
| and gate/up fused, exactly as the model consumes them, so loading copies nothing: | |
| model.decoder.layers.<i>.experts.gate_up_proj.{weight,scales,global_scale} | |
| model.decoder.layers.<i>.experts.down_proj.{weight,scales,global_scale} | |
| `weight` is uint32 (8 NVFP4 values per word), `scales` is one E4M3 byte per 16 | |
| input values, and `global_scale` is the checkpoint's per-expert float32 scale | |
| (its amax, 448*6*weight_scale_2) which `mx.gather_qmm` takes as an argument. | |
| Everything else is BF16 under its checkpoint name. | |
| """ | |
| from __future__ import annotations | |
| import json | |
| from collections.abc import Iterator, Mapping | |
| from pathlib import Path | |
| import mlx.core as mx | |
| LAYOUT = "stacked-global-scale" | |
| DEFAULT_DIR = Path(__file__).resolve().parent.parent / "artifacts" / "mlx-nvfp4" | |
| if not DEFAULT_DIR.is_dir(): | |
| # the published repo keeps the shards next to the package, not under artifacts/ | |
| DEFAULT_DIR = Path(__file__).resolve().parent.parent | |
| def load_manifest(directory: str | Path = DEFAULT_DIR) -> dict: | |
| """Quantisation mode, group size, shard list and tensor -> shard map.""" | |
| manifest = json.loads((Path(directory) / "manifest.json").read_text()) | |
| layout = manifest["quantization"].get("layout") | |
| if layout != LAYOUT: | |
| raise ValueError( | |
| f"{directory}: expected a '{LAYOUT}' artifact from scripts/convert.py, got {layout!r}; " | |
| "the old absolute-scale artifact is ~5% off and must be regenerated" | |
| ) | |
| return manifest | |
| def load_weights(directory: str | Path = DEFAULT_DIR) -> dict[str, mx.array]: | |
| """Every tensor in memory (~17.5 GiB) as name -> mx.array, stacked experts included.""" | |
| directory = Path(directory) | |
| tensors: dict[str, mx.array] = {} | |
| for shard in load_manifest(directory)["shards"]: | |
| tensors.update(mx.load(str(directory / shard["file"]))) | |
| return tensors | |
| class LazyWeights(Mapping[str, mx.array]): | |
| """Name -> tensor mapping that loads a 2 GiB shard on first access and keeps it. | |
| One shard holds about three layers of stacked experts, so a layer needs one | |
| shard, not the whole artifact. | |
| """ | |
| def __init__(self, directory: str | Path = DEFAULT_DIR): | |
| self.directory = Path(directory) | |
| self.manifest = load_manifest(self.directory) | |
| self._weight_map: dict[str, str] = self.manifest["weight_map"] | |
| self._shards: dict[str, dict[str, mx.array]] = {} | |
| def __getitem__(self, key: str) -> mx.array: | |
| shard = self._weight_map[key] | |
| if shard not in self._shards: | |
| self._shards[shard] = mx.load(str(self.directory / shard)) | |
| return self._shards[shard][key] | |
| def __iter__(self) -> Iterator[str]: | |
| return iter(self._weight_map) | |
| def __len__(self) -> int: | |
| return len(self._weight_map) | |