I want to share what I actually learned building this, because a lot of it was trial and error and I couldn’t find good answers on the forum.
1. RAG beats fine-tuning for Roblox-specific code
My first attempt was just prompting Claude directly. It hallucinated Instance APIs constantly (workspace.CurrentCamera:SetField() — not a thing).
Fine-tuning was overkill.
What actually worked: pgvector RAG over a curated dataset of ~2,000 code chunks pulled from:
- DevForum solution posts in Help and Feedback
- Official creator-docs examples
- Top open-source Roblox repos on GitHub
At request time I embed the user’s prompt, find the 5-8 closest chunks, inject them into the system message. Hallucinations dropped ~90%.
2. Tool use loop beats single-shot generation
For whole-system generation, I had the LLM call tools in a loop:
read_script(path)— fetch existing script contentwrite_script(path, content)— create or updatecreate_instance(className, parent, props)— build hierarchyrun_command(lua)— execute inside Studio
The model plans, checks state, writes, verifies. Instead of one huge output, it is 8-15 smaller steps. Much less hallucination, recoverable mid-task.
3. Roblox Open Cloud for 3D asset upload is painful but works
I generate 3D meshes with Hunyuan3D (via Replicate), then upload via Open Cloud’s asset API. Gotchas:
- Asset must be a valid OBJ with triangulated faces. Hunyuan outputs quads by default, had to add a triangulation pass
- Upload is async — you get back an
operationIdand have to poll/v1/assets/operations/{id}untildone - Returned asset ID is a string, has to be converted for
MeshPart.MeshId = "rbxassetid://..."
Took me a full weekend to get right. Happy to share the exact code if anyone needs it.
4. HttpService with a localhost bridge for dev, Vercel for prod
During development I ran the LLM backend on localhost and the plugin hit http://localhost:3000. Studio’s HttpService allows localhost. For
production I deploy the backend to Vercel and the plugin talks to it over HTTPS.
5. What I would do differently
- Start with tool use from day 1. I wasted 2 weeks on prompt engineering for single-shot generation.
- Build the RAG dataset FIRST, model choice second. Switching Claude to GPT-4 made less difference than adding 500 more chunks.
- Test with real DevForum-style questions, not clean synthetic prompts. Real questions are messy and context-poor.
Happy to answer technical questions about any of this — RAG setup, Open Cloud gotchas, tool use design, prompt structure, cost economics, whatever is
useful. If any of this helps someone else build their own Studio plugin, that is worth the post.
(The plugin itself is in private testing, not taking signups here — this post is about sharing what I learned.)