---
title: "Training a coding model to paint watercolours with TRL and OpenEnv"
description: "An open reproduction of Surya Narreddi's watercolour-painting language model trains Qwen3.5-35B-A3B with GRPO in TRL to write p5.brush JavaScript, using an OpenEnv environment that renders sketches in headless Chromium."
url: "https://swe.quest/articles/training-a-coding-model-to-paint-watercolours-with-trl-and-openenv-0c7283feb6a9fe31"
canonical: "https://huggingface.co/blog/train-to-paint-with-code"
source: "Hugging Face"
published: "2026-09-03"
difficulty: "hard"
kind: "Case study"
reading_minutes: 22
tags: ["model-training","llms","evals","computer-vision"]
---

# Training a coding model to paint watercolours with TRL and OpenEnv

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2026-09-03, 22 min read, Case study. Original: [https://huggingface.co/blog/train-to-paint-with-code](https://huggingface.co/blog/train-to-paint-with-code)

## Summary

An open reproduction of Surya Narreddi's watercolour-painting language model trains Qwen3.5-35B-A3B with GRPO in TRL to write p5.brush JavaScript, using an OpenEnv environment that renders sketches in headless Chromium. Restricted to 10 of the library's 47 methods, the policy is scored on a gate, code length, a Qwen3-VL pairwise judge comparing against a hand-rated pool of 178 model-generated paintings, and the HPSv3 preference model. Three reward mixes all learned, with mean group reward rising by +0.13 to +0.27. Early flat runs were fixed by four trainer changes: learning rate 2e-5 to 5e-5, constant\_with\_warmup scheduling, scale\_rewards=none, and all-linear LoRA targets so the MoE projections actually got adapters. The environment, pool, scripts and models are all published.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Computer vision](https://swe.quest/tags/computer-vision.md) (AI & ML)

## Prerequisites

- reinforcement learning for LLMs ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- GRPO
- LoRA fine-tuning ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- reward models

## Keywords

TRL, OpenEnv, GRPO, p5.brush, HPSv3, Qwen3.5-35B-A3B, Qwen3-VL, LoRA

## Related posts

- [CoderForge-Preview: SOTA open dataset for training efficient coding agents](https://swe.quest/articles/coderforge-preview-sota-open-dataset-for-training-efficient-coding-agents-83e1f3c7a7bdb67a.md): Together AI · 2026-02-25 · Hard · 14 min read · Model training, AI for coding, AI agents, Evaluation, LLMs
  CoderForge-Preview is an open dataset of 258K test-verified coding agent trajectories (155K passing) covering 51K tasks across 1,655 repositories from R2E-Gym, SWE-Smith and SWE-Rebench.
- [Codex is Open Sourcing AI models](https://swe.quest/articles/codex-is-open-sourcing-ai-models-fa17d18abe8d9c1f.md): Hugging Face · 2025-12-11 · Medium · 18 min read · Model training, AI agents, AI for coding, Evaluation
  Hugging Face Skills, a repository of agent instructions loaded via AGENTS.md (or Claude Code Skills), lets OpenAI Codex run end-to-end fine-tuning experiments on Hugging Face Jobs.
- [Palette: teaching a small model to build decks in your design language](https://swe.quest/articles/palette-teaching-a-small-model-to-build-decks-in-your-design-language-51907d490a9378a1.md): Hugging Face · 2026-11-03 · Medium · 9 min read · Model training, LLMs, Evaluation
  Palette fine-tunes a 20B open-weight model with a single LoRA adapter to generate slide decks in a specific design language (IBM Design Language), splitting the work into a designer role that writes a structured JSON brief and a coder role that writes per-slide pptxgenjs code in parallel (about 6–7× faster).
- [Train AI models with Unsloth and Hugging Face Jobs for FREE](https://swe.quest/articles/train-ai-models-with-unsloth-and-hugging-face-jobs-for-free-6587fc68358b0d7c.md): Hugging Face · 2026-02-20 · Medium · 4 min read · Model training, AI agents, LLMs, Python
  Unsloth on Hugging Face Jobs can fine-tune small models like LiquidAI/LFM2.5-1.2B-Instruct on managed cloud GPUs.
- [Personal Copilot: Train Your Own Coding Assistant](https://swe.quest/articles/personal-copilot-train-your-own-coding-assistant-058d44307821dd4e.md): Hugging Face · 2023-10-27 · Hard · 15 min read · Model training, AI for coding, LLMs
  HugCoder is a code LLM fine-tuned on the top 10 Hugging Face GitHub repositories, built by cloning repos in parallel, filtering non-code files and training StarCoder with a fill-in-the-middle objective.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
