Instructions to use Akicou/Qwen3.8-Flash-Next-REAM-60Pct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Akicou/Qwen3.8-Flash-Next-REAM-60Pct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Akicou/Qwen3.8-Flash-Next-REAM-60Pct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Akicou/Qwen3.8-Flash-Next-REAM-60Pct") model = AutoModelForCausalLM.from_pretrained("Akicou/Qwen3.8-Flash-Next-REAM-60Pct", 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 Akicou/Qwen3.8-Flash-Next-REAM-60Pct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Akicou/Qwen3.8-Flash-Next-REAM-60Pct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Akicou/Qwen3.8-Flash-Next-REAM-60Pct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Akicou/Qwen3.8-Flash-Next-REAM-60Pct
- SGLang
How to use Akicou/Qwen3.8-Flash-Next-REAM-60Pct 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 "Akicou/Qwen3.8-Flash-Next-REAM-60Pct" \ --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": "Akicou/Qwen3.8-Flash-Next-REAM-60Pct", "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 "Akicou/Qwen3.8-Flash-Next-REAM-60Pct" \ --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": "Akicou/Qwen3.8-Flash-Next-REAM-60Pct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Akicou/Qwen3.8-Flash-Next-REAM-60Pct with Docker Model Runner:
docker model run hf.co/Akicou/Qwen3.8-Flash-Next-REAM-60Pct
Qwen3.8-Flash-Next-REAM-60Pct
REAM-compressed version of Qwen/Qwen3.8-Flash-Next, produced with
Akicou/ream, a REAM/REAP-style MoE compression framework.
Method
Router Expert Activation Merging (REAM). The model is calibrated on the built-in hardcoded prompt set, then experts are grouped by gated similarity (half hidden-state, half router distribution) and merged with saliency-weighted averaging. 40% of the routed experts are removed, so each layer goes from 512 experts down to 308. The router is shrunk to match, keeping only the centroid rows.
Shared experts, attention, n-gram embeddings, and dense layers are left untouched. Only routed experts are merged.
How it was created
python examples/compress_sequential.py \
--model Qwen/Qwen3.8-Flash-Next \
--output ./qwen4-ream-60 \
--target-ratio 0.60 \
--samples 100 \
--max-seq-len 512 \
--batch-size 4 \
--max-tokens 2048 \
--cpu-merge \
--fast-merge \
--seed 42
Hardware: 6× NVIDIA H100 SXM 80GB
Note
This is an experimental release. It has not been benchmarked. The model uses trust_remote_code=True, same as the base model.
Basic usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Akicou/Qwen3.8-Flash-Next-REAM-60Pct"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
prompt = "Explain the concept of reinforcement learning."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tokenizer.decode(output[0], skip_special_tokens=True))
- Downloads last month
- 259