Text Generation
Transformers
Safetensors
spark2_5
spark
spark-x2.6-4b
recursive-transformer
loop72
mhc
d-lsa
long-context
conversational
custom_code
Instructions to use TassP0lar/Spark-X2.6-4B-Recursive72 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TassP0lar/Spark-X2.6-4B-Recursive72 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TassP0lar/Spark-X2.6-4B-Recursive72", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("TassP0lar/Spark-X2.6-4B-Recursive72", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TassP0lar/Spark-X2.6-4B-Recursive72 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TassP0lar/Spark-X2.6-4B-Recursive72" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TassP0lar/Spark-X2.6-4B-Recursive72", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TassP0lar/Spark-X2.6-4B-Recursive72
- SGLang
How to use TassP0lar/Spark-X2.6-4B-Recursive72 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "TassP0lar/Spark-X2.6-4B-Recursive72" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TassP0lar/Spark-X2.6-4B-Recursive72", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "TassP0lar/Spark-X2.6-4B-Recursive72" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TassP0lar/Spark-X2.6-4B-Recursive72", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TassP0lar/Spark-X2.6-4B-Recursive72 with Docker Model Runner:
docker model run hf.co/TassP0lar/Spark-X2.6-4B-Recursive72
Spark X2.6 4B Recursive72
Spark X2.6 4B Recursive72 (TassP0lar/Spark-X2.6-4B-Recursive72) is the 72-visit recurrent-depth (Loop72) + per-visit Paged Latent Sparse Attention (D-LSA) model built strictly atop the 100% frozen BF16 XHToken/Spark-X2.6-4B (revision=64ca8f2a295b8ceb2757b9d4749a6558c4759e5b) 36-layer hybrid backbone.
Verified Architecture & Provenance
- Frozen Base Backbone:
XHToken/Spark-X2.6-4B@64ca8f2a295b8ceb2757b9d4749a6558c4759e5b(36 physical layers = 9 partial-RoPE0.25full-attention layers{3, 7, 11, 15, 19, 23, 27, 31, 35}+ 27 sliding-windoww=512layers, native GELU, head-wise sigmoidg_proj+out_proj). - Base Backbone Full-Byte SHA-256 Invariance:
True(sha256=e8a72f3eb657df114f531e218a6f4b99ef28add1eda8e9b20fb379dd2f4c2db0) - 72-Visit Recurrent Schedule (
4 + 24 + 24 + 12 + 8 = 72, 18 Global + 54 Local Visits):- Prelude
L0..L3(4 visits;L3= Global Visit0) - Core Pass 1
L4..L27(24 visits; 6 global) - Core Pass 2
L4..L27(24 visits; 6 global) - Inner Pass 3
L12..L23(12 visits; 3 global) - Coda
L28..L35(8 visits;L31, L35= Global Visits16, 17)
- Prelude
- Differentiable
TwoStreamMHCControllers (10,078,176FP32 params, selected teacher=stage_d):- Bounded-gain Schema v2 (
gain_mode='sigmoid',mhc_schema_version=2), guaranteeing $(1 - g)I + gP \in \mathcal{B}_2$ across all 60 core visits. - Mean Pass-2 Gain (Attn/FFN):
0.00999/0.010009 - Mean Pass-3 Gain (Attn/FFN):
0.004995/0.005
- Bounded-gain Schema v2 (
- 18-Visit Calibrated
VisitAwareDLSAIndexBank(1,769,472projection +36scalar params):- Trained Global Visits:
18/18(skipped=0) - Mean Initial $\rightarrow$ Final Val KL:
0.76318$\rightarrow$0.093037 - Mean Mass Recall @ 4096 / @ 2048:
0.884485/0.756809 - Mean Bucket Runtime Recall:
1.0 - Selector SHA-256:
1bcdd08c11c5d3b3abd50079970cba28bdd80c48d3fb3950eba2269d37632423 - Locked Controller SHA-256:
6e2ce00c4f35624bcae5c9cc33b4065eeed2a224811beb2354e081301b868331(mhc_checkpoint_sha256=912d3cd2cf4002a4217f32bab23b6f05dd33f66619f6d54c74b9d31afe9755c1)
- Trained Global Visits:
- Training Corpus Mode:
Real Multi-Domain Corpus(train_examples=1143,dev_examples=8,split_disjoint=True) - Completion Gates:
{"gate_1_stage_a_state_neutral_and_base_immutable": true, "gate_2_data_split_disjoint": true, "gate_3_real_non_smoke_corpus": true, "gate_4_stage_c_dense_mhc_completed": true, "gate_5_stage_d_omp_evaluated": true, "gate_6_stage_e_all_18_global_visits_distilled": true, "gate_7_clean_export_closure_verified": true, "frozen_backbone_verified": true, "stage_a_state_neutral_passed": true, "stage_e_all_18_visits_calibrated": true, "clean_export_subprocess_verified": true, "production_release_ready": true}
Quickstart
import torch
from load_inference_v03 import load_sparkx_loop72_lsa
model, tokenizer = load_sparkx_loop72_lsa(
repo_or_dir='TassP0lar/Spark-X2.6-4B-Recursive72',
base_repo='XHToken/Spark-X2.6-4B',
base_revision='64ca8f2a295b8ceb2757b9d4749a6558c4759e5b',
recurrence_mode='learned_mhc',
attach_sparse_attention=True,
strict_selector_provenance=True,
)
model.eval()
print(model.execution_manifest())
- Downloads last month
- 1,198