<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mustafa Keceli</title>
    <description>The latest articles on DEV Community by Mustafa Keceli (@muskec06).</description>
    <link>https://dev.to/muskec06</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2847614%2Fef13d90d-84e4-486a-b8b9-adaef2066bd2.png</url>
      <title>DEV Community: Mustafa Keceli</title>
      <link>https://dev.to/muskec06</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/muskec06"/>
    <language>en</language>
    <item>
      <title>3.5x fewer tokens for AI-generated 3D scenes: meet tinythree</title>
      <dc:creator>Mustafa Keceli</dc:creator>
      <pubDate>Tue, 17 Nov 2026 13:08:38 +0000</pubDate>
      <link>https://dev.to/muskec06/35x-fewer-tokens-for-ai-generated-3d-scenes-meet-tinythree-317c</link>
      <guid>https://dev.to/muskec06/35x-fewer-tokens-for-ai-generated-3d-scenes-meet-tinythree-317c</guid>
      <description>&lt;p&gt;&lt;em&gt;tinythree is a tiny scene language that compiles to Three.js. Here is why I built it, how I measured it, and where it falls short.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiui7z34dpx6w7ppajw8b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiui7z34dpx6w7ppajw8b.png" alt="tinythree: a 3D scene language for AI models that compiles to Three.js" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I ask an AI model to build a 3D scene in Three.js, the result is usually good. What bothered me was the cost of getting there. Most of what the model types isn't the scene. It's ceremony: creating a renderer, wiring up orbit controls, handling window resizes, writing &lt;code&gt;new THREE.Mesh(new THREE.BoxGeometry(...), material)&lt;/code&gt; and then &lt;code&gt;.position.set(...)&lt;/code&gt; again and again.&lt;/p&gt;

&lt;p&gt;Output tokens are the slowest and most expensive part of a model's answer. Every line of boilerplate makes you wait and costs money, and it makes every small change slower too.&lt;/p&gt;

&lt;p&gt;So I tried something simple. What if the model only had to &lt;em&gt;describe&lt;/em&gt; the scene, and a compiler wrote the Three.js?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkzzzptiq0105tx9cgfeq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkzzzptiq0105tx9cgfeq.png" alt="How tinythree works: you describe the scene, the AI writes a short .t3 file, the compiler turns it into Three.js" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea in one example
&lt;/h2&gt;

&lt;p&gt;Here is a desk with four legs in plain Three.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;wood&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;MeshStandardMaterial&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x8b5a2b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;roughness&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.7&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;top&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Mesh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;BoxGeometry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wood&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;leg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Mesh&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="no"&gt;THREE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;BoxGeometry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wood&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;leg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;scene&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;leg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here is the same desk in tinythree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mat wood #8b5a2b r=.7
box top 2,.1,1 @0,1,0 wood
box leg .1,1,.1 @.9,.5,.4 wood mirror=xz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last line is one leg, mirrored across two axes, which gives you four. The compiler turns these three lines into ordinary Three.js like the code above. A scene file never needs a renderer, a camera loop or a resize handler; the compiler adds those.&lt;/p&gt;

&lt;h2&gt;
  
  
  A few rules I followed
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;One line per object.&lt;/strong&gt; Each line is a type, an optional name, a size, a material and a position. Options look like &lt;code&gt;key=value&lt;/code&gt;. Everything else is a flag. The format is so regular that the whole language fits in a short prompt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repetition is a keyword, not a loop.&lt;/strong&gt; Real scenes are full of repeated things: legs, columns, solar panels, stones in a circle, cabins on a Ferris wheel. &lt;code&gt;mirror&lt;/code&gt;, &lt;code&gt;array&lt;/code&gt;, &lt;code&gt;grid&lt;/code&gt; and &lt;code&gt;radial&lt;/code&gt; turn one line into many copies, and &lt;code&gt;use&lt;/code&gt; clones a group you defined earlier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnmtld8exadpxho3g9hlb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnmtld8exadpxho3g9hlb.png" alt="One line, many copies: mirror, array, grid and radial" width="800" height="714"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common content is built in.&lt;/strong&gt; Text labels, glTF models, textures and a small library of real-size parts (trees, people, cars, doors, windows, stairs, houses) each take a single line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use lib:house h1 @-7,0,-15 array=3,7,0,0
mat paving map=tiles rep=8,8
model mill assets/windmill.glb @14,0,-12 play
text sign "Town Square" @0,4,0 bg=#1b2a4a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Errors are written for the model.&lt;/strong&gt; When something is wrong, the compiler names the line and suggests a fix, for example &lt;code&gt;line 7: unknown command "spehre" (did you mean "sphere"?)&lt;/code&gt;. You can paste that straight back into the chat and the model fixes just that line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three.js is never out of reach.&lt;/strong&gt; Anything the syntax doesn't cover can be written as plain Three.js inside the same file: custom shaders, particles, post-processing, WebXR. You never hit a wall. In that part you also save nothing, and that's fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Eiffel Tower test
&lt;/h2&gt;

&lt;p&gt;To see whether this holds up beyond toy examples, I modeled the Eiffel Tower at real proportions. Its legs are curved steel lattices, which is exactly the kind of geometry that gets long in Three.js. tinythree has a &lt;code&gt;truss&lt;/code&gt; command that builds a lattice segment, with corner posts, horizontal rings and X braces, in one line. Stacking a few segments with less and less lean gives you the curve:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;truss leg1 2.6,2.1,3 @5,0,5 lean=-1.25,-1.25 iron mirror=xz
truss leg2 2.1,1.7,2.76 @3.75,3,3.75 lean=-.85,-.85 iron mirror=xz
truss leg3 1.7,1.25,5.84 @2.9,5.76,2.9 lean=-1.5,-1.5 iron mirror=xz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2f5qigmlp38ddab9brio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2f5qigmlp38ddab9brio.png" alt="How the lattice legs are built: a straight segment, taper and lean, and stacked segments that form a curve" width="800" height="509"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The whole scene, with the tower, arches, platforms, the Champ de Mars, the Seine, buildings, trees and drifting clouds, is 57 lines and about 1,400 lattice beams. The hand-written Three.js version is 165 lines.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuy4e96mrn0rq4bweo7rl.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuy4e96mrn0rq4bweo7rl.gif" alt="The finished Eiffel Tower scene, 57 lines of tinythree" width="400" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I measured it
&lt;/h2&gt;

&lt;p&gt;I wanted numbers I could defend, so I set a few rules for myself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every scene is written twice: once in tinythree, and once as &lt;strong&gt;compact, idiomatic Three.js&lt;/strong&gt;, the way a good developer would write it, with loops and helper functions allowed. Comparing against bloated code would have been easy and meaningless.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Both versions are rendered&lt;/strong&gt; and compared side by side, to make sure they really draw the same scene.&lt;/li&gt;
&lt;li&gt;Tokens are counted with OpenAI's o200k tokenizer. Other models use different tokenizers, but they are all BPE-based, so the ratios come out similar.&lt;/li&gt;
&lt;li&gt;Everything is in the repository, so anyone can rerun it with &lt;code&gt;npm run bench&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F97obp636za8snmi0363m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F97obp636za8snmi0363m.png" alt="Token benchmark across 11 scenes" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Across 11 scenes, the total went from &lt;strong&gt;14,151 tokens to 4,057, about 3.5 times fewer.&lt;/strong&gt; The range was wide, and the spread taught me more than the average did:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Town square&lt;/strong&gt; (parts, textures, a glTF model, a label): 3,207 → 464 tokens, &lt;strong&gt;6.9x fewer&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector addition&lt;/strong&gt; (education): 466 → 122 tokens, 3.8x fewer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;London Eye&lt;/strong&gt;: 1,011 → 305 tokens, 3.3x fewer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stonehenge&lt;/strong&gt;: 1,120 → 375 tokens, 3.0x fewer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Eiffel Tower&lt;/strong&gt;: 3,028 → 1,117 tokens, 2.7x fewer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4bg2f0al0pfdfj8fb9xi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4bg2f0al0pfdfj8fb9xi.jpg" alt="The town square: library parts, procedural textures, an animated glTF windmill and a text label. 464 tokens." width="480" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The biggest savings came from scenes built out of &lt;em&gt;things&lt;/em&gt;: houses, trees, textures, a model, a label. Each of those is one line in tinythree and a block of code in Three.js. The smallest savings came from geometry built from scratch, like the Eiffel Tower, because a good developer writes a helper function for the lattice once and reuses it.&lt;/p&gt;

&lt;p&gt;There is a fixed cost too. The model has to learn the language, and the prompt that teaches it is about 1,500 tokens. Since a scene saves around 900 tokens on average, the prompt pays for itself after about two scenes. It is also input rather than output, which is cheaper, and providers that support prompt caching make it cheaper still.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk4zg3h6ahg0n65bruqvb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk4zg3h6ahg0n65bruqvb.png" alt="Cumulative tokens: Three.js versus tinythree including its prompt; the lines cross before the second scene" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Fewer tokens, faster answers
&lt;/h2&gt;

&lt;p&gt;Generation time grows roughly in line with output tokens. So a model writing a third of the tokens finishes in roughly a third of the time. Edits benefit too: moving a building or changing a material means rewriting one short line, not a block of JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Video, frame by frame
&lt;/h2&gt;

&lt;p&gt;Every tinythree scene compiles to a function of time, so any frame can be rendered at an exact timestamp. A small script turns a scene into an MP4, or into a video with a transparent background for editing. The output doesn't depend on how fast your computer is, which makes it useful for educational videos and presentations.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it isn't
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It isn't a CAD or BIM tool.&lt;/strong&gt; It's for quick concept visuals, presentations and the web.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I haven't yet measured first-try accuracy across models.&lt;/strong&gt; The token savings are measured; how often each model gets a scene right on the first attempt is the next thing I want to test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's a new language.&lt;/strong&gt; Models don't know it from training, which is why the prompt and the readable error messages matter.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The playground runs in your browser with nothing to install. Pick a scene, edit a line and watch it update:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Playground:&lt;/strong&gt; &lt;a href="https://muskec06.github.io/tinythree/" rel="noopener noreferrer"&gt;muskec06.github.io/tinythree&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code (MIT, zero dependencies):&lt;/strong&gt; &lt;a href="https://github.com/muskec06/tinythree" rel="noopener noreferrer"&gt;github.com/muskec06/tinythree&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you work with Three.js, AI tools, architecture or education, I'd really like to hear what you'd build with it and what's missing.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://medium.com/@muskec/3-5x-fewer-tokens-for-ai-generated-3d-scenes-meet-tinythree-20426130e4b4" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>threejs</category>
      <category>ai</category>
      <category>javascript</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
