本地AI赛博斗蛐蛐-编程篇

测试一下几个常用本地AI的编程能力

鸽了这么久,更点赛博斗蛐蛐

文章末尾有本次测试得到的所有相关文件

一、测试条件

本地环境

1
2
3
4
AMD 7940HX 
32GiB RAM
RTX4060 8GiB笔记本显卡
本地模型环境:LM Studio

使用的prompt

1
write a Python program that shows a ball bouncing inside a spinning hexagon. The ball should be affected by gravity and friction, and it must bounce off the rotating walls realistically

受试模型均为纯本地运行,所有参与模型均采用Pass@1模式,即只有一次机会输出,没有调试机会。

使用模型均为LMStudio官方来源下载。

若没有特殊说明,参试模型均采用4Bit量化版模型。

二、测试结果

Qwen3-30b-a3b-2507

可运行⭕ 通过❌ 完美运行❌ 速度⚡⚡⚡

16.24 token/s 1962 token

写出来的程序可以打开,但是球只要碰到边缘会报错退出

1
2
3
4
5
6
7
8
9
C:\Users\xqb\Desktop\1>py "Qwen3-30b-a3b-2507 [email protected]"
C:\Users\xqb\AppData\Roaming\Python\Python313\site-packages\pygame\pkgdata.py:25: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import resource_stream, resource_exists
pygame 2.6.1 (SDL 2.28.4, Python 3.13.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "C:\Users\xqb\Desktop\1\Qwen3-30b-a3b-2507 [email protected]", line 158, in <module>
    ball_pos[0] += normal[0] * (ball_radius - distance)
                                              ^^^^^^^^

Qwen3-8B

可运行✔ 通过❌ 完美运行❌ 速度🐢

8.40 token/s 14035 token

//小模型过度思考严重,消耗token非常非常多。这种比较复杂的任务建议还是用大点的模型吧。

没有报错,但是小球会直接掉出去,最后只剩下一个正在转的六边形。

Qwen3-14B

可运行✔ 通过❌ 完美运行❌ 速度🐢

5.88 token/s 12464 token

转的非常快,小球没有在六边形里面,会被打飞出去,最后只剩下一个正在转的六边形。

OpenAl’s gpt-oss 20B

可运行✔ 通过✔ 完美运行⭕ 速度⚡⚡

//备注:Reasoning Effort使用中等强度

9.58 token/s 4030 token

正常运行,打开后小球弹跳基本符合物理规律,但是小球接触边缘时边缘摩擦力有些异常,但整体表现不错。

Qwen3-30b Coder

可运行✔ 通过✔ 完美运行✔ 速度⚡⚡⚡

15.28 token/s 1889 token

表现最好,消耗token数最少的一个模型,运行良好,基本完全符合物理规律

Qwen3-4b 2507

可运行✔ 通过❌ 完美运行❌ 速度⚡⚡⚡ (thinking) 速度⚡

nonThinking66.20 token/s 2410 token Thinking49.07 token/s 11834 token

nonThinking:小球下落,但是没有到边缘时没有碰撞直接穿过去掉出屏幕外

Thinking:小球固定在中心根本不会下落。

Deepseek-r1-0528-Qwen3-8b

可运行❌ 通过❌ 完美运行❌ 速度🐢🐢🐢🐢🐢🐢🐢🐢🐢🐢🐢🐢

11.61 token/s 23884 token

太慢了太慢了太慢了,思考了27分钟啊啊啊啊啊

首先,不得不提到,这个速度扣大分。是基本不可用的级别,token消耗数量极大。

第二,不知道为什么一次输出了两个程序,而且都不可用,打开闪退/直接无法运行。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
第一个
  File "C:\Users\xqb\Desktop\1\1.txt", line 50
    p1 = [vertices[(i+1) % 6][0], vertices[(i+1) % 6]
         ^
SyntaxError: '[' was never closed
第二个
C:\Users\xqb\AppData\Roaming\Python\Python313\site-packages\pygame\pkgdata.py:25: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import resource_stream, resource_exists
pygame 2.6.1 (SDL 2.28.4, Python 3.13.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "C:\Users\xqb\Desktop\1\Deepseek-r1-0528-Qwen3-8b [email protected]", line 144, in <module>
    angle_offset += hexagon_rotation_speed
                    ^^^^^^^^^^^^^^^^^^^^^^
NameError: name 'hexagon_rotation_speed' is not defined. Did you mean: 'hex_rotation_speed'?

liquid/lfm2-1.2b

本模型由于尺寸比较小,故采用无量化版本(F16)

可运行❌ 通过❌ 完美运行❌ 速度⚡⚡⚡⚡

83.09 token/s 1519 token

尺寸太小,能力有限可以理解。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16

C:\Users\xqb\Desktop\1>py lfm2.py
1.73 0.87
1.31 0.12
0.45 0.10
0.00 0.83
0.40 1.60
1.26 1.64
Traceback (most recent call last):
  File "C:\Users\xqb\Desktop\1\lfm2.py", line 96, in <module>
    simulate()
    ~~~~~~~~^^
  File "C:\Users\xqb\Desktop\1\lfm2.py", line 62, in simulate
    ball_position = (HEXON_WIDTH / 2, HEXON_height - BALL_RADIUS)  # Start at top center of the hexagon
                                      ^^^^^^^^^^^^
NameError: name 'HEXON_height' is not defined

google Gemma-3n-e4b

可运行❌ 通过❌ 完美运行❌ 速度⚡⚡⚡

34.21 token/s 1878 token

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
C:\Users\xqb\AppData\Roaming\Python\Python313\site-packages\pygame\pkgdata.py:25: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import resource_stream, resource_exists
pygame 2.6.1 (SDL 2.28.4, Python 3.13.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "C:\Users\xqb\Desktop\1\GoogleGemma3n-e4b.py", line 30, in <module>
    HEX_POINTS = calculate_hexagon_points(HEX_RADIUS)  # Calculate the hexagon vertices once
  File "C:\Users\xqb\Desktop\1\GoogleGemma3n-e4b.py", line 27, in calculate_hexagon_points
    points.append((HEX_CENTER[0] + x, HEX_CENTER[1] + y)) # translate to correct position
                   ~~~~~~~~~~^^^
TypeError: 'int' object is not subscriptable

三、总结

没啥可总结的,本次测出的最好用的两个模型:Qwen3-30b Coder和gpt-oss 20B,散会~

本次测试的全部文件附在这里了

Licensed under CC BY-NC-SA 4.0
最后更新于 Sep 27, 2025 19:08 CST
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计

萌ICP备20249008号 本站支持IPv6访问