Skip to content
Other

Qwen3.8-27B Fable-Kawaii QLoRA

adapter for 3D scene generation

2 min readupdated

This QLoRA (small lightweight add-on for efficient model training) adapter is trained on Qwen/Qwen3.8-27B using the Fable-Kawaii dataset. The model learns to take a Chinese text scene description, plan its structure, and generate code as a single-file Three.js HTML. The author notes this is a lightweight 30-step test checkpoint for testing the pipeline, which demonstrates functionality but still requires fine-tuning for fully stable generation of complex HTML files. The adapter will be useful for developers and researchers experimenting with generative code and fine-tuning large language models.

Key features

  • Base model: Qwen3.8-27B, quantized via 4-bit NF4 with double quantization (requires about 16.7 GB VRAM).
  • Training parameters: r=16, alpha=32, dropout=0.05, trained 124.7M parameters (0.45% of the total volume).
  • Dataset: Fable-Kawaii Chinese SFT (1026 training and 114 validation examples).
  • Stability: A lower learning rate (2e-5) was used instead of 1e-4, which the author reports breaks generation in the base model.

What you can do

  • Run inference: Load the adapter on top of the base Qwen model via the peft library to generate creative code and descriptions.
  • Test prompts: Try setting up a miniature diorama scenario or scene using a Three.js expert system prompt.
  • Continue training: Use the published configuration and dataset for full training of 300–600 steps with 8K+ context.

Example

import torch
from transformers import AutoTokenizer, BitsAndBytesConfig, Qwen3_5ForConditionalGeneration
from peft import PeftModel

bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
                         bnb_4bit_use_double_quant=True,
                         bnb_4bit_compute_dtype=torch.bfloat16)
model = Qwen3_5ForConditionalGeneration.from_pretrained(
    "Qwen/Qwen3.8-27B", quantization_config=bnb, device_map={"": 0},
    dtype=torch.bfloat16)
model = PeftModel.from_pretrained(model, "dya/Qwen3.8-27B-Fable-Kawaii-QLoRA")

tok = AutoTokenizer.from_pretrained("Qwen/Qwen3.8-27B")
prompt = tok.apply_chat_template(
    [{"role": "system", "content": "你是一位擅长 Three.js 微缩场景的创意编程专家。"},
     {"role": "user", "content": "做一个雨后的卵石海湾微缩沙盘,带一只滨鹬。"}],
    tokenize=False, add_generation_prompt=True)
out = model.generate(**tok(prompt, return_tensors="pt").to(model.device),
                     max_new_tokens=2048, do_sample=True, temperature=0.8)
print(tok.decode(out[0], skip_special_tokens=True))
Read moreDetails
• Hardware requirements: about 16.7 GB VRAM, training was performed on an A800-80G card.
• Metrics: training loss dropped to an average of 14.86 at lr=2e-5.
• Limitations: 30 steps and 4K context lead to example truncation; the model has learned only the initial structure and general style.
• Dependencies: transformers>=5.8, torch>=2.4 (it is recommended to avoid transformers version 5.24 due to a strict torch>=2.6 requirement).
Discuss Telegram 1 13

Will it run?

Runs in 4-bit

Full precision does not fit, a quantised version does: quality barely changes down to 8 bits, more noticeably at 4 bits.

  • BF16weights 52 GB · ready files58 GB
  • FP8 / INT8recommendedweights 26 GB29 GB
  • 4-bitweights 15 GB17 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

This is a LoRA: counted together with its base model Qwen3.8-27B.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # dya/Qwen3.8-27B-Fable-Kawaii-QLoRA
    # ===== Tokens: paste yours between the quotes =====
    export HF_TOKEN=""        # huggingface.co/settings/tokens, for gated models
    # ==========================================
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download Qwen/Qwen3.8-27B --local-dir ~/models/Qwen3.8-27B
    hf download dya/Qwen3.8-27B-Fable-Kawaii-QLoRA --local-dir ~/models/Qwen3.8-27B-Fable-Kawaii-QLoRA
    # The model is in ~/models. How to run it is in the model card (link above).
    Add more LoRAs to Qwen3.8-27B
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b42from December 2, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

Requires the base model

Qwen/Qwen3.8-27B

This model is a LoRA / adapter. Download the base model first, then load this one on top.

New posts about versions of Qwen3.8-27B (quants, finetunes, LoRAs) will show up under the bell.

Quantised versions 12All on Hugging Face
Fine-tunes 12All on Hugging Face
LoRAs and adapters 2All on Hugging Face

About the model

dya/Qwen3.8-27B-Fable-Kawaii-QLoRA
Author
dya
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

131

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments