GLM-5.2 本地跑了 90 分钟,自己用 Three.js 搭了一座能走能跳的 3D 小城!零 3D 模型、零云端 API,全靠一段 PromptGLM-5.2 ran locally for 90 minutes and built a walkable, jumpable 3D town with Three.js! Zero 3D models, zero cloud APIs, all from a single prompt.


AI free token/AI免费积分

一个周末晚上,前 Google/RTFKT/Nike CTO Samuel Cardillo 坐在自己装了两张 RTX 6000 Pro Blackwell 的机器前,敲了一段不到 150 个英文单词的 Prompt。

然后他起身去倒了杯咖啡。回来时,屏幕上多了一座完整的 3D 小城。

有街道、有建筑、有能对话的 NPC。角色能用 WASD 移动、SPACE 跳跃、SHIFT 冲刺。相机可以绕着角色轨道旋转,碰到建筑物会被挡住——真有碰撞,碰到墙面会停住,穿模 demo 做不到这一步。

最让人头皮发麻的是:整个城市没有导入任何预制 3D 模型。所有道路、墙壁、角色,全是 GLM-5.2 用 Three.js 的基本几何体——矩形、正方体——一个接一个"焊接"出来的。

全过程,1 小时 30 分钟。推理速度约 15 tokens/秒。全程本地运行,没碰任何云端 API。

Cardillo 的原话:"This is the worst it'll ever be."

「这已经是最差的版本了。」

Samuel Cardillo 发布 GLM-5.2 生成 3D 小城的主帖,附 36 秒操作演示视频(分段1)Samuel Cardillo 发布 GLM-5.2 生成 3D 小城的主帖,附 36 秒操作演示视频(分段2)

▲ Samuel Cardillo 的原帖:模型生成的 3D 小城里,角色可以行走、跳跃、冲刺,还能和 NPC 对话。全部由 Three.js 基础几何体组装而成。

一段 Prompt,一座城

先看 Cardillo 到底给模型写了什么:

"Use ThreeJS and Javascript to create a city, with details, where I can control a character with WASD, jump with SPACE. there should be some NPCs I can interact with. I should be able to orbit around the character and zoom in/out, camera should collide with buildings. Add a main title and a pause screen with ESC"

「用 Three.js 和 JavaScript 创建一个城市,要有细节。我可以用 WASD 控制角色,SPACE 跳跃。要有一些可以互动的 NPC。相机绕角色轨道旋转、缩放,碰到建筑要有碰撞。加上主标题和 ESC 暂停界面。」

注意这个 Prompt 的质量——它不玩虚的。输入方案(WASD)、相机行为(orbit + zoom)、碰撞条件(camera collide with buildings)、UI 元件(title + pause screen)、交互对象(NPCs interact),每个维度都点名了。

更关键的是那句 "with details"——没说具体什么细节,但给了模型发挥空间。GLM-5.2 的理解是:用基本几何体搭出有层次感的城市场景,造出带门窗的建筑、有宽度的道路、能走近对话的角色。

而且模型自己加了 SHIFT 冲刺。Prompt 里没提,它觉得"一个玩家控制角色应该能跑",就顺手做了。

这不是"按要求生成代码"。这是"理解意图 + 主动补全 + 自我 polish"的 agent 行为。

744B 参数,本地跑起来?

普通人听到"本地跑 744B 参数模型",第一反应是:你在开玩笑。

753B 的 BF16 权重 ≈ 1.5TB,四张 H100 都装不下。即便 4-bit 量化也要数百 GB。再加上 1M 上下文的 KV cache 膨胀,怎么看都不像能在自家机器上跑的东西。

但 Cardillo 就是跑起来了。三件事让不可能变成了可能。

第一,Unsloth 动态量化(UD-Q4_K_XL)。这不是粗暴地把所有权重砍到 4-bit。Unsloth 的做法是:关键层保留较高精度,不重要层极致压缩。Cardillo 用的 UD-Q4_K_XL 版本约 436GB,分 11 个 GGUF 分片,精度保留 97.5%,coding 任务上几乎无损。

Unsloth 发布的 GLM-5.2 本地运行指南,含量化方案和硬件配置对照表

▲ Unsloth 在模型发布当天就放出了动态 GGUF 量化版,配全套硬件对照表和 llama.cpp 运行指南。

第二,llama.cpp 的专家层精细 offload。GLM-5.2 是 MoE 架构(744B 总参,每次只激活约 40B),不同层的专家使用频率天差地别。Cardillo 用-ot正则表达式,把低频专家路由到系统 RAM,高频活跃专家均匀分到两张 GPU 上:

-ot 'blk\.(3|4|5|6|7|8|9)[1-4][0-9][5|01]\.ffn_(gate|up|down)_exps\.weight=CPU' -ot 'blk\.(5[2-9]|[6-4])\.ffn_(gate|up|down)_exps\.weight=CUDA0' -ot 'blk\.(6[5-9]|[7[0-7])\.ffn_(gate|up|down)_exps\.weight=CUDA1' 

这就是工程上的"好钢用在刀刃上"。GPU 显存放最热的那部分专家,剩下的交给便宜大碗的系统内存。配合--no-mmap防 page thrashing、--flash-att on加速注意力、--cache-type-k q8_0 --cache-type-v q8_0稳住 256K 上下文,15 t/s 的实用速度就此达成。

第三,GLM-5.2 本身的架构适配。Z.AI(智谱 AI)在 6 月中旬发布时,重点打的就是"1M token 稳定上下文 + 长时程 agent 任务"。744B MoE 每次只激活 40B,意味着推理时算力开销远小于同等体量的 dense 模型。配合 IndexShare 和 MTP(Multi-Token Prediction)优化,这个模型从设计之初就是冲着"能持续想好几个小时不崩"去的。

GLM-5.2 官方博客:专为长时程任务设计,1M 上下文 + agentic coding 里程碑

▲ Z.AI 官方发布的 GLM-5.2 博客:1M 稳定上下文、MIT 开源权重、全面对标闭源前沿模型的 benchmark。

不止一座城——这类案例正在批量出现

Cardillo 的 3D 小城不是孤例。

就在同一天,另一位开发者 @0xbelorix 发帖:他用同一个模型,一夜之间生成了两个完整可玩的浏览器游戏——一个俯视角 2D 龙游戏,一个 3D 地牢射击游戏。全部原生 HTML/JS,打开浏览器就能玩。

他还抛出一个让很多人坐不住的数据:GLM-5.2 的 SWE-bench 得分62.1%,超过了 GPT-5.5 的 58.6%。

"Open source & free model 1-night built 2 playable browser games — a top-down dragon game and a 3D dungeon shooter. SWE-bench scores surpassing GPT-5.5."

「开源免费模型,一夜做出 2 个可玩浏览器游戏——俯视角龙游戏和 3D 地牢射击。SWE-bench 得分超过 GPT-5.5。」

@0xbelorix 的帖子:GLM-5.2 一夜生成 2 个可玩游戏,SWE-bench 反超 GPT-5.5(分段1)@0xbelorix 的帖子:GLM-5.2 一夜生成 2 个可玩游戏,SWE-bench 反超 GPT-5.5(分段2)

▲ @0xbelorix 展示了 GLM-5.2 的"游戏工厂"能力,一夜两个完整可玩游戏,benchmark 数据直接对标 GPT-5.5。

更早几天,网页设计评测平台 Design Arena 的榜单上,GLM-5.2登顶第一,碾压了 Claude Fable 5。尤其在 Three.js 和 chart.js 的场景下,胜率高出 6 个百分点。中文博主 @WWTLitee 算了笔账:GLM-5.2 的 API 价格是每百万 token 输入 1.4 美元,而 Fable 5 是 10 美元,OpenAI 同等模型更高。

「GLM-5.2 登顶 Design Arena 榜首,在 Three.js 和图表场景上比 Fable 5 胜率更高。输入 $1.4/1M tokens vs Fable $10/1M。」

@WWTLitee 的分析帖:Design Arena 榜首 + Three.js 强项 + 价格对比(分段1)@WWTLitee 的分析帖:Design Arena 榜首 + Three.js 强项 + 价格对比(分段2)

▲ Design Arena 榜单和价格对比:GLM-5.2 在网页设计评测中登顶,尤其在 Three.js 调用上优势明显。

这些案例拼在一起,一个清晰的画面浮现出来:开源模型在创意 coding 和 3D 可视化领域,某些维度上已经站到前排,再用"追平"这个词就不太够用了。

GLM-5.2 Hugging Face 模型卡:744B MoE、MIT 许可、完整 benchmark

▲ Hugging Face 上的 GLM-5.2 模型卡:753B 参数、MIT 开源许可、全面的 benchmark 和 serving 框架支持。

"This is the worst it'll ever be"

Cardillo 这句话,乍一听像凡尔赛。但他不是在炫耀。

他在描述一个正在剧烈坍缩的边界。

1 个月前,要在本地跑 frontier 级别的 coding 模型,要么你有一屋子 H100,要么老实付 API 费。1 周前,Unsloth 放出 day-zero 量化版,llama.cpp 社区一周内适配完新架构(sm_120、GLM DSA),Reddit r/LocalLLaMA 上开始出现"我在 Mac Studio 上跑起来了"的实测帖。

再到 6 月 26 日,一座完整的、可交互的 3D 小城从本地 GPU 里长出来。

这里面的每一环都在加速:硬件在降价(Blackwell 专业卡、Strix Halo、512GB Mac Studio 都在路上),量化在进步(Unsloth 的 2-bit 动态量化已能保持 82% 实用精度),模型在迭代(社区已经在讨论蒸馏版 GLM-5.2 的可能),推理栈在成熟(llama.cpp 的 offload 策略越来越精细)。

今天的"1.5 小时生成 3D 小城",放到半年后可能就是 5 分钟的事。放到一年后,可能在你的笔记本上就能跑。

为什么是 Three.js?为什么是这个模型?

Three.js 对 LLM 来说是个地狱级难度的目标。

它不是那种"import 一个库,调两个 API 就出结果"的框架。Three.js 是 WebGL 的薄封装,正确性极度依赖对 3D 数学(矩阵变换、相机投影、射线检测、碰撞几何)、场景图层级、渲染循环时序、输入事件绑定的整体把控。

生成一个"能跑的 Hello Triangle"不难。但生成一座完整的城——道路不悬浮、建筑不穿插、相机撞墙有反馈、NPC 能走近对话、ESC 弹出暂停菜单——这需要模型在一次长生成中同时把握十几个维度的约束。

传统 LLM 经常在第二步就崩:几何体漂浮、相机穿墙、NPC 静止、性能掉到个位数帧率。GLM-5.2 之所以能一次过,靠的是它的 1M 上下文窗口和 agentic 规划能力:先布局整体场景结构,再逐块组装基本体,然后修补细节、加交互逻辑、优化相机行为,最后顺手补上 SHIFT 冲刺这种额外 polish。

整个过程数万行代码,在一个连续的生成轨迹中完成。模型在"写后面代码"的时候,还能"记得前面的函数签名、相机状态和按键绑定"。这是短上下文模型天然做不到的事。

Reddit 上有人总结得很到位:"It's like the model understands spatial relationships, not just code syntax."——它理解的是空间关系,不只是代码语法。

这意味着什么?

先把"AI 替代程序员"的恐惧放一边。这件事最直接的意义在于:创造的门槛在被拆掉。

一个懂 Three.js 的资深工程师,从头搭这样一座可玩的 3D 小城,保守估计要 2-3 天。如果要加 NPC 交互、碰撞检测、相机约束、暂停 UI,时间会拉到一周以上。

而现在,一个会写 Prompt、有双卡的开发者,用 90 分钟拿到了同样的结果。模型输出的代码他可以接着改、接着调、接着部署。

把这件事理解成"AI 替代人"就偏了。真正在发生的变化,是能力的乘数效应。一个人 + 一个本地模型 = 一支小团队的生产力。对于独立游戏开发者、原型设计师、教育工作者、元宇宙工具链团队来说,这个乘数效应是实实在在的。

更重要的信号在于开源权重 + 社区推理栈的组合效应。GLM-5.2 选择了 MIT 许可——完全开源、可商用、无地域限制。这意味着不需要等任何公司的 API 审批,不需要担心 rate limit,不需要把代码发给第三方服务器。你下载模型,装上 llama.cpp,写好 Prompt,开始生成。

这是"本地 AI 走向个人工作站"最生猛的一个案例。

从更广的视角看,2026 年中的这批开源模型正在重写全球开发者对"哪个模型做创意 coding 最顺手"的默认答案。从 GLM 到 Qwen 到 DeepSeek,这一波模型的共同特征是:开源、便宜、在特定 creative/agentic 场景上不输甚至超过闭源竞品。而 Three.js 类 3D 可视化,恰恰是它们最先撕开的口子。

Cardillo 说得好:这是他见过的最差版本。

最好的版本,可能就在下个季度。

 

One weekend evening, Samuel Cardillo, former CTO of Google/RTFKT/Nike, sat in front of a machine loaded with two RTX 6000 Pro Blackwell cards and typed a prompt of fewer than 150 English words.

Then he got up to pour himself a coffee. When he came back, a complete 3D mini-city had appeared on the screen.

There were streets, buildings, and NPCs you could talk to. The character could move with WASD, jump with SPACE, and sprint with SHIFT. The camera could orbit around the character and zoom in and out, and it was blocked by buildings — real collision. When it hit a wall, it stopped. A clip-through demo could never pull that off.

The most mind-blowing part: no pre-made 3D models were imported into the entire city. Every road, wall, and character was assembled by GLM-5.2 using Three.js primitive geometries — rectangles and cubes — "welded" together one after another.

The whole process took 1 hour and 30 minutes. Inference speed was around 15 tokens/second. Everything ran locally, without touching any cloud API.

Cardillo's exact words: "This is the worst it'll ever be."

"This is already the worst version."

▲ Samuel Cardillo's original post: in the 3D mini-city generated by the model, the character can walk, jump, sprint, and talk to NPCs. Everything is assembled from Three.js primitive geometries.

One prompt, one city

First, let's look at exactly what Cardillo wrote to the model:

"Use ThreeJS and Javascript to create a city, with details, where I can control a character with WASD, jump with SPACE. there should be some NPCs I can interact with. I should be able to orbit around the character and zoom in/out, camera should collide with buildings. Add a main title and a pause screen with ESC"

"Use Three.js and JavaScript to create a city, with details. I can control the character with WASD, jump with SPACE. There should be some NPCs I can interact with. The camera should orbit around the character and zoom in and out, and collide with buildings. Add a main title and an ESC pause screen."

Notice the quality of this prompt — it doesn't play around. Input scheme (WASD), camera behavior (orbit + zoom), collision condition (camera collide with buildings), UI elements (title + pause screen), interaction targets (NPCs interact) — every dimension is called out.

Even more critical is the phrase "with details" — it doesn't specify what details, but it gives the model room to improvise. GLM-5.2's interpretation: build a layered city scene out of primitive geometries, create buildings with doors and windows, roads with proper width, and characters you can walk up to and talk with.

The model also added SHIFT sprint on its own. The prompt never mentioned it. It figured "a player-controlled character should be able to run," and just did it.

This isn't "generating code on request." This is agent-like behavior: understanding intent, completing the gaps, and self-polishing.

744B parameters, running locally?

When ordinary people hear "running a 744B-parameter model locally," their first reaction is: you must be joking.

753B of BF16 weights is roughly 1.5TB — even four H100s can't hold that. Even 4-bit quantization would take hundreds of GB. Add the KV cache bloat from 1M context, and it looks like something that could never run on a home machine.

But Cardillo got it running. Three things made the impossible possible.

First, Unsloth's dynamic quantization (UD-Q4_K_XL). This isn't crudely chopping every weight down to 4-bit. Unsloth's approach: keep critical layers at higher precision, and compress unimportant layers aggressively. The UD-Q4_K_XL version Cardillo used is about 436GB, split into 11 GGUF shards, retaining 97.5% precision with almost no loss on coding tasks.

▲ Unsloth released a dynamic GGUF quantized version on the same day the model launched, complete with a full hardware comparison table and llama.cpp running guide.

Second, llama.cpp's fine-grained expert offloading. GLM-5.2 uses a MoE architecture (744B total parameters, only about 40B activated each time), and different experts are used at wildly different frequencies. Cardillo used an -ot regular expression to route low-frequency experts to system RAM and spread the hot, frequently used experts evenly across his two GPUs:

This is engineering's version of "putting good steel on the blade." GPU VRAM holds the hottest experts, and everything else goes to cheap, abundant system memory. Combined with --no-mmap to prevent page thrashing, --flash-att on to speed up attention, and --cache-type-k q8_0 --cache-type-v q8_0 to stabilize 256K context, a practical 15 t/s speed was achieved.

Third, GLM-5.2's architecture itself is well-suited. When Z.AI (Zhipu AI) released it in mid-June, the selling points were "1M token stable context + long-horizon agent tasks." A 744B MoE that only activates 40B per step means inference compute costs are far lower than a dense model of the same size. Combined with IndexShare and MTP (Multi-Token Prediction) optimizations, this model was designed from the start to "keep thinking for hours without collapsing."

▲ Z.AI's official GLM-5.2 blog post: 1M stable context, MIT open weights, and benchmarks comprehensively matching closed-source frontier models.

Not just one city — these cases are appearing in batches

Cardillo's 3D mini-city isn't an isolated case.

On the same day, another developer, @0xbelorix, posted that using the same model he generated two fully playable browser games overnight — a top-down 2D dragon game and a 3D dungeon shooter. All native HTML/JS, open the browser and play.

He also dropped a number that made many people uneasy: GLM-5.2's SWE-bench score of 62.1% beat GPT-5.5's 58.6%.

"Open source & free model 1-night built 2 playable browser games — a top-down dragon game and a 3D dungeon shooter. SWE-bench scores surpassing GPT-5.5."

"Open-source free model, built 2 playable browser games in one night — a top-down dragon game and a 3D dungeon shooter. SWE-bench score beats GPT-5.5."

▲ @0xbelorix showcased GLM-5.2's "game factory" ability: two fully playable games in one night, with benchmark data directly comparing against GPT-5.5.

A few days earlier, on Design Arena, a web design evaluation platform, GLM-5.2 topped the leaderboard, crushing Claude Fable 5. Especially in Three.js and chart.js scenarios, its win rate was 6 percentage points higher. Chinese blogger @WWTLitee did the math: GLM-5.2's API price is $1.4 per million input tokens, while Fable 5 costs $10 — and OpenAI's comparable models cost even more.

"GLM-5.2 tops the Design Arena leaderboard, with a higher win rate than Fable 5 in Three.js and chart scenarios. Input $1.4/1M tokens vs Fable $10/1M."

▲ Design Arena leaderboard and price comparison: GLM-5.2 ranks first in web design benchmarks, with a particularly strong advantage in Three.js usage.

Put these cases together and a clear picture emerges: open-source models have already moved to the front row in creative coding and 3D visualization on some dimensions, and the word "catching up" no longer does them justice.

▲ GLM-5.2 model card on Hugging Face: 753B parameters, MIT open-source license, comprehensive benchmark and serving framework support.

"This is the worst it'll ever be"

At first listen, Cardillo's line sounds like humblebragging. But he isn't showing off.

He's describing a boundary that is collapsing violently.

One month ago, running a frontier-level coding model locally meant either owning a room full of H100s or dutifully paying API fees. One week ago, Unsloth released a day-zero quantized version, the llama.cpp community adapted the new architecture (sm_120, GLM DSA) within a week, and posts like "I got it running on my Mac Studio" started appearing on Reddit's r/LocalLLaMA.

Then, on June 26, a complete, interactive 3D mini-city grew out of a local GPU.

Every link in this chain is accelerating: hardware prices are falling (Blackwell pro cards, Strix Halo, and 512GB Mac Studios are all on the way), quantization is improving (Unsloth's 2-bit dynamic quantization already maintains 82% practical precision), models are iterating (the community is already discussing a distilled GLM-5.2), and the inference stack is maturing (llama.cpp's offload strategies are getting more and more refined).

Today's "1.5 hours to generate a 3D mini-city" might take 5 minutes six months from now. A year from now, it might run on your laptop.

Why Three.js? Why this model?

Three.js is a hellishly difficult target for LLMs.

It's not a framework where you "import a library, call two APIs, and get results." Three.js is a thin wrapper over WebGL, and correctness depends heavily on an overall grasp of 3D math (matrix transforms, camera projection, raycasting, collision geometry), scene graph hierarchy, render-loop timing, and input event binding.

Generating a "working Hello Triangle" isn't hard. But generating a complete city — roads that don't float, buildings that don't clip through each other, a camera that gets feedback when hitting walls, NPCs you can walk up to and talk with, an ESC key that opens a pause menu — requires the model to hold a dozen dimensions of constraints simultaneously over one long generation.

Traditional LLMs often fall apart by the second step: geometry floats, the camera clips through walls, NPCs stand frozen, and performance drops to single-digit frame rates. GLM-5.2 can get it right in one pass because of its 1M context window and agentic planning ability: lay out the overall scene structure first, assemble primitives block by block, then fix details, add interaction logic, optimize camera behavior, and finally throw in extra polish like SHIFT sprint.

The whole process spans tens of thousands of lines of code in one continuous generation trace. While writing later code, the model can still "remember" earlier function signatures, camera states, and key bindings. This is something short-context models inherently cannot do.

Someone on Reddit summed it up well: "It's like the model understands spatial relationships, not just code syntax." It understands spatial relationships, not just code syntax.

What does this mean?

Put the fear of "AI replacing programmers" aside for now. The most direct significance is this: the barrier to creation is being torn down.

A senior engineer who knows Three.js well would conservatively need 2-3 days to build such a playable 3D mini-city from scratch. Add NPC interaction, collision detection, camera constraints, and a pause UI, and the timeline stretches past a week.

Now, a developer who can write a prompt and owns two graphics cards gets the same result in 90 minutes. And they can continue editing, tuning, and deploying the code the model outputs.

Reading this as "AI replacing humans" misses the point. What's actually happening is a multiplier effect on capability. One person + one local model = the productivity of a small team. For indie game developers, prototype designers, educators, and metaverse toolchain teams, this multiplier effect is very real.

The even more important signal is the combination of open weights and the community inference stack. GLM-5.2 chose the MIT license — fully open source, commercially usable, no regional restrictions. That means no waiting for any company's API approval, no worrying about rate limits, and no sending your code to a third-party server. You download the model, install llama.cpp, write your prompt, and start generating.

This is the most striking case yet of "local AI moving onto the personal workstation."

From a broader perspective, this batch of open-source models in mid-2026 is rewriting the default answer to "which model is best for creative coding" among developers worldwide. From GLM to Qwen to DeepSeek, the common traits of this wave of models are: open source, cheap, and in specific creative/agentic scenarios, equal to or better than closed-source competitors. And Three.js-style 3D visualization happens to be the first gap they tore open.

Cardillo put it well: this is the worst version he's ever seen.

The best version might arrive next quarter.

Samuel Cardillo 发布 GLM-5.2 生成 3D 小城的主帖,附 36 秒操作演示视频(分段1)

Samuel Cardillo 发布 GLM-5.2 生成 3D 小城的主帖,附 36 秒操作演示视频(分段2)

Unsloth 发布的 GLM-5.2 本地运行指南,含量化方案和硬件配置对照表

GLM-5.2 官方博客:专为长时程任务设计,1M 上下文 + agentic coding 里程碑

@0xbelorix 的帖子:GLM-5.2 一夜生成 2 个可玩游戏,SWE-bench 反超 GPT-5.5(分段1)

@0xbelorix 的帖子:GLM-5.2 一夜生成 2 个可玩游戏,SWE-bench 反超 GPT-5.5(分段2)

@WWTLitee 的分析帖:Design Arena 榜首 + Three.js 强项 + 价格对比(分段1)

@WWTLitee 的分析帖:Design Arena 榜首 + Three.js 强项 + 价格对比(分段2)

GLM-5.2 Hugging Face 模型卡:744B MoE、MIT 许可、完整 benchmark

暂无评论,快来发表第一条评论吧!No comments yet. Be the first!

📮 需求咨询📮 Inquiry