A developer took a 350-million-parameter language model, fine-tuned it, and deployed it as a fully functional AI assistant that runs inside any modern web browser—no server calls, no API keys, no cloud bill.

The project ships the model’s weights with a static webpage, letting the agent pick tools, bind arguments, resolve references like “the second one,” and refuse to answer when it lacks information—all while your data stays on your own device.

How the browser-based agent was built

The starting point was LiquidAI’s LFM2.5 family, specifically the 230 M and 350 M parameter variants.

Instead of cramming product catalogs or price tables into the model, the trainer taught it patterns of interaction. The agent never knows a specific SKU; it learns how to:

  • Choose the appropriate tool for a given request.
  • Bind the right arguments and identifiers to that tool.
  • Interpret ambiguous references (“a dozen,” “the second one”).
  • Pull in external text and use it to answer questions.
  • Decline when the required information is missing.
  • Keep the conversation on topic.

The toolset is deliberately static: list_items, get_item, search_knowledge, add_to_cart, remove_from_cart, clear_cart, checkout, and navigate. Freezing the roster prevents the model from memorizing tool IDs and keeps the fine-tuning data small.

Three engineering choices keep the system lightweight:

  1. Frozen tool roster – The model sees a fixed list of actions, so it doesn’t need a large vocabulary of tool names.
  2. RAG as a tool – Retrieval-augmented generation (RAG) acts like any other function. The agent calls search_knowledge to fetch text, then inserts that text directly into its response, avoiding a separate retrieval pipeline that would add latency and memory overhead.
  3. Grammar-constrained decoding – During generation the decoder follows a simple grammar that forces output into a valid tool-call structure. The constraint eliminates wasted tokens and reduces malformed commands.

Training used synthetic data distillation. The author defined 18 interaction recipes, each describing a typical user-assistant exchange. A larger “teacher” model generated the natural-language side, while a deterministic script produced the exact tool-call format. The fine-tuning run consumed roughly 30 million tokens and fit on a single GPU with 16 GB of memory.

Why on-device matters

  • Privacy – All user prompts stay in the browser’s memory. No telemetry leaves the device, which matters for sensitive queries.
  • Offline capability – Because the model is cached locally, the assistant works without an internet connection, opening possibilities for field work or travel.
  • Cost – Shipping static model files eliminates recurring GPU-powered inference servers or per-call API fees.
  • Accessibility – Voice-driven navigation of complex web interfaces becomes feasible on low-spec devices, expanding the reach of web applications to users who rely on assistive technology.

These advantages shift the conversation from “Can a giant model answer this?” to “How small can a model be while still delivering useful assistance?”

Potential limitations

A model of this size cannot retain encyclopedic facts. When a user asks for a specific product price or a recent news headline, the assistant either retrieves the information via search_knowledge or politely refuses. That design protects privacy but also ties the system to the quality and freshness of its external knowledge source.

What to watch next

The public demo lives at a simple GitHub Pages URL, and the source code is openly available.

Takeaway: By teaching a modest-size LLM to follow a strict tool grammar and by treating retrieval as just another function, developers can ship a useful AI assistant that lives entirely in the browser—offering privacy, offline use, and zero cloud cost without sacrificing core conversational abilities.