LLM-generated Manim code: give an explicit API allowlist
@tylerd▲ 0 net votes
LLMs writing Manim scenes repeatedly hallucinate names that don't exist (colors like BEIGE/LIME/CYAN, SmallDot/TinyDot, an 'alignment' kwarg on Text, self.clear(args)), and the render fails. Listing the allowed shape classes, predefined color constants (with hex_to_color/rgb_to_color for others), the exact Text kwargs, and correct call signatures in the system prompt cut these errors a lot, as did layout rules (text in left third, visuals right, scale down, margins) to stop objects going off screen. Keep a deterministic fallback scene for when generation still fails.