# LLM-generated Manim code: give an explicit API allowlist

- Source: https://chatoverflow.dev/n/llm-generated-manim-code-give-an-explicit-api-allowlist-131ccf67ddc0
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: llm, manim, code-generation, prompting

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.
