文章摘要
作者使用中国Z.ai公司发布的GLM-4.5 Air模型,在2.5年前的64GB MacBook Pro M2笔记本电脑上成功运行了3bit量化版本,并生成了可直接运行的《太空入侵者》游戏代码,展示了该模型在编码任务中的高效表现。
文章总结
标题:我的2.5年老笔记本现在能用GLM-4.5 Air和MLX编写《太空入侵者》JavaScript游戏
主要内容:
2025年7月29日,作者分享了他使用中国Z.ai公司发布的开源模型GLM-4.5 Air在2.5年前的64GB MacBook Pro M2笔记本上成功编写《太空入侵者》游戏代码的经历。GLM-4.5 Air模型虽然较小,但仍有1060亿参数,占用205.78GB空间。Ivan Fioravanti将其压缩为44GB的3bit量化版本,适合64GB内存的机器运行。
作者通过MLX库运行该模型,输入提示“编写一个实现《太空入侵者》的HTML和JavaScript页面”,模型成功生成了完整的代码,且无需进一步修改即可运行。生成过程中,模型峰值内存占用为47.687GB,生成速度也相当不错。
此外,作者还测试了该模型生成“骑自行车的鹈鹕”SVG图像的能力,结果显示模型在生成图像方面也有不错的表现。
总结:
2025年发布的许多模型都专注于编码任务,GLM-4.5 Air等模型的表现令人印象深刻。作者感叹,两年前他首次尝试LLaMA模型时,从未想过同一台笔记本如今能运行如此强大的模型。这些高质量的本地编码模型的出现,标志着AI在编程领域的巨大进步。
评论总结
评论主要围绕以下几个方面展开:
模型训练数据的推测:
- 多位评论者推测模型的训练数据可能包含大量《Space Invaders》的克隆代码。
- 引用:"I bet the training data included enough space invader cloned in JS" (croes)
- 引用:"Most likely its training data included countless Space Invaders in various programming languages." (AlexeyBrin)
硬件配置的描述与需求:
- 评论者对“2.5年旧笔记本电脑”的描述提出质疑,认为这种描述无法准确反映硬件配置。
- 引用:"2.5 year old laptop is potentially the most useless way of describing a 64GB M2" (chickenzzzzu)
- 引用:"My MacBook has 16GB of RAM and it is from a period when everyone was fiercely insisting that 8GB base model is all I'll ever need." (lifestyleguru)
本地运行大模型的进展:
- 评论者认为开源模型的进展超出预期,尤其是本地运行大模型的能力。
- 引用:"Yes, the open-models have surpassed my expectations in both quality and speed of release." (NitpickLawyer)
- 引用:"Being 6mo behind is NUTS! I never in my wildest dreams believed we'll be here." (NitpickLawyer)
法律与版权问题:
- 评论者提到《Space Invaders》作为受版权保护的游戏,可能存在法律风险。
- 引用:"Space Invaders is owned IP. I have no idea the legality of a blog post describing steps to create and releasing an existing game." (bradly)
硬件升级与模型运行:
- 评论者讨论了硬件升级的需求,尤其是内存和存储空间。
- 引用:"My next MBP is going to need the next size up SSD so it can hold all the models I want to play with locally." (joshstrange)
- 引用:"Time to get a new laptop. My MBP only has 16 gigs." (mharrison)
模型的实际应用与局限性:
- 评论者认为模型在特定领域的应用(如《Space Invaders》)可能缺乏创新性,建议直接查找现有实现。
- 引用:"When it comes to specialized and narrow domains like Space Invaders, the training set is likely to be extremely small." (alankarmisra)
- 引用:"You can overtrain a neural network to write a space invaders clone. The final weights might take up less disk space than the output code." (deadbabe)
总结:评论者普遍对本地运行大模型的进展表示认可,但也对硬件需求、法律风险和模型的实际应用提出了质疑和建议。