Instructions to use xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16 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("xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16") 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 xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16"
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": "xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16 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 "xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16"
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 xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16"
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 "xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16" \ --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"
Spark-X2.6-4B Abliterated — MLX oQ4e (FP16 source)
This is an MLX/oMLX oQ4e quantization by xunlinkx of electroglyph/Spark-X2.6-4B-uncensored, a community abliterated derivative of the official XHToken/Spark-X2.6-4B. It is not an official XHToken release.
The Electroglyph source was produced with Heretic 2.0.0.dev0 Arbitrary-Rank Ablation (ARA) and includes reproducibility assets. Its model card reports 6 refusals in 100 prompts and KL divergence 0.0027 against the original model. These are the source author’s reported measurements; this quantized checkpoint has not been independently evaluated on that refusal set. See the source model card and its reproduction instructions for details.
Quantization details
- Source checkpoint: BF16; converted to FP16 before quantization. The
-fp16suffix identifies the quantization input format. - Method: oMLX enhanced quantization with 128 calibration samples, sequence length 512, and affine quantization (group size 64).
- Quantization: 4-bit enhanced mixed precision.
- Per-layer layout: 4-bit base weights; all 36 attention gates (
self_attn.g_proj) are 8-bit, and fused Q/K/V projections plus MLP down projections are 6-bit. Full layout is embedded inconfig.json. - Architecture:
spark2_5. - License: Apache-2.0, inherited from the upstream model lineage. See Electroglyph’s repository and the official XHToken project.
Intended use and safety
This variant is intended for users who want less refusal behavior than the original model. “Uncensored” describes the intended behavior; abliteration describes the weight-modification method. It is not guaranteed to answer every request. Reduced refusal behavior also means you should provide your own moderation, access controls, and review if you make it available to others.
The smallest of this set, intended for Apple Silicon with a tighter unified-memory budget, including 8 GB Macs. Context length and other running apps affect memory use.
Apple Silicon and loading
Prepared for MLX on Apple Silicon, including M1 through M6. FP16 source weights were chosen for broad compatibility across generations; FP16-derived quantized models are suitable on M3 and newer as well. Use a current oMLX or MLX-LM version with spark2_5 architecture support. The quantization metadata is stored in config.json.
mlx_lm.generate \
--model xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16 \
--prompt "What is the capital of Anhui Province?" \
--max-tokens 256 \
--temp 1.0 \
--top-p 0.95
The upstream Spark card recommends temperature 1.0 and top-p 0.95. Consult it for chat-template and thinking-budget settings supported by your runtime.
Local smoke check
A short generation prompt loaded and ran successfully for this checkpoint: 16 generated tokens; MLX reported 2.859 GB peak memory. This confirms basic loading and generation only; it is not a quality benchmark, hardware compatibility survey, or independent test of the source model’s refusal behavior.
Attribution
The original model is by the SparkLLM team at XHToken. Heretic ablation and the uncensored source derivative are by Electroglyph. This repository contains only xunlinkx’s MLX/oMLX quantization of that derivative.
- Downloads last month
- 146
4-bit
Model tree for xunlinkx/Spark-X2.6-4B-Abliterated-Uncensored-MLX-oQ4e-fp16
Base model
XHToken/Spark-X2.6-4B-Base