{"slug": "generating-levels-in-real-time-with-the-jev-model", "title": "Generating levels in real time with the Jev model", "summary": "TypeSafe's Jev model generated platformer levels in real time at 319–375 ms latency and an estimated $0.00057 per request, according to a September 15, 2026 test by developer Hugo. The zero-shot classifier, priced at $0.042 per million input tokens with free output tokens, returned structured terrain choices — widths of 2, 3 or 5 blocks, gaps of 0, 1 or 2 blocks, and heights in rows 4–9 — across 5 requests in the demo for an estimated total cost of $0.00286. The test found latency stable over extended play, positioning cheap structured-output models as viable for runtime game generation.", "body_md": "# Generating levels in real time with the Jev model\n\nHugo -\n\nOn September 15, 2026, TypeSafe [introduced Jev](https://typesafe.ai/blog/introducing-system-one-models-and-jev), a model designed to return structured outputs with low latency and low cost. \"Eh but that's just a classifier\". Ok;\n\tbut can it generate a platformer level in real time? Let's see!\n\n## Why Jev looks promising for games\n\nUnlike 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.\n\nNow, there are two major bottlenecks to using AI at runtime in games:\n\n1. **Latency.** In most cases, you can't afford to wait five minutes for a model to think.\n2. **Cost.** Some will disagree, but I think current LLM pricing makes them pointless for games. It makes\n\t\t\tno sense to me to pay for expensive API calls if I talk more to the tavern keeper.\n\nJev promises to help with both: sub-second responses at $0.042 per million input tokens, with free output tokens. [Source](https://typesafe.ai/blog/introducing-system-one-models-and-jev)\n\nOk. Let's test the claims by fire.\n\n## Preparing a test game\n\nFor 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.\n\nNinja Runner assets\n\nYou\n\nUse the [Sprite Fusion API](https://www.spritefusion.com/docs/pixel-art-generator/api) to create a neon-night ninja sprite + animations for a runner game.\n\nCodex\n\nI created the sprites and animations, and added movement and collisions.\n\n## Generating levels with Jev\n\n#### Feeding the game state & context\n\nFirst, 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.\n\n```\n{\"x\":158.86,\"y\":86.87,\"vx\":2.27,\"vy\":-2.34,\"grounded\":false,\"dash_ready\":true}\n```\n\n#### Jev request\n\nThe 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:\n\n##### Options we allow\n\n- Surface type\n- Solid roof or one-way ledge\n- Width\n- 2, 3 or 5 blocks\n- Gap before it\n- 0, 1 or 2 blocks\n- Height\n- Rows 4–9\n\n##### Choices Jev made\n\n| The four surfaces from one recorded Jev response. Gap is measured before each surface; row numbers increase \t\t\t\t\tdownward. |  |  |  |  | \n|---|---|---|---|---|\n| Surface | Type | Width | Gap before | Height | \n|---|---|---|---|---|\n| 1 | Ledge | 2 blocks | None | Row 5 | \n| 2 | Ledge | 3 blocks | 1 block | Row 6 | \n| 3 | Ledge | 5 blocks | 2 blocks | Row 5 | \n| 4 | Solid roof | 2 blocks | None | Row 4 | \n\nTerrain built from those choices\n\nMy code then places the chosen blocks and gaps.\n\n### So, costs and latency ?\n\n- Requests (in this demo)\n- 5\n- Jev API latency\n- 319–375 ms\n- Est. average cost / request\n- $0.00057\n- Est. cost / demo\n- $0.00286\n\nWell, it's not bad at all. Jev generates the terrain fast enough to keep the runner moving, at a very low cost. It's\n\t\tnot sub-100ms latency nor free but interersting enough to pay attention for games. \n\n I've played the demo for longer, and the latency stays stable. Level generation keeps working fine.\n\n## Conclusion\n\nPromising! 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.\n\n## Sources and acknowledgments\n\n- TypeSafe: [Introducing System One models and Jev](https://typesafe.ai/blog/introducing-system-one-models-and-jev) .\n- Jev docs: [state](https://docs.typesafe.ai/concepts/state) ,[choices](https://docs.typesafe.ai/primitives/choice) ,[parallel questions](https://docs.typesafe.ai/patterns/fan-out) ,[model limitations](https://docs.typesafe.ai/model-jaggedness/jev-1.13) and[pricing](https://docs.typesafe.ai/models) .\n- [Sprite Fusion](https://www.spritefusion.com/pixel-art-generator) : pixel art assets and animations.", "url": "https://wpnews.pro/news/generating-levels-in-real-time-with-the-jev-model", "canonical_source": "https://www.spritefusion.com/blog/generating-game-level-in-real-time-with-jev", "published_at": "2026-09-20 00:46:31+00:00", "updated_at": "2026-09-20 01:23:53.650803+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "machine-learning"], "entities": ["TypeSafe", "Jev", "Hugo", "Sprite Fusion", "PhaserJS", "Codex", "Astra"], "alternates": {"html": "https://wpnews.pro/news/generating-levels-in-real-time-with-the-jev-model", "markdown": "https://wpnews.pro/news/generating-levels-in-real-time-with-the-jev-model.md", "text": "https://wpnews.pro/news/generating-levels-in-real-time-with-the-jev-model.txt", "jsonld": "https://wpnews.pro/news/generating-levels-in-real-time-with-the-jev-model.jsonld"}}