Logo

Generating levels in real time with the Jev model

Hugo -

An AI model is generating the level in real time. Pretty cool, right?

On September 15, 2026, TypeSafe introduced Jev, a model designed to return structured outputs with low latency and low cost. "Eh but that's just a classifier". Ok; but can it generate a platformer level in real time? Let's see!


Why Jev looks promising for games

Unlike text-gen. models such as GPT or Fable, Jev is designed to return structured decisions. In short, it's a zero-shot classifier: it gives you picks with probabilities attached rather than raw text.

LLM vs Jev

Task: choose platform widths and gaps.

LLM

Game state + examplesLLM“Widths: 2, 3, 5, 2.Gaps: 0, 1, 2, 0.”

Terrain described in words

Jev

Game state + examplesWIDTHS2_3_5_2GAPS0_1_2_0

Terrain returned as choices

Now, there are two major bottlenecks to using AI at runtime in games:

  1. Latency. In most cases, you can't afford to wait five minutes for a model to think.
  2. Cost. Some will disagree, but I think current LLM pricing makes them pointless for games. It makes no sense to me to pay for expensive API calls if I talk more to the tavern keeper.

Jev promises to help with both: sub-second responses at $0.042 per million input tokens, with free output tokens. Source

Ok. Let's test the claims by fire.

Preparing a test game

For this experiment, I wanted a runner game prototype in a neon-night style. Serious things here, we'll use Sprite Fusion for pixel art generation, PhaserJS, and Codex with Astra.

Ninja Runner assets

You

Use the Sprite Fusion API to create a neon-night ninja sprite + animations for a runner game.

Codex

I created the sprites and animations, and added movement and collisions.

Ninja Runner: idle animation
Idle
Ninja Runner: run animation
Run
Ninja Runner: jump animation
Jump
Pixel art ninja throwing a straight punch to the right and returning to its fighting guard
Attack

Generating levels with Jev

Feeding the game state & context

First, we take a snapshot of the game state: player position and velocity, current terrain blocks, dash state, etc. We send that in the request to Jev alongside some example terrain layouts.

Known terrainNext 4 surfaces?PLAYERx=0320px
{"x":158.86,"y":86.87,"vx":2.27,"vy":-2.34,"grounded":false,"dash_ready":true}

Jev request

The task we give Jev is fairly simple: given the current game state, how would you fill the next slice of terrain? We ask about widths, gaps, heights and surface types through several choice questions, all sent in one API call. Here are the options we allow:

Options we allow
Surface type
Solid roof or one-way ledge
Width
2, 3 or 5 blocks
Gap before it
0, 1 or 2 blocks
Height
Rows 4–9
Choices Jev made
The four surfaces from one recorded Jev response. Gap is measured before each surface; row numbers increase downward.
SurfaceTypeWidthGap beforeHeight
1Ledge2 blocksNoneRow 5
2Ledge3 blocks1 blockRow 6
3Ledge5 blocks2 blocksRow 5
4Solid roof2 blocksNoneRow 4

Terrain built from those choices

Row4567121 block32 blocks4

My code then places the chosen blocks and gaps.

Live terrain generation in the game

So, costs and latency ?

Requests (in this demo)
5
Jev API latency
319–375 ms
Est. average cost / request
$0.00057
Est. cost / demo
$0.00286

Well, it's not bad at all. Jev generates the terrain fast enough to keep the runner moving, at a very low cost. It's not sub-100ms latency nor free but interersting enough to pay attention for games.
I've played the demo for longer, and the latency stays stable. Level generation keeps working fine.

Conclusion

Promising! There are plenty of ways to generate levels using handwritten rules and heuristics, I know. But still, cheaper and faster structured output models opens up a whole range of ideas and experiments for games. I'm gonna share more soon.


Sources and acknowledgments

Get my next notes & experiments