CoolFace
Modelpublic

umjunsik1323/Qwen2.5-Coder-1.5B-roblox

sourceHugging Faceapache-2.0updated 10mo agoView on Hugging Face
2likes37downloads
Model Card

๐ŸŽฎ Qwen2.5 Coder 1.5B Roblox

Roblox LoRA License

A specialized code generation model fine-tuned for Roblox Luau programming


โšก Run in Google Colab (Recommended)

![Open In Colab](https://colab.research.google.com/drive/1Sa3EvZOmmCsYQt7GWv1EcjLGcGJVVlUt?usp=sharing)

No setup required Click the badge above and run the chatbot instantly in your browser.

  • โ€”๐ŸŽฏ Pre-configured environment
  • โ€”๐Ÿ”ฅ GPU-accelerated inference
  • โ€”๐Ÿ’ฌ Interactive chat interface
  • โ€”โฑ๏ธ Ready in ~3 minutes

๐Ÿ“– Overview

Qwen2.5 Coder 1.5B Roblox is a parameter-efficient fine-tuned model specifically designed for Roblox Luau development. Built on top of Qwen2.5-Coder-1.5B-Instruct, this model excels at generating, completing, and understanding Luau code patterns commonly used in Roblox game development.

๐ŸŽฏ What Makes This Special?

  • โ€”๐ŸŽฎ Roblox-Native: Trained exclusively on authentic Luau code from the official Roblox corpus
  • โ€”๐Ÿง  Context-Aware: Understands Roblox-specific APIs, patterns, and best practices

๐Ÿ—๏ธ Model Architecture

ComponentDetails
Base ModelQwen/Qwen2.5-Coder-1.5B-Instruct
Adapter TypeLoRA (Low-Rank Adaptation)
LoRA Rank8
LoRA Alpha32
Target Modulesq_proj, v_proj
Training HardwareTPU v5e-8 (Multi-core)

๐Ÿ“š Training Details

Dataset

  • โ€”Source: Roblox/luau_corpus
  • โ€”Filtering: Quality-filtered for code length (20-5000 chars) and Luau keyword presence
  • โ€”Split: 90% train / 10% validation

Training Configuration

python
{
    "max_length": 1024,
    "batch_size": 4,
    "gradient_accumulation_steps": 32,
    "learning_rate": 3e-5,
    "scheduler": "cosine_annealing",
    "epochs": 1,
    "optimizer": "AdamW"
}

๐Ÿš€ Quick Start

Installation

bash
pip install transformers peft torch

Basic Usage

python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen2.5-Coder-1.5B-Instruct",
    torch_dtype="auto",
    device_map="auto"
)

tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-1.5B-Instruct")

# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "umjunsik1323/Qwen2.5-Coder-1.5B-roblox")

# Generate Luau code
messages = [
    {"role": "system", "content": "You are a Roblox Luau programming expert."},
    {"role": "user", "content": "Create a function to make a part glow"}
]

text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Advanced: Merge and Export

python
# Merge LoRA weights into base model
merged_model = model.merge_and_unload()
merged_model.save_pretrained("./qwen-luau-merged")

๐Ÿ’ก Features

Supported Tasks

  • โ€”โœจ Code Completion: Finish partial Luau scripts intelligently
  • โ€”๐Ÿ”ง Function Generation: Create Roblox-specific functions from descriptions
  • โ€”๐Ÿ“ Code Explanation: Understand and document existing Luau code
  • โ€”๐Ÿ› Error Fixing: Suggest corrections for common Luau mistakes
  • โ€”๐ŸŽฏ API Usage: Generate proper Roblox API calls

Example Prompts

lua
-- Completion
"local function teleportPlayer(player, position)"
โ†’ Generates complete teleportation logic

-- Generation
"Create a tween that smoothly moves a part to a new position"
โ†’ Generates TweenService implementation

-- Context-Aware
"Handle player damage with a cooldown system"
โ†’ Generates debounce pattern with Humanoid health management

๐ŸŽฏ Use Cases

Game Development

  • โ€”Quick prototyping of Roblox mechanics
  • โ€”Learning Luau programming patterns
  • โ€”Code review and suggestions

Education

  • โ€”Teaching Roblox development
  • โ€”Demonstrating best practices
  • โ€”Interactive coding assistance

Productivity

  • โ€”Accelerating development workflows
  • โ€”Reducing boilerplate code
  • โ€”Standardizing team coding styles

โš ๏ธ Limitations

  • โ€”Scope: Specialized for Luau only, not general-purpose programming
  • โ€”Context Window: Limited to 1024 tokens
  • โ€”Recency: Training data may not include latest Roblox API updates
  • โ€”Validation: Always test generated code in Roblox Studio

๐Ÿ“„ Citation

bibtex
@misc{youngseong_kim_2025,
	author       = { Youngseong Kim },
	title        = { Qwen2.5-Coder-1.5B-roblox (Revision 63e9452) },
	year         = 2025,
	url          = { https://huggingface.co/umjunsik1323/Qwen2.5-Coder-1.5B-roblox },
	doi          = { 10.57967/hf/7093 },
	publisher    = { Hugging Face }
}

๐Ÿ“œ License

This LoRA adapter is released under Apache 2.0 License, maintaining compatibility with the base Qwen2.5-Coder model.


๐Ÿค Acknowledgments

  • โ€”Qwen Team at Alibaba Cloud for the base model
  • โ€”Roblox for providing the Luau corpus dataset
  • โ€”Kaggle for providing the computational resources

Made with โค๏ธ for the Roblox Developer Community