Instructions to use NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE") model = AutoModelForMultimodalLM.from_pretrained("NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE
- SGLang
How to use NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE 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 "NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE" \ --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": "NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE" \ --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": "NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE with Docker Model Runner:
docker model run hf.co/NikitaLazarev/Qwen3.5-0.8B-Python-SoftMoE
Qwen3.5-0.8B (e2e pilot) โ Soft MoE expert ยซPython language & PEPsยป
EN
UPDATE: Benchmark results & v2 rebuild
This first build was re-tested in Ivanna Lab (self-hosted LLM model lab,
GitHub) with its benchmarks module:
code2text_python (CodeXGLUE) smoothed BLEU-4 = 1.0289 (150 samples).
A v2 rebuild (alpha=0.1, position=last, RAG-sampled domain prompts) scored 1.0534 โ
see the successor repo Qwen3.5-0.8B-Python-SoftMoE-v2.
A soft MoE domain expert derived from a dense model without any training:
the domain direction dฬ is extracted via activation scans (mean hidden-state
difference between domain and contrast prompts) and baked into the weights with
a rank-one steer patch on output matrices of selected layers. An embedding-space
router (cosine margin) picks this variant instead of the base model.
Patch mode: steer, alpha = 0.2,
layers: [15, 16, 17, 18, 20, 21, 22, 23]. Scan gate AUC = 1.0.
Created with Ivanna Lab โ self-hosted LLM model lab.
Notes
Domain: Python language and PEPs. Scan AUC 1.0. Full eval gate included.
RU
ะัะณะบะธะน MoE-ัะบัะฟะตัั, ะฟะพะปััะตะฝะฝัะน ะธะท ะฟะปะพัะฝะพะน ะผะพะดะตะปะธ ะฑะตะท ะดะพะพะฑััะตะฝะธั (weight-space steering): ะฝะฐะฟัะฐะฒะปะตะฝะธะต ะดะพะผะตะฝะฐ dฬ ะฒัะดะตะปะตะฝะพ ะฐะบัะธะฒะฐัะธะพะฝะฝัะผ ัะบะฐะฝะพะผ (ัะฐะทะฝะพััั ััะตะดะฝะธั hidden states ะดะพะผะตะฝะฝัั vs ะบะพะฝััะฐััะฝัั ะฟัะพะผะฟัะพะฒ) ะธ ะฒัะธัะพ steer-ะฟะฐััะตะผ ะฒ ะฒัั ะพะดะฝัะต ะผะฐััะธัั (down_proj/o_proj/out_proj) ะฒัะฑัะฐะฝะฝัั ัะปะพัะฒ:
- ะฑะฐะทะพะฒะฐั ะผะพะดะตะปั:
Qwen/Qwen3.5-0.8B - ัะตะผะฐ (ะดะพะผะตะฝ): Python language & PEPs โ Python language, PEPs, coding conventions (EN)
- ัะตะถะธะผ:
steer, ฮฑ = 0.2 - ัะปะพะธ: [15, 16, 17, 18, 20, 21, 22, 23]
- ะณะตะนั ัะบะฐะฝะฐ: AUC = 1.0 (PASS)
ะ ะพััะตั (ัะผะฑะตะดะดะธะฝะณะธ + margin) ะฒัะฑะธัะฐะตั ััั ัะฑะพัะบั ะฒะผะตััะพ ะฑะฐะทะพะฒะพะน ะดะปั ะทะฐะฟัะพัะพะฒ ัะตะผั.
ะะตัะพะด
ะะดะพั ะฝะพะฒะปะตะฝะพ Weight-Space Programming (Takeyama et al., MIT CSAIL, 2026): ะฟัะฐะฒะบะธ ะฒะตัะพะฒ ะฑะตะท ะณัะฐะดะธะตะฝัะพะฒ. ะ ะฐััะธัะตะฝะธะต ะปะฐะฑั Ivanna: ะพะฑัะฐัะฝะฐั ะพะฟะตัะฐัะธั โ ะฝะต ะฐะฑะปััะธั ะฟะพะฒะตะดะตะฝะธั, ะฐ steer-ััะธะปะตะฝะธะต ะดะพะผะตะฝะฝะพะณะพ ะฝะฐะฟัะฐะฒะปะตะฝะธั, ะฒัะธัะพะต ะฒ ะฒะตัะฐ (ัะฐะฑะพัะฐะตั ัะฐะผ, ะณะดะต ะธะฝัะตัะตะฝั-ั ัะบะธ ะฝะตะดะพัััะฟะฝั).
Quantized GGUF
Q8_0 quantization lives in the sibling repo Qwen3.5-0.8B-Python-SoftMoE-GGUF.
- Downloads last month
- 251
