Tiny Models
Collection
Tiny models used for testing • 18 items • Updated • 2
How to use inference-optimization/Qwen3.8-1.0B-A0.6B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="inference-optimization/Qwen3.8-1.0B-A0.6B")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("inference-optimization/Qwen3.8-1.0B-A0.6B")
model = AutoModelForCausalLM.from_pretrained("inference-optimization/Qwen3.8-1.0B-A0.6B", 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]:]))How to use inference-optimization/Qwen3.8-1.0B-A0.6B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "inference-optimization/Qwen3.8-1.0B-A0.6B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "inference-optimization/Qwen3.8-1.0B-A0.6B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/inference-optimization/Qwen3.8-1.0B-A0.6B
How to use inference-optimization/Qwen3.8-1.0B-A0.6B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "inference-optimization/Qwen3.8-1.0B-A0.6B" \
--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": "inference-optimization/Qwen3.8-1.0B-A0.6B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "inference-optimization/Qwen3.8-1.0B-A0.6B" \
--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": "inference-optimization/Qwen3.8-1.0B-A0.6B",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use inference-optimization/Qwen3.8-1.0B-A0.6B with Docker Model Runner:
docker model run hf.co/inference-optimization/Qwen3.8-1.0B-A0.6B
This is a tiny version of Qwen/Qwen3.8-2.4T-A95B created for testing and development.
The following parameters were reduced from the original model:
| Parameter | Original | Tiny |
|---|---|---|
| num_hidden_layers | 92 | 8 |
| hidden_size | 8192 | 1024 |
| num_attention_heads | 64 | 8 |
| num_key_value_heads | 4 | 2 |
| head_dim | 256 | 128 |
| num_experts | 512 | 16 |
| num_experts_per_tok | 10 | 2 |
| moe_intermediate_size | 2048 | 1024 |
| shared_expert_intermediate_size | 2048 | 1024 |
| linear_key_head_dim | 128 | 64 |
| linear_num_key_heads | 16 | 4 |
| linear_num_value_heads | 128 | 16 |
| linear_value_head_dim | 128 | 64 |
| mtp_num_hidden_layers | 1 | 0 |
Single safetensors file with packed expert format (experts.gate_up_proj, experts.down_proj) matching the original checkpoint structure. Layer types follow the [linear, linear, linear, full] x 2 pattern from the original.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Qwen3.8-1.0B-A0.6B", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("Qwen3.8-1.0B-A0.6B")
input_ids = tokenizer("According to all known laws", return_tensors="pt").input_ids.to(model.device)
output = model.generate(input_ids, max_new_tokens=20)
print(tokenizer.decode(output[0]))
This model was created using the llm-compressor create-tiny-model claude skill.
Base model
Qwen/Qwen3.8-2.4T-A95B