Instructions to use sepsy070716/Qwen3.5-4B-A3B-Student-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sepsy070716/Qwen3.5-4B-A3B-Student-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sepsy070716/Qwen3.5-4B-A3B-Student-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sepsy070716/Qwen3.5-4B-A3B-Student-v2") model = AutoModelForCausalLM.from_pretrained("sepsy070716/Qwen3.5-4B-A3B-Student-v2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sepsy070716/Qwen3.5-4B-A3B-Student-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sepsy070716/Qwen3.5-4B-A3B-Student-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sepsy070716/Qwen3.5-4B-A3B-Student-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sepsy070716/Qwen3.5-4B-A3B-Student-v2
- SGLang
How to use sepsy070716/Qwen3.5-4B-A3B-Student-v2 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 "sepsy070716/Qwen3.5-4B-A3B-Student-v2" \ --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": "sepsy070716/Qwen3.5-4B-A3B-Student-v2", "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 "sepsy070716/Qwen3.5-4B-A3B-Student-v2" \ --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": "sepsy070716/Qwen3.5-4B-A3B-Student-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sepsy070716/Qwen3.5-4B-A3B-Student-v2 with Docker Model Runner:
docker model run hf.co/sepsy070716/Qwen3.5-4B-A3B-Student-v2
Qwen3.5-4B-A3B-Student-v2
A text-only sparse-MoE release candidate built as a practical local alternative to Qwen3.5-4B. It has 4.0B total parameters and 3.0B active parameters per token. The initialization preserves Qwen3.5-2B behavior, while adding output-neutral trainable capacity for later Qwen3.5-4B distillation.
This is an independently measured research release. It is not an official Qwen model and does not include vision.
Architecture
| Property | Value |
|---|---|
| Total parameters | 3,995,901,760 |
| Active parameters/token | 2,995,560,256 |
| Transformer layers / hidden size | 24 / 2,048 |
| Experts / selected per token | 2 / 1 |
| Shared / routed intermediate width | 6,912 / 6,784 |
| Vision tower | No |
| Weight dtype | BF16 |
Each MoE layer initially computes one half of the original Qwen3.5-2B dense MLP
through the shared path and one half through the selected routed expert. The
two routed experts begin functionally identical. Additional neurons have random
gate/up projections and zero down projections, making them output-neutral but
trainable. Exact conversion metadata is in conversion_manifest.json.
Evaluation
All reported results were produced locally on an Apple M4 with 32GB unified
memory. Raw JSON reports are included in evaluation/.
Chat and sentence generation
The fixed gate contains 60 prompts: 10 each in Korean, English, Chinese, Japanese, Spanish, and German. It covers facts, arithmetic, translation, instruction following, and free-form sentence generation.
| Result | Score |
|---|---|
| Non-degenerate/correct automatic checks | 60 / 60 |
| Languages meeting the gate | 6 / 6 |
Six chemical-formula answers used the correct Unicode spelling H₂O; the
scorer normalizes Unicode subscripts before comparison.
Multilingual held-out LM loss
Four held-out FineWeb/FineWeb2 documents per language, 128 tokens per document:
| Model | Mean loss | Relative to Qwen3.5-4B |
|---|---|---|
| Qwen3.5-4B | 2.9399 | 1.000x |
| This model | 3.2085 | 1.091x |
| Qwen3.5-2B | 3.2085 | 1.091x |
Standard benchmark development subset
EleutherAI lm-evaluation-harness==0.4.12, zero-shot, BF16, first 100 examples
per task. These limited results are development indicators, not full-task
benchmark claims.
| Model | ARC-Easy acc_norm | HellaSwag acc_norm | Mean |
|---|---|---|---|
| Qwen3.5-4B | 0.81 | 0.68 | 0.745 |
| This model | 0.73 | 0.62 | 0.675 |
The subset mean is 90.6% of the Qwen3.5-4B teacher mean.
Local service gate
The included FastAPI service completed 20/20 consecutive non-streaming
POST /v1/chat/completions requests:
| Metric | Value |
|---|---|
| Successful requests | 20 / 20 |
| Mean latency | 2.60 s |
| p95 latency | 3.57 s |
| MPS allocated memory | 7.62 GB |
Requests generated up to 16 new tokens. See evaluation/openai_service_20.json.
Transformers usage
Use Transformers 5.13.0 or another version that provides
Qwen3_5MoeForCausalLM:
import torch
from transformers import AutoTokenizer, Qwen3_5MoeForCausalLM
model_id = "sepsy070716/Qwen3.5-4B-A3B-Student-v2"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = Qwen3_5MoeForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
)
messages = [{"role": "user", "content": "대한민국의 수도는 어디인가요?"}]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
enable_thinking=False,
return_tensors="pt",
return_dict=True,
).to(model.device)
output = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Reproduction and service
research_code/ contains the converter, multilingual loss comparison, 60-prompt
gate and scorer, plus the local OpenAI-compatible service and its 20-request
test. The service implements GET /health, GET /v1/models, and non-streaming
POST /v1/chat/completions.
Limitations
- Current quality is inherited primarily from Qwen3.5-2B; the extra capacity has not yet received large-scale continued pretraining or teacher distillation.
- The 100-example ARC-Easy/HellaSwag figures are small development subsets and have substantial sampling uncertainty. Run the full tasks before making publication or production claims.
- This model is text-only and cannot replace the original model's vision path.
- The included server is a single-process local research server. It has no authentication, TLS, streaming, tool calling, or multi-worker support.
- Apply the same safety, bias, privacy, and factuality evaluation required for any deployment of the upstream Qwen models.
License and attribution
Released under Apache-2.0, following the included upstream license. Derived from Qwen3.5-2B weights and evaluated against Qwen3.5-4B. Qwen model names and trademarks belong to their respective owners.
- Downloads last month
- 91