Instructions to use spade-rl/SPADE-Qwen3-4B-Games with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use spade-rl/SPADE-Qwen3-4B-Games with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="spade-rl/SPADE-Qwen3-4B-Games") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("spade-rl/SPADE-Qwen3-4B-Games") model = AutoModelForCausalLM.from_pretrained("spade-rl/SPADE-Qwen3-4B-Games", 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 spade-rl/SPADE-Qwen3-4B-Games with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "spade-rl/SPADE-Qwen3-4B-Games" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "spade-rl/SPADE-Qwen3-4B-Games", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/spade-rl/SPADE-Qwen3-4B-Games
- SGLang
How to use spade-rl/SPADE-Qwen3-4B-Games 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 "spade-rl/SPADE-Qwen3-4B-Games" \ --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": "spade-rl/SPADE-Qwen3-4B-Games", "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 "spade-rl/SPADE-Qwen3-4B-Games" \ --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": "spade-rl/SPADE-Qwen3-4B-Games", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use spade-rl/SPADE-Qwen3-4B-Games with Docker Model Runner:
docker model run hf.co/spade-rl/SPADE-Qwen3-4B-Games
SPADE-Qwen3-4B-Games
SPADE checkpoint for the games setting, trained from Qwen/Qwen3-4B-Instruct-2507.
SPADE trains a single model in two roles: an Environment Designer that writes executable environments, and a Reasoning Agent that solves them. The Designer is rewarded for producing environments at the frontier of what the Agent can currently solve, so the curriculum keeps pace with the policy instead of being fixed in advance. See the paper for details.
| Base model | Qwen/Qwen3-4B-Instruct-2507 |
| Setting | games |
| Context length | 262,144 |
Quickstart
We advise you to use the latest version of transformers.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "spade-rl/SPADE-Qwen3-4B-Games"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
prompt = "Give me a short introduction to large language model."
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(**model_inputs, max_new_tokens=16384)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
print(tokenizer.decode(output_ids, skip_special_tokens=True))
Deployment
For deployment, you can use sglang>=0.4.6.post1 or vllm>=0.8.5 to create an
OpenAI-compatible API endpoint:
- SGLang:
python -m sglang.launch_server --model-path spade-rl/SPADE-Qwen3-4B-Games --context-length 262144 - vLLM:
vllm serve spade-rl/SPADE-Qwen3-4B-Games --max-model-len 262144
Note: If you encounter out-of-memory (OOM) issues, consider reducing the context length to a shorter value, such as 32,768.
Best practices
We recommend temperature=0.7, top_p=0.8, top_k=20, min_p=0, following
the sampling guidance on the base model card.
Related artifacts
- Grounding corpora: games | tool use
- All SPADE models, data and generated environments: huggingface.co/spade-rl
- Downloads last month
- 770
Model tree for spade-rl/SPADE-Qwen3-4B-Games
Base model
Qwen/Qwen3-4B-Instruct-2507