00:00 测试差异与查看配额
同一问题在普通助手上约 12 秒完成,在自定义代理上则接近 6 分钟;测试中自定义代理约消耗四倍配额。可在项目中输入 /usage 查看 Gemini 的五小时与每周两条配额栏,两者分别计数,且同组 Gemini 模型共享这两条配额,切换模型不会获得新的额度。查看配额不消耗额度,因此长任务开始前应检查两条配额栏。
Mervin Praison · 06:05
i ran google's coding helper called google anti-gravity.
我运行了 Google 的编程助手,名叫 Google Anti-Gravity。
one question took 12 seconds one way, 6 minutes the other.
一个问题一边只花了 12 秒,另一边却花了 6 分钟。
in 5 minutes, you'll learn 3 fixes for anti-gravity custom agents so you can save your quota.
只需 5 分钟,你就能学会修复 Anti-Gravity 自定义代理的 3 种方法,帮你节省配额。
a custom agent means a helper you set up with your own instructions.
自定义代理就是按照你自己的指令设置的助手。
in my test, mine cost 4 times the quota, which means your usage limit.
在我的测试中,我的自定义代理花了 4 倍配额,也就是你的使用限额。
and on the model i tested, each custom agent run took 4 to 6 minutes.
而且在我测试的模型上,每次运行自定义代理都花了 4 到 6 分钟。
so is a custom agent worth 4 times the quota?
那么,自定义代理值得花 4 倍配额吗?
anti-gravity is google's coding helper and it runs in your terminal where you type commands.
Anti-Gravity 是 Google 的编程助手,它会在你输入命令的终端中运行。
first you read your quota, then my test, then three fixes.
先了解如何查看配额,再看我的测试,最后讲三种修复方法。
first open anti-gravity in your project folder, then type slash usage.
先在项目文件夹中打开 Anti-Gravity,然后输入 /usage。
checking it uses no quota at all.
查看配额完全不消耗配额。
under gemini models, you see two bars, a five-hour limit and a weekly limit.
在 Gemini 模型下,你会看到两条进度条:一个是 5 小时限额,另一个是每周限额。
they count separately, so the five-hour bar can reset while the weekly one stays empty.
它们分别计数,所以 5 小时限额的进度条可能会重置,而每周限额的进度条仍然是空的。
and all the gemini models in that group share both bars.
而且,这一组中的所有 Gemini 模型共用这两条进度条。
so switching models won't give you a fresh one.
所以切换模型并不会给你新的配额。
so check both bars before a long job.
所以,开始长时间任务前要检查这两条进度条。
but what made people worry?
但是什么让大家开始担心了?
about custom agents.
是自定义代理。
custom agents live in your project folder, each with its own instructions file.
自定义代理存放在你的项目文件夹中,每个代理都有自己的指令文件。
a user reported that custom agents used about four times the quota for the same cost.
有用户报告说,自定义代理在成本相同的情况下,消耗的配额大约是 4 倍。
google replied that this is on purpose.
谷歌回复说,这是有意为之。
custom agents use up quota at a higher rate.
自定义智能体消耗配额的速度更快。
google's tip, run without a custom agent and put your instructions in a rules file instead.
谷歌的建议是:不使用自定义智能体,改把指令放进规则文件里。
so the extra cost is official.
所以,额外的费用是官方确认的。
but how much more does it really cost on a real account?
但在真实账户上,实际会多花多少?
before that, i regularly create videos about artificial intelligence on my youtube channel, so do subscribe and click the bell icon to stay tuned.
在此之前,我经常在我的 YouTube 频道发布关于人工智能的视频,记得订阅并点击铃铛图标,以便及时关注更新。
and make sure you click the like button so this video can be helpful for many others like you.
也别忘了点击点赞按钮,这样这段视频就能帮助到更多和你一样的人。
to test this, i made a custom agent that reviews the code.
为了测试这一点,我创建了一个用来审查代码的自定义智能体。
i checked it really loaded.
我确认它确实加载了。
it quoted its own instructions back.
它复述了自己的指令。
then i asked both routes the same question with the same model.
然后,我用同一个模型,让两种方式回答同一个问题。
i asked them to find the bugs in a popular python library.
我让它们找出一个热门 Python 库中的漏洞。
ai models read and write in small pieces of words called tokens, and they also think in hidden tokens.
AI 模型会以称为 token 的小段文字来读取和生成内容,它们也会用隐藏 token 进行思考。
you'd expect the same question to cost the same, with a higher price per word for the custom agent.
你可能会以为,同一个问题的费用应该相同,只是自定义智能体每个词的价格更高。
but the regular assistant answered in 12 seconds, and it didn't think at all.
但普通助手在 12 秒内就给出了回答,而且完全没有进行思考。
the custom agent thought for over 46,000 hidden tokens, and took almost 6 minutes.
自定义智能体进行了超过 46,000 个隐藏 token 的思考,耗时将近 6 分钟。
on the weekly bar, that run used about four times the quota of the regular one.
从每周用量图来看,这次运行消耗的配额约为普通助手的四倍。
so the custom agent thought far more and used more quota.
所以,自定义智能体思考得多得多,消耗的配额也更多。
i can't tell how much came from thinking and how much from google's higher rate.
我无法判断其中有多少是思考造成的,又有多少是谷歌更高费率造成的。
and can you even trust that bar?
而且,你真的能相信那个用量条吗?
the quota bar refills over time.
配额条会随着时间恢复。
so during one long run, my weekly bar actually went up.
所以在一次长时间运行中,我的周配额条实际上上升了。
so one reading on its own isn't reliable.
所以,单独一次读数并不可靠。
i only trust my cleanest pair of runs.
我只相信最干净的一组运行结果。
what held was the thinking.
始终不变的是思考过程。
in four fresh runs, the custom agent thought between 33 and 47,000 tokens.
在四次全新的运行中,自定义智能体思考了 33,000 到 47,000 个 token。
the regular assistant thought none every time.
常规助手每次都没有思考。
so you should judge a route by its thinking tokens, not by one bar reading.
所以,评估一种方案时,你应该看它的思考 token 数,而不是只看一次配额条读数。
how do you see those tokens yourself?
你自己要怎么查看这些 token?
you don't need my test script to check this on your own anti-gravity account.
你不需要我的测试脚本,也能在自己的 Anti-Gravity 账户上检查。
first, run your question with the print option and ask for the answer as json, a plain data format.
首先,用打印选项运行你的问题,并要求以 JSON(一种纯数据格式)返回答案。
then you can read every number.
这样你就能读取每一个数字。
next, look at the end of the answer.
接着,查看答案末尾。
find the number that counts its hidden thinking.
找到统计隐藏思考过程的数字。
on one custom agent run, it said almost 32,000.
有一次使用自定义智能体运行时,显示将近 32,000。
on the regular assistant, it said zero.
使用常规助手时,显示的是零。
now do this once with your custom agent and once without it on the same question.
现在,用同一个问题分别运行一次自定义智能体和一次非自定义智能体。
then compare the two numbers.
然后比较这两个数字。
so one extra option shows you where your quota really goes.
所以,只多加一个选项,你就能知道配额实际用在了哪里。
but what if you need the custom agent anyway?
但如果你确实需要自定义智能体呢?
you'd expect a custom agent to always think hard, whatever model you pick.
你可能会觉得,无论选什么模型,自定义智能体都应该始终认真思考。
so i ran the same custom agent on.
所以我用同一个自定义智能体运行了……
on the low version of the same flash model, it answered in 10 seconds with zero thinking tokens and still gave a numbered list of bugs.
在同一款 Flash 模型的低配版本上,它只用了 10 秒就回答了,没有消耗任何思考令牌,却仍然列出了一份编号的 Bug 清单。
google's higher rate for custom agents still applies, so this saves the thinking, not the rate.
Google 对自定义智能体收取的较高费率仍然适用,所以这样省下的是思考令牌,而不是费率。
and my meter was too noisy on that run to say how much quota it used, so i won't guess.
那次运行时,我的用量计量器波动太大,无法判断它用了多少额度,所以我不会瞎猜。
so if you keep a custom agent, Pick the low model for simple jobs.
所以,如果你继续使用自定义智能体,简单任务就选低配模型。
And there's one more fix that needs no agent at all.
还有一个解决办法,完全不需要智能体。
first, make a plain text file called AGENTS.md
首先,在你的项目文件夹中创建一个名为 AGENTS.md 的纯文本文件。
md in your project folder and put your instructions in it.
然后把你的指令写进去。
then run the regular assistant from that folder without the agent option.
接着在该文件夹中运行常规助手,不要启用智能体选项。
i added one test line, end every review with reviewed by rules file.
我加了一条测试规则:每次审查都以“已由规则文件审查”结尾。
both answers followed my format and ended with that line.
两个回答都遵循了我的格式,并以那句话结尾。
so a rules file keeps your instructions at the normal rate.
所以,规则文件能让你按正常费率使用指令。
when is the custom agent?
那么,什么时候自定义智能体……
Still worth it?
才仍然值得使用?
A custom agent still makes sense when it needs its own tools or helpers.
如果自定义智能体需要专属工具或辅助程序,它仍然很有用。
A rules file can't give it those.
规则文件无法为它提供这些。
And if you pay for a Google AI plan, check the credit switch in the desktop apps settings.
如果你购买了 Google AI 套餐,请检查桌面应用设置中的额度开关。
Choose never so a long job waits instead of spending your credits.
选择“从不”,这样长任务就会等待,而不会消耗你的额度。
So is a custom agent worth four times the quota?
那么,自定义智能体值得消耗四倍额度吗?
Only when you need its own tools.
只有在你需要它自己的工具时才需要。
For instructions alone, the rules file was followed in both my tests.
单就指令而言,我的两次测试都遵循了规则文件。
check both bars with slash usage, watch the thinking tokens, not one reading.
检查斜杠用法的两个栏,留意思考令牌,不要只看一次读数。
so put your instructions in a rules file.
所以把你的指令放进规则文件里。
do let me know in the comments below what you think about this.
请在下方评论区告诉我你对此有什么看法。
considering you already like this video, you might also like the video shown above.
既然你已经喜欢了这段视频,你可能也会喜欢上方展示的那段视频。
i'll see you there.
我们在那里见。
视频比较了 Google Antigravity 中普通助手与自定义代理的运行表现,并说明如何查看 Gemini 配额、判断代理是否值得使用。测试中,同一问题由普通助手约 12 秒完成,自定义代理接近 6 分钟;自定义代理产生了大量隐藏思考 token,周配额用量约为普通助手的四倍。由于配额条会随时间回充,单次读数并不可靠,思考 token 更适合用于比较。对于简单任务,可尝试低档模型减少思考;若只需固定指令,可将规则写入项目的 AGENTS.md 并使用普通助手。只有需要独立工具或辅助程序时,自定义代理才更有必要。
同一问题在普通助手上约 12 秒完成,在自定义代理上则接近 6 分钟;测试中自定义代理约消耗四倍配额。可在项目中输入 /usage 查看 Gemini 的五小时与每周两条配额栏,两者分别计数,且同组 Gemini 模型共享这两条配额,切换模型不会获得新的额度。查看配额不消耗额度,因此长任务开始前应检查两条配额栏。
自定义代理通常保存在项目文件夹中,并带有自己的指令文件。一名用户报告,相同任务下自定义代理消耗的配额约为普通方式的四倍;Google 回复称自定义代理按更高速率消耗配额,并建议不使用代理、改把指令写入规则文件。因此,额外消耗并非测试中偶然出现的现象,而是官方确认的机制。
测试先确认代码审查自定义代理确实加载了指令,再用相同模型和问题比较普通助手与代理。普通助手约 12 秒回答且没有思考 token;自定义代理思考超过 46,000 个隐藏 token,耗时接近 6 分钟,每周配额栏显示的消耗约为普通助手的四倍。由于无法区分额外消耗有多少来自思考、有多少来自更高计费速率,且配额会随时间回充,长任务期间读数甚至可能上升,因此单次配额条读数不可靠。四次新运行中,自定义代理思考约 33,000 至 47,000 个 token,普通助手每次均为零;比较思考 token 比依赖一次配额读数更有参考价值。
无需使用测试脚本,也可以在自己的 Antigravity 账户中检查思考 token:用打印选项运行问题,并要求以 JSON 格式返回,再查看结果末尾 usage 信息中的隐藏思考数量。示例中,自定义代理一次运行显示接近 32,000 个思考 token,普通助手则为零。对同一问题分别运行自定义代理和普通助手并比较这两个数字,可以更直观地判断配额主要消耗在哪种路径上。
如果仍需要自定义代理,可对简单任务尝试同一 Flash 模型的 Low 版本。测试中的代理约 10 秒完成任务,思考 token 为零,同时仍返回编号排列的错误清单。不过,自定义代理的较高配额消耗速率仍然适用;这一做法减少的是思考 token,而不是更高的计费速率。该次配额读数噪声较大,无法据此估算具体节省量。
若需求只是让助手遵循固定指令,可在项目文件夹创建纯文本 AGENTS.md,写入规则,然后从该目录运行普通助手而不指定代理。测试加入了“每次审查以 REVIEWED BY RULES FILE 结尾”的要求,两次回答都遵循格式并以该句收尾。规则文件因此能在普通助手的配额速率下保留指令要求。
自定义代理仍适合需要专属工具或辅助程序的场景,因为规则文件无法提供这些能力;若只需要固定指令,规则文件已足够。使用付费 Google AI 计划时,还可在桌面应用设置中检查信用额度开关,并选择 Never,让长任务等待,而不是消耗信用额度。整体而言,是否承担自定义代理较高的配额消耗,应取决于是否确实需要它独有的工具。
02:28 测试中,自定义代理比普通助手耗时更长、思考 token 更多,周配额用量约为普通助手的四倍。
02:56 配额条会随时间回充,比较普通助手与自定义代理时应参考思考 token,而不要只依赖一次配额读数。
04:17 简单任务可尝试低档模型减少思考 token,但自定义代理较高的配额消耗速率仍然适用。
05:15 只需固定指令时,用 AGENTS.md 配合普通助手即可;需要专属工具或辅助程序时,自定义代理才更有必要。