Spark-X2.6-4B-uncensored
a free local LLM with customizable reasoning
2 min read
The model is based on XHToken/Spark-X2.6-4B (an architecture with 4.11 billion parameters) and modified using the LiberARA method, completely removing censorship and layer-level restrictions (0 refusals on safety tests). The model remains compact for local deployment on devices while delivering strong results in coding, agentic tasks, and long-context processing. The main feature is three reasoning intensity levels (none, low, high), allowing you to balance response speed and accuracy. The new release will be useful for local agent developers and enthusiasts who need a powerful and flexible model without unnecessary barriers.
Key features
- Full freedom (uncensored): the model is tuned for a zero-refusal rate on safety tests compared to 100% for the original.
- Controllable reasoning budget: three levels of reasoning mechanism operation (none, low, high) for precise task tuning.
- Strong agent skills: improved support for tool use, multi-step planning, and code writing.
- Device efficiency: high inference speed comparable to leading compact open-source models.
What you can do
- Run a local AI agent: deploy the model via SGLang, vLLM, or Transformers to automate local tasks.
- Integrate into applications: set up a server to work with an OpenAI-compatible API with on-the-fly control of reasoning depth.
- Write and debug code: use enhanced programming and long-context capabilities directly on your hardware.
- Run experiments: explore the behavior of the uncensored model using flexible attention and layer management parameters.
Example
Running generation using the transformers library:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "electroglyph/Spark-X2.6-4B-uncensored-experimental"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "What is the capital of Anhui Province?"}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
enable_thinking=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=131072,
do_sample=True,
temperature=1.0,
top_p=0.95,
top_k=0,
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))Read more
DetailsBenchmarks: refusals 0/100 (original 100/100), Kullback-Leibler (KL) divergence 0.0493.
Descensoring parameters (LiberARA): start_layer_index 12, end_layer_index 36, quantile_q 0.9275, gamma 0.4522.
Base model: XHToken/Spark-X2.6-4B (4.11 billion parameters).
Deployment tools: Transformers, SGLang, vLLM, MLX, llama.cpp, Ollama.










Comments