Text Generation
GGUF
English
quantized
imatrix
iq3_xxs
qwen3
qwen35moe
Mixture of Experts
35b
3b-active
agentic
tool-use
reasoning
conversational
Instructions to use SebastianAldrin/Nex-N2-mini-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SebastianAldrin/Nex-N2-mini-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS # Run inference directly in the terminal: llama cli -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS # Run inference directly in the terminal: llama cli -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS # Run inference directly in the terminal: ./llama-cli -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS # Run inference directly in the terminal: ./build/bin/llama-cli -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
Use Docker
docker model run hf.co/SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
- LM Studio
- Jan
- vLLM
How to use SebastianAldrin/Nex-N2-mini-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SebastianAldrin/Nex-N2-mini-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SebastianAldrin/Nex-N2-mini-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
- Ollama
How to use SebastianAldrin/Nex-N2-mini-GGUF with Ollama:
ollama run hf.co/SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
- Unsloth Desktop
- Pi
How to use SebastianAldrin/Nex-N2-mini-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use SebastianAldrin/Nex-N2-mini-GGUF with Docker Model Runner:
docker model run hf.co/SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
- Lemonade
How to use SebastianAldrin/Nex-N2-mini-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
Run and chat with the model
lemonade run user.Nex-N2-mini-GGUF-IQ3_XXS
List all available models
lemonade list
- Hermes Agent
How to use SebastianAldrin/Nex-N2-mini-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
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 SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use SebastianAldrin/Nex-N2-mini-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS
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 "SebastianAldrin/Nex-N2-mini-GGUF:IQ3_XXS" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download patch_gguf.py from SebastianAldrin/Nex-N2-mini-GGUF: direct link, hf CLI and curl.
- Browser
- Download file 3.57 kB
-
https://huggingface.co/SebastianAldrin/Nex-N2-mini-GGUF/resolve/9f93a09a23d130fdaf961e2934f5acc53aefd06d/patch_gguf.py
- Command line
-
hf download hf://SebastianAldrin/Nex-N2-mini-GGUF@9f93a09a23d130fdaf961e2934f5acc53aefd06d/patch_gguf.py
-
curl -L -o patch_gguf.py https://huggingface.co/SebastianAldrin/Nex-N2-mini-GGUF/resolve/9f93a09a23d130fdaf961e2934f5acc53aefd06d/patch_gguf.py
3.57 kB
| #!/usr/bin/env python3 | |
| """Patch a fresh Nex-N2-mini GGUF to make it loadable by llama.cpp / Ollama / LM Studio. | |
| The convert script (convert_hf_to_gguf.py) reads `mtp_num_hidden_layers: 1` from | |
| config.json and writes `qwen35moe.nextn_predict_layers = 1` into the GGUF header. | |
| It also writes `qwen35moe.block_count = 41` (40 transformer + 1 MTP). But the | |
| public Nex-N2-mini safetensors don't include the MTP head weights, so llama.cpp's | |
| loader refuses with: | |
| missing tensor 'blk.39.nextn.eh_proj.weight' | |
| This script flips two u32 metadata values in-place. Same length, no other bytes | |
| shifted, takes ~30 seconds vs. re-converting from safetensors (~8 hours). | |
| Usage: | |
| python patch_gguf.py <path_to_gguf> | |
| Safe to run on either the F16 GGUF (from convert) or an already-quantized GGUF. | |
| Idempotent — running again is a no-op. | |
| """ | |
| from __future__ import annotations | |
| import struct | |
| import sys | |
| from pathlib import Path | |
| # GGUF KV value type sizes (for skipping) | |
| SCALAR_SIZE = {0: 1, 1: 1, 2: 2, 3: 2, 4: 4, 5: 4, 6: 4, 7: 1, 10: 8, 11: 8, 12: 8} | |
| TYPE_STRING = 8 | |
| TYPE_ARRAY = 9 | |
| TYPE_U32 = 4 | |
| def skip_value(f, t): | |
| if t in SCALAR_SIZE: | |
| f.seek(SCALAR_SIZE[t], 1) | |
| elif t == TYPE_STRING: | |
| n, = struct.unpack('<Q', f.read(8)) | |
| f.seek(n, 1) | |
| elif t == TYPE_ARRAY: | |
| inner_t, = struct.unpack('<I', f.read(4)) | |
| cnt, = struct.unpack('<Q', f.read(8)) | |
| if inner_t in SCALAR_SIZE: | |
| f.seek(SCALAR_SIZE[inner_t] * cnt, 1) | |
| elif inner_t == TYPE_STRING: | |
| for _ in range(cnt): | |
| n, = struct.unpack('<Q', f.read(8)) | |
| f.seek(n, 1) | |
| else: | |
| raise ValueError(f"unsupported array inner type {inner_t}") | |
| else: | |
| raise ValueError(f"unsupported KV type {t}") | |
| def read_str(f): | |
| n, = struct.unpack('<Q', f.read(8)) | |
| return f.read(n).decode('utf-8', errors='replace') | |
| def patch_u32(path: Path, key: str, new_value: int) -> bool: | |
| """Find a u32 KV pair by key name and overwrite its value. Returns True if patched.""" | |
| with open(path, 'r+b') as f: | |
| assert f.read(4) == b'GGUF', "not a GGUF file" | |
| f.read(4) # version | |
| f.read(8) # tensor count | |
| nkv, = struct.unpack('<Q', f.read(8)) | |
| for _ in range(nkv): | |
| n, = struct.unpack('<Q', f.read(8)) | |
| k = f.read(n).decode('utf-8', errors='replace') | |
| t, = struct.unpack('<I', f.read(4)) | |
| if k == key: | |
| if t != TYPE_U32: | |
| raise ValueError(f"{key} has type {t}, expected u32 (4)") | |
| pos = f.tell() | |
| old, = struct.unpack('<I', f.read(4)) | |
| if old == new_value: | |
| print(f" {key} already = {new_value}, no change") | |
| return False | |
| f.seek(pos) | |
| f.write(struct.pack('<I', new_value)) | |
| print(f" patched {key}: {old} -> {new_value}") | |
| return True | |
| skip_value(f, t) | |
| raise ValueError(f"key not found: {key}") | |
| def main() -> int: | |
| if len(sys.argv) != 2: | |
| print(__doc__) | |
| return 1 | |
| path = Path(sys.argv[1]).resolve() | |
| if not path.exists(): | |
| print(f"ERROR: {path} does not exist") | |
| return 1 | |
| print(f"patching {path}") | |
| patch_u32(path, "qwen35moe.nextn_predict_layers", 0) | |
| patch_u32(path, "qwen35moe.block_count", 40) | |
| print("done. The GGUF should now load in any recent llama.cpp / LM Studio / Ollama 0.12.6+") | |
| return 0 | |
| if __name__ == "__main__": | |
| sys.exit(main()) | |