Instructions to use wesjos/Spark-x2.6-4B-CuteHuman with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wesjos/Spark-x2.6-4B-CuteHuman with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wesjos/Spark-x2.6-4B-CuteHuman", 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("wesjos/Spark-x2.6-4B-CuteHuman", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wesjos/Spark-x2.6-4B-CuteHuman with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wesjos/Spark-x2.6-4B-CuteHuman" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wesjos/Spark-x2.6-4B-CuteHuman", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wesjos/Spark-x2.6-4B-CuteHuman
- SGLang
How to use wesjos/Spark-x2.6-4B-CuteHuman 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 "wesjos/Spark-x2.6-4B-CuteHuman" \ --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": "wesjos/Spark-x2.6-4B-CuteHuman", "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 "wesjos/Spark-x2.6-4B-CuteHuman" \ --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": "wesjos/Spark-x2.6-4B-CuteHuman", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wesjos/Spark-x2.6-4B-CuteHuman with Docker Model Runner:
docker model run hf.co/wesjos/Spark-x2.6-4B-CuteHuman
Spark-X2.6-4B · CuteHuman
The emoji-first chat persona, fine-tuned onto Spark-X2.6-4B — a 4.11 B on-device model that answers like a person, not a manual.
4.11 B params · bf16, 7.66 GiB in one shard · 1 M context · text only · Apache-2.0
💾 Want the same persona at 2.4 GB? → Spark-X2.6-4B-CuteHuman-GGUF
The identical fine-tune, quantized:
Q4_K_Mat 2.42 GiB,Q8_0at 4.07 GiB. This repo is the full bf16 checkpoint (7.66 GiB, onemodel.safetensors).
🖼 Demo
Both shots are the same session in a chat client with the CoT trace collapsed — the WORK row is the
reasoning panel, the ANSWER row is the reply. Turn it on to see the thinking trace.
中文 · yoho → 在干什么 → 写个代码,绘制一个星星 → 你的优点是什么
Greeting, small talk, then a matplotlib star. Emoji and ~ come out unprompted.
中文 · “yoho~ 今天也是可爱的一天呢!😊” → 五角星 matplotlib 代码 → “我的优点就是喜欢陪你聊天啦~”
English · hello → what are u doin → 8.2×9.12/2.3 = → build mlp in python numpy
Small talk, then exact-decimal arithmetic (74.784, and it says so out loud), then a full NumPy MLP.
English · “Oh hi~ 😊 What's up? I'm here whenever you need a chat!” →
8.2 × 9.12 = 74.784 → NumPy MLP
📐 Specs
| Base | XHToken/Spark-X2.6-4B (Apache-2.0) |
| Architecture | Spark2_5ForCausalLM · 36 layers — 9 full-attention + 27 sliding-attention (window 512) · hidden 2560 |
| Attention | 16 heads / 4 KV heads · head_dim 256 · partial RoPE 0.25 on full-attention layers |
| Parameters | 4,112,079,360 (bf16, measured from the safetensors header) · 335.5 M embedding / 3.78 B non-embedding |
| On disk | 1 shard, 7.66 GiB |
| Context | 1,048,576 native (max_position_embeddings) · tokenizer advertises 131,072 |
| Vocab | 131,072 |
| KV cache | 36.0 KiB/token at full attention (9 full layers) — 4.50 GiB at 128 K, 36 GiB at 1 M |
🚀 Quickstart
This repo's
tokenizer_config.jsondeclarestokenizer_class: "TokenizersBackend", which needstransformers>=5.0.0. Ontransformers==4.57.1(the version upstream pins)AutoTokenizerraisesValueError: Tokenizer class TokenizersBackend does not exist or is not currently imported.The upstream checkpoint's own tokenizer config loads fine on 4.57.1 — this repo's does not.
pip install "transformers>=5.0.0" jinja2 # jinja2 is needed for apply_chat_template
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL = "wesjos/Spark-x2.6-4B-CuteHuman"
tokenizer = AutoTokenizer.from_pretrained(MODEL, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
MODEL, trust_remote_code=True, dtype=torch.bfloat16, device_map="auto"
)
messages = [{"role": "user", "content": "yoho"}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, tokenize=True,
return_dict=True, return_tensors="pt",
enable_thinking=False, # chit-chat: no thinking trace
).to(model.device)
out = model.generate(**inputs, max_new_tokens=256, do_sample=True,
temperature=1.0, top_p=0.95, top_k=-1)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
llama.cpp — native spark2_5 support landed in b10828;
v0.9.0 has it too.
llama-cli -m Spark-x2.6-4B-CuteHuman.Q4_K_M.gguf -p "yoho" -n 256
💡 Notes
- The persona lives in the weights. The chat template is byte-identical to upstream's — default system
prompt is
"you are a helpful assistant.", with no persona baked in — so an empty system prompt reproduces the screenshots. - Emoji and kaomoji are the default register. The habit is a style, not a rule: a system prompt like 「少用表情,正常说话」 / "tone the emoji down" is enough to soften it.
- Thinking is on by default. The template opens a
<think>block and supportsreasoning_effortlow/high. For chit-chat passenable_thinking=False, otherwise the trace eats the budget. - The GGUF carries its own chat template (verified inside the file's KV block, and it matches this repo's
chat_template.jinjabyte for byte) — no--chat-template-fileneeded.
⚠️ Limitations
- 4 B knowledge ceiling. Facts, math and long reasoning are base-model level — this is a persona fine-tune, not a capability upgrade.
- The screenshots were taken under a chat client that is not shipped here. This repo has no
webui/directory, and the client in the shots showsWORK/ANSWER/STEPS/cachedlabels that appear nowhere in the siblingSpark-x2.6-4B-HTMLWebUI. - Tool use is inherited and unaudited. The template carries the upstream tool-call and
toolrole handling; nothing here was probed for refusal behaviour. - No training metadata ships with this repo — no data size, no steps, no rank. Ask the owner if you need it.
📄 License
Apache-2.0, inherited from the Spark-X2.6 model series.
- Downloads last month
- 792