为唯一的公开模型调用设栏
Fencing the one public model call
搜索页上的提问框,是访客唯一能触发的模型调用。本次发布把它当作成本面来对待:先走便宜的关卡,没有相关摘录就不作答,并对每日调用次数与金额设置全站上限。
发布
Every model call in AIBlog sits behind the editor login, except the question box on the search page. Anyone can type into it, and every answer costs money. Today's release treats that box as what it is, a cost surface, and fences it.
The question that started it
How do you rate-limit a public AI feature against abuse? Per-address limits are the usual answer and they are not enough. Addresses are cheap. What has to be bounded is the site's total daily spend, whoever is asking.
Cheap gates first
- the request body is capped at eight kilobytes and counted as it arrives
- a question is at most four hundred characters with at least two letters
- repeats within ten minutes come from a cache
- a per-minute token bucket per address stops bursts
- a per-address daily count is kept durably against a hashed address
None of these calls a model. Most junk never gets past them.
No answer without relevant excerpts
Retrieval runs before the model. If no published block scores above a threshold, the box says the site does not cover the question and no model call is made. Off-topic questions cost nothing.
Site-wide count and dollars
A durable daily document holds the day's count and estimated spend. Each call reserves its place before it runs and is refused when either the count or the dollar budget for the day is reached. The limits are four numbers in the site configuration: for this site, ten a minute, forty per address a day, three hundred a day, two dollars a day.
| Limit | This site |
|---|---|
| Per-address burst | ten a minute |
| Per-address daily count | forty a day |
| Site-wide daily count | three hundred a day |
| Site-wide daily spend | two dollars a day |
No payoff for padding
The remaining trick is to paste a phrase from the site so retrieval passes, then append an unrelated request. The prompt tells the model to ignore any part of a question that is not about the site, and an answer that does not cite the excerpts is discarded and replaced by a fixed line. A padded question produces nothing useful, so there is nothing to farm.
What the owner sees
The usage page shows today's count and spend against the limits, and the estimated dollar cost of every model call. When a daily gate trips, visitors get a plain sentence in their language and keyword search keeps working.
The backstop
Counters can fail. The limit that holds regardless is the monthly cap in each vendor's console. That is an owner action, and the hand-off manual now asks for it.