Instructions to use xguihugging/Qwen3.8-Flash-Next-4layer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xguihugging/Qwen3.8-Flash-Next-4layer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="xguihugging/Qwen3.8-Flash-Next-4layer") 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("xguihugging/Qwen3.8-Flash-Next-4layer") model = AutoModelForMultimodalLM.from_pretrained("xguihugging/Qwen3.8-Flash-Next-4layer", 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 xguihugging/Qwen3.8-Flash-Next-4layer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xguihugging/Qwen3.8-Flash-Next-4layer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xguihugging/Qwen3.8-Flash-Next-4layer", "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/xguihugging/Qwen3.8-Flash-Next-4layer
- SGLang
How to use xguihugging/Qwen3.8-Flash-Next-4layer 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 "xguihugging/Qwen3.8-Flash-Next-4layer" \ --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": "xguihugging/Qwen3.8-Flash-Next-4layer", "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 "xguihugging/Qwen3.8-Flash-Next-4layer" \ --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": "xguihugging/Qwen3.8-Flash-Next-4layer", "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 xguihugging/Qwen3.8-Flash-Next-4layer with Docker Model Runner:
docker model run hf.co/xguihugging/Qwen3.8-Flash-Next-4layer
Qwen3.8-Flash-Next-4layer (CI slice)
Not a usable model. This is a truncated slice of Qwen/Qwen3.8-Flash-Next for GPU CI in SkyRL. It checks numerical parity between HF, vLLM and the Megatron bridge. It is not meant for inference or fine-tuning.
Contents
- Text layers 0-3 of the original model (3 GatedDeltaNet + 1 gated attention with the QSA indexer), 512-expert MoE, gated hyper-connections, and the final hyper-connection mixer.
- The embedding, LM head and vision tower, copied byte-for-byte from the original weights.
- MTP layers removed.
- PLE n-gram table replaced with a small random table (
ngram_vocab_size_base=2048, rows ~ N(0, 0.0075)) in place of the released ~51B-parameter table.ngram_heads_vocab_sizesandngram_heads_offsetsare recomputed to match, so HF, vLLM and Megatron hash identically.
How it was built
python examples/train/qwen3_8_flash_next/make_slice.py <Qwen3.8-Flash-Next> <dst> --num-layers 4
Built with the SkyRL script examples/train/qwen3_8_flash_next/make_slice.py (default --ple-vocab-base 2048, seed 0).
Usage in SkyRL tests
export SKYRL_QWEN38_4LAYER_PATH=<local path or this repo id>
The tests apply Qwen3.8-specific settings only when the path contains qwen3.8-flash-next (case-insensitive).
License
Same as the original model: Qwen Community License 1.0 (see LICENSE).
- Downloads last month
- 117
Model tree for xguihugging/Qwen3.8-Flash-Next-4layer
Base model
Qwen/Qwen3.8-Flash-Next