[KongchangAI]
· 2 min read· 1,252 words

Building Mini-Harness from Scratch: A Practical Approach to Lightweight Agent Frameworks

Building Mini-Harness from Scratch: A Practical Approach to Lightweight Agent Frameworks

A Bilibili creator built Mini-Harness, a lightweight Agent framework prioritizing speed and control, tested with a 12-hour autonomous 3D scene generation task using a Qwen 27B model.

This article covers a Bilibili creator's decision to abandon general-purpose AI Agent frameworks and build Mini-Harness from scratch — prioritizing high integration, fast execution, and full controllability. The tool supports multiple API formats (OpenAI, Anthropic-style), browser control, terminal access, file I/O, web search, Sub-agents, and a Skills module, with both local directory and remote SSH project loading. The standout demo: a Qwen 27B model driving an Agent autonomously for ~12 hours to generate a complete 3D subway simulation scene. The overarching design philosophy is build only what you need — cut unused features, optimize for speed and control.

Why Abandon Ready-Made Frameworks in Favor of a Custom Harness

Many developers default to existing frameworks when building AI Agents, but one Bilibili creator made a different call — building his own Mini-Harness from the ground up. The reasoning is straightforward: while off-the-shelf frameworks are feature-rich, they come bundled with a ton of unused modules that eat up resources and slow everything down.

The author openly acknowledges that the tool's interface style was inspired by — and pays homage to — Claude Code, because "we really like this approach and aesthetic." But he stripped out the redundant features aggressively. The three core requirements were: high integration, fast execution, and full control. In his own words, "we can tweak it however we want down the line" — especially when building automation Agent tooling, where owning your own codebase makes iteration far easier than depending on someone else's framework.

This reflects a genuine engineering trade-off: general-purpose frameworks optimize for breadth, while vertical use cases typically only need a fraction of that capability. When you have clear requirements around performance and controllability, subtraction is more valuable than addition.

What Mini-Harness Can Actually Do

Despite the "Mini" label, this tool's feature coverage is far from narrow. In the demo, the author shows it can connect to multiple API formats — including the classic OpenAI format, the OpenAI Response format, and Anthropic-style interfaces — selectable from the settings panel.

On the tool side, it integrates browser control, terminal access, file read/write, file uploads, web search, Sub-agents, and a Skills module. The author describes it as "basically everything you can think of," while honestly admitting "it's definitely not as polished or comprehensive as Claude Code" — some features that weren't immediately needed were intentionally cut, to be added back when required.

Files and tools can all be uploaded

This "build what you need" philosophy is exactly what differentiates a custom Harness from a general-purpose framework: keep the skeleton, lose the fat.

Sub-agents are a key architectural pattern in modern Agent engineering: the primary Agent breaks down complex tasks and dynamically dispatches them to specialized sub-Agents for parallel or sequential processing, then aggregates the results. This design overcomes the limitations of single-context-window length, enabling the system to handle long-horizon tasks far beyond what a single conversation turn can accomplish. The Skills module typically refers to predefined, reusable capability units — similar to a function library — that Agents can invoke directly without regenerating execution logic each time, improving stability and reducing token consumption. Together, these two components allow Harness to orchestrate automation workflows far more complex than a single conversation could support.

A Real Case Study: Autonomously Generating a 3D Subway Scene in 12 Hours

The most compelling demonstration is a real task the author showed: an Agent that independently built a Counter-Strike-style 3D subway simulation scene — from environment setup to fine-grained details — running autonomously for approximately 709 minutes, nearly 12 hours of self-directed output and revision.

What's notable is the model configuration behind the scenes: it used Qwen 3.8-series 27B models — a relatively modest choice. The author emphasizes that tasks like this can never be completed with "a single prompt." They require the Agent to iterate repeatedly, with human intervention a few times along the way, gradually converging on the target.

The interface while tasks are running

Beyond game scenes, the author also mentions that Harness can drive an Agent to manipulate Word documents and PowerPoint files, or even open Blender for 3D modeling, letting it iterate and "make the work progressively more refined." The common thread across all these use cases: the Agent doesn't generate a one-shot result — it converges on the goal through continuous iteration, which is the core paradigm of modern Agent engineering.

The Qwen (Tongyi Qianwen) 3.8 series is a family of open-source large language models in multiple sizes released by Alibaba Cloud, where 27B refers to approximately 27 billion parameters. In local or private server deployment scenarios, the 27B scale is a common compromise between performance and resource consumption — more stable inference quality than 7B/8B models, without the extreme VRAM requirements of 70B+ models. Driving an Agent through a 12-hour long-horizon task with a model of this scale means the model must continuously perform code generation, error analysis, and iterative correction throughout the process — placing high demands on the model's instruction-following and context comprehension capabilities, and underscoring the importance of iteration count and strategic human intervention checkpoints.

Flexible Project Loading and Remote Connectivity

For workspace management, the tool supports two modes: local projects and remote SSH connections. Users can load a local directory directly to start a new task, or enter credentials to connect to a remote SSH server (with the option to skip passwords where not required).

In the demo, the author mounts all his projects under the server's data directory — once connected, he can create new conversations and execute tasks just as if working locally. This design makes Harness equally suited for lightweight local development and remote compute resource access.

Select a local directory to load a project

Settings Breakdown: Provider, Search, and Browser Control

On the configuration side, Mini-Harness offers a few key options. The Provider section determines how the model is connected — choices include OpenAI, OpenAI Response, or Anthropic-style format. Users also need to specify a Model ID and set a default "deep thinking" level.

Search service is optional. The author runs his own private search server using SearXNG, but notes that users can leave it blank — in that case, the system falls back to a built-in method to fetch content from the web. For browser control, the tool operates the local or specified browser via a privileged mode, enabling real web interaction capabilities.

The search server is an optional configuration

The author also mentions that the task area supports custom task types — for example, "brainstorming" modes they've defined themselves. Paired with high-throughput models like DeepSeekAd V4, this setup can rapidly handle lightweight tasks such as webpage screenshot analysis and product planning — "the whole point is removing a lot of things to make it fast." The design philosophy of the entire system revolves consistently around speed and control.

SearXNG is an open-source meta-search engine that can be self-hosted, aggregating results from Google, Bing, DuckDuckGo, and other sources without transmitting user identity to those services. In Agent development contexts, running a private SearXNG instance offers two key advantages: it avoids rate limits and costs associated with commercial search APIs, and it keeps all search activity within self-controlled infrastructure — ideal for enterprises or individuals with data privacy requirements. Privileged browser control typically refers to launching Chromium/Chrome browser processes with elevated permissions, allowing Agents to directly read/write the DOM, take screenshots, fill forms, and click elements. Compared to approaches that can only scrape static HTML, this enables handling of dynamic pages that require JavaScript rendering or authenticated sessions.

Takeaway: Lightweight Custom Builds Are an Underrated Path

This demonstration carries a pragmatic message: not every Agent development scenario needs a heavyweight general-purpose framework. When a team has clear requirements around performance, controllability, and future extensibility, building a lean Harness from scratch is often the more efficient choice.

The author mentions that the tool is available for download and trial. For developers looking to deeply understand the underlying mechanics of Agent execution — or those who need highly customized Agent workflows — this kind of lightweight custom-built solution is well worth studying and drawing inspiration from.

#Mini-Harness#lightweight Agent framework#AI Agent development#custom harness#Qwen 27B#Sub-agent architecture#SearXNG#autonomous AI agent#Agent engineering#self-hosted AI tools
Share:

Related articles