Skip to content

THUSI-Lab

GameDojo-4B

A 4.2B computer-use agent (it acts on a screen; not for everyday chat) by THUSI-Lab that uses tools such as web search, can think before answering and reads images.

Tools Thinking Vision
Downloads
6,816 downloads last month
Likes
6 likes
Uploaded
Uploaded 29 Nov 2026

Get it in Zero1LLM

Then open Explore in the app and search for:

Parameters
4,539,265,536 (4.5B)
Context length
262,144 tokens
Architecture
qwen35
Task
image-text-to-text
Released
21 Nov 2026
Last updated
2 Dec 2026

This is bartowski's upload of THUSI-Lab/GameDojo-4B, which is based on Qwen/Qwen3.5-4B.

Tools

Uses tools, so web search and the browser work best with it.

Thinking

Can think step by step before it answers.

Vision

Reads images: photos, screenshots, scanned pages.

Each version is the same model stored at a different precision: smaller files use less memory and lose a little quality.

VersionFile sizeFileSHA-256
IQ2_M1.59 GBTHUSI-Lab_GameDojo-4B-IQ2_M.gguf
Q2_K1.73 GBTHUSI-Lab_GameDojo-4B-Q2_K.gguf
IQ3_XXS1.91 GBTHUSI-Lab_GameDojo-4B-IQ3_XXS.gguf
Q3_K_S1.97 GBTHUSI-Lab_GameDojo-4B-Q3_K_S.gguf
IQ3_XS1.98 GBTHUSI-Lab_GameDojo-4B-IQ3_XS.gguf
Q3_K_M2.08 GBTHUSI-Lab_GameDojo-4B-Q3_K_M.gguf
Q3_K_L2.18 GBTHUSI-Lab_GameDojo-4B-Q3_K_L.gguf
IQ3_M2.27 GBTHUSI-Lab_GameDojo-4B-IQ3_M.gguf
Show all 22 versions
VersionFile sizeFileSHA-256
IQ4_XS2.43 GBTHUSI-Lab_GameDojo-4B-IQ4_XS.gguf
Q4_K_S2.55 GBTHUSI-Lab_GameDojo-4B-Q4_K_S.gguf
Q4_02.63 GBTHUSI-Lab_GameDojo-4B-Q4_0.gguf
IQ4_NL2.72 GBTHUSI-Lab_GameDojo-4B-IQ4_NL.gguf
Q4_K_M2.74 GBTHUSI-Lab_GameDojo-4B-Q4_K_M.gguf
Q4_12.84 GBTHUSI-Lab_GameDojo-4B-Q4_1.gguf
Q4_K_L2.91 GBTHUSI-Lab_GameDojo-4B-Q4_K_L.gguf
Q5_K_S3.09 GBTHUSI-Lab_GameDojo-4B-Q5_K_S.gguf
Q5_K_M3.29 GBTHUSI-Lab_GameDojo-4B-Q5_K_M.gguf
Q6_K_S3.54 GBTHUSI-Lab_GameDojo-4B-Q6_K_S.gguf
Q6_K3.69 GBTHUSI-Lab_GameDojo-4B-Q6_K.gguf
Q6_K_L3.85 GBTHUSI-Lab_GameDojo-4B-Q6_K_L.gguf
Q8_04.48 GBTHUSI-Lab_GameDojo-4B-Q8_0.gguf
BF168.42 GBTHUSI-Lab_GameDojo-4B-bf16.gguf

Vision add-on (needed to read images): mmproj-THUSI-Lab_GameDojo-4B-f16.gguf, 672.4 MB

Model class
Qwen3_5ForConditionalGeneration
Model type
qwen3_5_text
Layers
32
Hidden size
2560
Attention heads
16
Key/value heads
4
Vocabulary
248,320
Context length
262,144 tokens
Weights
bfloat16
Vision encoder
Included (vision_config)

Papers the model's Hugging Face page links to (the model's own report and papers it cites).

Datasets listed in the model card

News

Overview

GameDojo-4B is a vision-language model for video game boss encounters. It takes game observations and task context and generates keyboard and mouse actions for the GameDojo computer-use (CUA) interface. Each action chunk covers 200 ms of game control.

GameDojo provides 120 boss encounters across 20 game environments, split evenly between 2D and 3D. Its CUA and Semantic interfaces expose different levels of action abstraction. Real-time and time-paused modes let researchers vary whether the simulation advances during inference.

Training

We fine-tuned Qwen3.5-4B with supervised learning on a balanced 240-hour subset of GameDojo-Data. The subset contains 40 minutes of gameplay for each of the 120 bosses at each of three difficulty levels (Easy, Medium, and Hard).

Evaluation

We evaluate GameDojo-4B through CUA in both timing modes at all three difficulty levels. We report average win rate and average progress. A win requires defeating the boss, and progress measures the fraction of total boss health removed during the episode.

Download

The checkpoint is distributed as BF16 Safetensors. Download it together with its configuration and processor files.

hf download THUSI-Lab/GameDojo-4B --local-dir GameDojo-4B

Load with Transformers

import torch
from transformers import AutoProcessor, Qwen3_5ForConditionalGeneration

repo_id = "THUSI-Lab/GameDojo-4B"
processor = AutoProcessor.from_pretrained(repo_id)
model = Qwen3_5ForConditionalGeneration.from_pretrained(
    repo_id, dtype=torch.bfloat16, device_map="auto"
).eval()

Use the bundled chat_template.jinja to format observations and task context. Pass the generated actions to the GameDojo CUA executor to advance the encounter.

Single-frame CUA example

This example uses the Terraria King Slime CUA system prompt shown in the GameDojo supplementary material. The conversation contains this system prompt and one image-only user turn.

System prompt for King Slime

You are an experienced PC game player, proficient in keyboard and mouse operations. You are playing "Pixel Arena: Sword and Bow". Based on the current game screen and the corresponding historical trajectory, plan the next 200ms of actions, consisting of 6 steps. Each step is spaced 33ms apart. Every step lasts 33ms from its start time until the next step begins.

Output Format
<|action_start|>X Y Z ; k1 k2 ; k3 ; k4 ; k5 ; k6 ; k7<|action_end|>

Explanation
1. Mouse Movement: Relative integers X, Y in [-1000, 1000] (X>0 right, Y>0 down) and scroll Z in [-5, 5] (Z>0 up).
2. Key Sequence: 6 groups separated by ;; space-separated keys within each group (at most 4 keys/group). Leave an empty group blank while keeping ;. Keys listed in consecutive groups stay held; unlisted keys are released.
3. Output only one plain line matching the format, with no line breaks or quotes.
Key Naming Rules: Capital letters (W, A), capitalized names (Space, Shift), mouse buttons (LB, RB).

Game: Side-view 2D arena with two wooden platforms. Empty the boss's health bar within 300 s without losing all health.
Controls (only these keys are active): A/D move left/right; Space jump/fly; S drop through platform; J/LB use weapon; Q swap sword/bow; E shoot bow at crosshair; RB swing sword.
Mouse: X/Y move crosshair (1000 = full screen width/height); bow shoots toward crosshair.
Boss: King Slime: Giant gel creature that leaps to crush you, sheds small blobs when hit, and teleports near you. Moves: 1. Leap; 2. Teleport; 3. Gel Spawns.
Health bars and other status are shown on the screen; read them yourself.

Input frame

The source frame below is resized to 854 脳 480 and JPEG-encoded at quality 90 before inference.

Terraria King Slime encounter in GameDojo

Model output

The published BF16 checkpoint generated this reply with its non-thinking chat template. The run used Transformers 5.24.0 on Apple MPS, sampling at temperature 1.0 with top-p 1.0, no top-k cutoff, and a 256-token limit. Generation stopped upon emitting <|action_end|>.

The mouse deltas move the crosshair left and down, with no scroll. Each of the six steps holds E to shoot the bow and S to drop through the platform.

Load processor and model as shown above. Save the system prompt as king_slime_cua_prompt.txt and the source image as king-slime.jpg.

from io import BytesIO
from pathlib import Path

from PIL import Image
import torch

system_prompt = Path("king_slime_cua_prompt.txt").read_text(encoding="utf-8").rstrip("\n")
with Image.open("king-slime.jpg") as source:
    encoded = BytesIO()
    resized = source.convert("RGB").resize((854, 480), Image.Resampling.LANCZOS)
    resized.save(encoded, format="JPEG", quality=90)
frame = Image.open(encoded).convert("RGB")

messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": [{"type": "image", "image": frame}]},
]
inputs = processor.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(model.device)

torch.manual_seed(42)
with torch.inference_mode():
    output = model.generate(
        **inputs,
        do_sample=True,
        temperature=1.0,
        top_p=1.0,
        top_k=0,
        max_new_tokens=256,
        stop_strings=["<|action_end|>"],
        tokenizer=processor.tokenizer,
    )
new_ids = output[0, inputs["input_ids"].shape[-1]:].tolist()
print(processor.decode(new_ids, skip_special_tokens=False, clean_up_tokenization_spaces=False))

Citation

@article{zhang2026gamedojo,
  title   = {GameDojo: Benchmarking Real-Time Interactive Agents in Video Games},
  author  = {Zhang, Kuan and Yang, Zhihao and Chen, Yukun and Yin, Xingyiliang and Ouyang, Mingyu and Su, Yue and Wu, Xiangnan and Li, Jiaming and Chen, Longze and Luo, Run and Chen, Zirong and Wang, Lu and Li, Yiming},
  journal = {arXiv preprint arXiv:2611.30771},
  year    = {2026}
}

Related Work

Explore our series on generalist game agents, spanning surveys, scalable training, long-horizon real-time agents, and interactive evaluation. Follow the GitHub repositories for new papers, code, and updates.

Towards Generalist Game Agents

Our TMLR survey of foundation models in virtual worlds connects datasets, models, agent harnesses, and benchmarks for generalist game agents.

Project Page 路 GitHub 路 Paper 路 Hugging Face Paper

@article{zhang2026towards,
  title={Towards Generalist Game Agents: A Survey of Foundation Models in Virtual Worlds},
  author={Kuan Zhang and Dongchen Liu and Qiyue Zhao and Tianyu Xin and Yue Su and Haisheng Wang and Han Yin and Hongbo Ma and Peize Li and Tianjun Gu and Xiangnan Wu and Xinran Zhang and Yongxuan Li and Zirong Chen and Yiming Li},
  journal={Transactions on Machine Learning Research},
  issn={2835-8856},
  year={2026},
  url={https://openreview.net/forum?id=SDkEq8Fzvl}
}

GameScaling

GameScaling studies how gameplay data, world diversity, and model size scale continued pre-training for keyboard-and-mouse agents across virtual worlds.

Project Page 路 GitHub 路 Hugging Face Models 路 Paper

@article{zhang-scaling-games,
  title = {Scaling in Games: Continued Pre-Training for Embodied Agents in Diverse Virtual Worlds},
  author = {Zhang, Kuan and Chen, Yukun and Yang, Zhihao and Su, Yue and Wu, Xiangnan and Chen, Zirong and Luo, Run and Hou, Jinkun and Tan, Tao and Zheng, Yinhe and Li, Yiming},
  journal = {arXiv preprint arXiv:2610.28698},
  year = {2026}
}

Gamer

A generalist vision-language-action model for long-horizon, real-time gameplay, combining keyboard-and-mouse control, sparse reasoning, persistent memory, and online reinforcement learning.

Project Page 路 GitHub 路 Paper 路 Hugging Face Paper

@article{luo-gamer,
  title = {Gamer: A Generalist Vision-Language-Action Foundation Model for Long-Horizon Real-Time Game Agent},
  author = {Luo, Run and Zhang, Kuan and Deng, Qi and Chen, Yukun and Yang, Zhihao and Zhang, Yufei and Hu, Renrong and Zhang, Yi and Ma, Guiyu and Fan, Tianyu and Chen, Longze and Sun, Hao and Li, Jiaming and Yang, Jiaming and Liu, Xiaohao and Tan, Tao and Wang, Minzheng and Jia, Hangtian and Yuan, Shuai and Wang, Lvdi and Liu, Xiao and Ma, Chao and Zou, Yuting and Zheng, Yinhe and Xia, Xiaobo and Jiang, Dawei and Ren, Shaoqing},
  journal = {arXiv preprint arXiv:2611.18397},
  year = {2026}
}

On Hugging Face

Everything on this page comes from these pages and is refreshed every few hours; Hugging Face always has the latest.