Featherweight

Featherweight is a Tcl AI agent harness . It sits somewhere between a demo and a practical AI programming tool. It has been used to develop itself from the beginning, bootstrapping from a human-written core. The development history is on GitHub .

Featherweight is a single-file Tcl/Tk application of approximately 3400 SLOC that allows a large language model (LLM) available over a standard API to develop software. It requires Tcl 8.6 or 9, Tk, Tcllib, and a curl executable for making network requests. SQLite with FTS5 is recommended to allow the model to search the transcript; FTS5 is enabled by default in recent versions of SQLite 3.

The user of Featherweight makes requests to the model through the Tk GUI. In order to fulfill the request, the model manipulates files and executes ephemeral Tcl code using tool calls . (Compare this to a human developer with eltclsh as their shell.)

The default configuration uses models through OpenRouter and requires an OpenRouter key in the environment variable OPENROUTER_API_KEY.

The idea behind the project was to bootstrap an AI harness. At the start of the project, dbohdan wrote a small core. Once the core worked, the harness "developed itself": models built it through its own tools.

Featherweight makes HTTP requests via curl (because of a possible truncation problem with http, tls, and an HTTP proxy). This means you only see completed AI turns, not those that are in progress. The model's reasoning for the turn can be viewed after it's completed.

Featherweight borrows some design ideas and tool descriptions from Strument , a larger AI programming tool by the same developer.

Contents

Screenshot

featherweight-screenshot.png

Usage

First, you'll need an OpenRouter account with some credits in it or an AI inference subscription compatible with the Chat Completions API.

For OpenRouter, generate a dedicated key for Featherweight. It is a good idea to limit maximum spend to something like $10. You can increase the limit later or have it reset monthly.

Put the key in the environment variable OPENROUTER_API_KEY. Start Featherweight where you have code to edit. Add featherweight/ to your .gitignore file or .fossil-settings/ignore-glob.

Warning: An expensive model uses up your funds quickly. Featherweight has been tested with MiMo-V2.6-Flash, which is the recommended model for new users.

Security

No.

You can sandbox Featherweight using Landrun on Linux. Strument by the same developer is security-conscious.

Code

Direct download: featherweight.tcl . For the commit history and a test suite, go to dbohdan/featherweight on GitHub.

(Attempts to paste the thousands of lines of source code were blocked by Cloudflare.)

See also

Discussion