跪拜 Guibai
← Back to the summary

Free APIs Are Everywhere, So Why Build a Web-AI File Agent?

免费 API 满地都是,为什么还有人做「让网页 AI 干活」这种东西

I posted a demo video: getting a web-based AI in a browser to read local files and edit code. The top comment under it said roughly this: ModelScope and Groq each give you free quotas per account, so what's the point of this thing?

Over a hundred likes. I thought about it seriously, and he's basically right.

My own reply sits under that comment: "It's really not useful, just a small project to practice agent principles." That wasn't politeness; it was my genuine thought at the time.

So this post isn't a defense. I'll split it into two halves: when you genuinely shouldn't use it, and when it still has a little use.

First, the cases where you shouldn't use it — which is most of them

You have a working API key. Then don't touch this. No matter which vendor's free quota, as long as it responds when you need it, any SDK, any agent framework, any MCP client is ten times more stable and ten times faster than "using a browser to simulate a human clicking through a webpage." I've never claimed it can replace an API.

You need stability. Web-based AI gets redesigned; the DOM changes once, and the extension goes blind. My observer only recognizes the message-content and ms-chat-turn classes. If the page swaps them out or wraps them in another layer, I receive nothing — and the symptom is "the AI obviously replied, but not a single byte landed locally." Looking at just the logs, you'd never guess it's a selector problem. This kind of failure gives no warning, and retries won't save you.

You need to run it on a server. It runs on your own computer, via a Chrome extension. There's no browser on a server, so this path is cut off.

You're building a real product. Using someone else's web page as your backend means building your product on something that changes at any time and lies outside your authorization. No need to discuss that.

When it still has use

I've received three types of real scenarios, none of which are about "saving API money."

The intranet only has web pages. Some readers said their environment has no external network, and the only LLM entry point is a chat page opened in a browser. In such places, APIs are blocked, and the extension is the only feasible solution because it only needs a Chrome.

Free quotas are flaky. It's not "no free API"; it's "the free API happens to be down when you need it." Someone commented that their free channel's keys are unreliable, and using them for real work causes delays. This is different from stability: one is 100% stable, the other is 60% stable but always available.

You want to see how an agent actually runs. This is why I built it. With an API call, you see a JSON. In a web page, you watch it emit <tool name="read_file">, the extension catches it, the local service executes, the result gets fed back, and it says the next sentence — every step is laid out on screen, and you can watch it make mistakes. It's useful for debugging and teaching.

Shortcomings I admit

Slow. One tool call goes through: model generation, DOM rendering, observer debounce (I wait 800ms of no activity before capturing, max 3 seconds), HTTP round-trip, result feed-back, then generation again. It's several times slower than directly calling an API. This slowness is structural; tweaking parameters only shaves off a small part.

Model capability is reduced. The web version doesn't give you a function-calling schema, so I have to teach it with a big prompt to "output this XML format." It often disobeys: missing closing tags, newlines inside parameters, two calls written together. I wrote a specific function in the local service to fix its habit of writing newlines as \t.

Anything that "lets AI run commands on your computer" is fundamentally a gamble. I added three gates: only listening on 127.0.0.1, a 64-character hexadecimal token, and a sandboxed working directory. Dangerous commands are blocked by a string blacklist — rm -rf, rm -fr, sudo, mkfs get caught, but rm -r -f with a different spacing gets through. I don't want to be vague here: it's not a security product.

So what is it

A small toy, plus a very narrow real use.

Whether to use it depends on your environment: if you have an API, don't use it; if you only have a web page and genuinely want AI to touch local files, you can try it, and if something breaks, go to issues and yell at me.

Next I don't plan to add features; I want to fix the first and third shortcomings above: bring the observer's 800ms down, and replace the command blacklist with command parsing. Neither of these will increase stars, but they'll make it hurt fewer people.

Comments

Top 2 from juejin.cn, machine-translated. The original thread is authoritative.

afumu

Not many people have actually used this, I'll keep this one on file. The biggest trap with this version is that after the site's redesign the extension silently stops working—returns not a single byte, and nothing shows up in the logs. If you hit it, don't doubt your own hands.

用户01766139007

Used it, it's useful.