THSC: Building a Local AI Infrastructure

Acquired intelligence is both a gift and a liability. It is a gift because it can improve reasoning, cognition, and synthesis. It is a liability because every intrusive request that reaches us competes with the things we still find fundamentally important. Our personal bandwidth is refined and shrunk.
I've used about 7 months of my personal bandwidth working on developing and deploying a useful, trainable data processing assistant. Separating that trainable assistant into compute modules, then deploying them into separate but interconnected dependent segments of one cluster. Leveraging the resources of each segment and protecting the security and privacy of the data processed and produced was my focus. Making these resources available to the end user while keeping the data far away from the data brokers is my end game. Maybe privacy won't always be such a quaint 20th century notion.
Warning, this is going to get kind of technical.
The Tiered Hub-and-Spoke Cluster — THSC — is the data architecture technology that inspired finding a solution for that overwhelming and distracting rush of pre-thought information in the information technology world. This post describes the topology, the capabilities, the enhancements required to make it work on FreeBSD, and the use cases it is designed to serve. Everything described here is either in place or in late beta. Nothing here is aspirational in the sense of "someday"; it is either running, or it is running under a beta flag and will be labeled as such.
The Core: Serendipity35.ai
At the center sits the Core: a twenty-core Apple M1 with 128 GB of unified memory and four terabytes of internal storage, running as Serendipity35.ai. The Core does the expensive work. It holds the heavy language models, it maintains global state through an OpenClaw controller, it serves as the primary data lake for structured and processed output, and it keeps the centralized audit log that records what the cluster did and why.
The Core is deliberately not exposed. It does not accept inbound traffic from the open internet. It reaches out; nothing reaches in. This is the single most important design decision in the architecture, and every other choice follows from it.
The Spokes: Three Specialized Edge Nodes
Around the Core sit three edge nodes, each with a distinct responsibility. The separation is not cosmetic. Each node is sized and configured for the shape of its work, and none of them can do what the others do.
The Sentinel — nexttroll.com
The Sentinel is the network ingress point: a FreeBSD node at 209.23.9.165 with two virtual CPUs and four gigabytes of memory, deliberately placed so that it faces the public internet rather than the Core. Its work is external API and web polling, traffic ingestion, initial packet capture, and the first pass of noise filtering. It is the node that gets hammered, and that is precisely the point: when something hostile arrives, it arrives here, where the cost of absorbing it is low.
The Buffer — cloudlocal.us
The Buffer handles transformation and sanitization: data cleaning, regex and JSON schema validation, protocol conversion from raw to structured form, and intermediate backpressure management. This is the node that turns messy input into something the Core can use, and it is where malformed data is stopped rather than forwarded.
The Archivist — beachpatt.com
The Archivist provides persistence and cache: task queue management, transient log aggregation, and a local cache for high-frequency data. It also carries the cluster's mail services, which in this architecture is not an afterthought — the Archivist is where durable artifacts live.
The Pressure-Relief Pipeline
The cluster maintains stability under load through a reactive backpressure algorithm built on a Resource Pressure Index. Each node computes its own RPI as a weighted sum of CPU load, memory utilization, and I/O wait. When the Core's RPI crosses 80 percent, the controller broadcasts a throttle signal. The Sentinel and the Buffer respond by increasing sampling intervals and reducing packet frequency, which lowers I/O pressure on the Core without dropping the work entirely.
A second control loop handles storage. When the Archivist's occupancy exceeds 95 percent, an rsync routine offloads aged data to the Core's four-terabyte pool. The Archivist does not have to be large; it has to be reliable, and the evacuation path has to exist before it is needed.
Private Tunnels and the Inversion of Direction
The most consequential engineering decision in the cluster is that all connectivity from the Core outward runs over private SSH tunnels. External nodes cannot dial in to a private LAN address, so the Core initiates. Nothing on the wire advertises the Core's location, and no port forwarding rule exists to expose it.
This inverts the convention most small clusters adopt. The usual pattern is to give each node a public address and firewall it as best you can. The THSC pattern gives no node a route to the Core at all, and makes the Core the only party that can start a conversation. The tunnel set is maintained by a single script, which opens forward tunnels from Core to each node's own loopback gateway, writes pidfiles, and can report status or tear everything down. It supports a dry-run mode that prints every command without changing anything, which is how it was validated before it was trusted.
The FreeBSD Tax
FreeBSD is a superb server operating system, and it is not the platform most AI tooling is tested against. Making this cluster work required a series of adjustments past the official release, and they are worth documenting because they are the difference between a design on paper and a system that runs.
The first is memory. On this platform, setting a V8 heap ceiling through the environment is not a tuning parameter; it is an instability trigger. Any explicit heap size, whether generous or modest, produced runaway kernel time in virtual memory faults rather than useful work. The working configuration is the absence of the setting. This is now documented in place, with the measurements, so that it is not rediscovered by accident.
The second is process management. The service wrapper can report a successful stop while the real gateway process survives, because the pidfile points at a wrapper rather than the daemon. Every stop is therefore followed by an independent check for the actual process. This is a small discipline that prevents a class of confusing failures.
The third is packet filter ordering. The cluster uses a persistent table of banned addresses, populated by an intrusion-prevention daemon. The table was correctly populated and correctly declared, but the rule that consulted it sat below the rules that permitted SSH and mail. Because packet filter stops at the first match, the bans were recorded and never enforced. Moving the block rules above the service rules made the table effective. The lesson is not about packet filter specifically; it is that in a first-match ruleset, the position of a rule is part of its meaning.
The fourth is certificate custody. A reverse proxy and a certificate client both wanted to own the same certificate material, and for a period neither did. The resolution was to let the proxy request, store, deploy, and renew its own certificates, and to retire the external client to manual use. Two systems that both believe they own a credential produce a seam, and the seam fails quietly.
The Capabilities of the Serendipity35.ai Scripts — Beta
The Serendipity35.ai side of the cluster is a set of scripts that handle orchestration, deployment, monitoring, and verification. These are functional and in daily use, but they should be read as beta: the interfaces are stable enough to depend on, and they are still changing.
The deployment script provisions and verifies the edge nodes, distributing keys and applying the packet filter lockdown before any service is started. It keeps a dry-run mode that prints its intended actions without performing them, and every operation it takes is reversible.
The tunnel script maintains the private connectivity described above, with status reporting and a clean shutdown path.
The health probe script reports on each node in a single read-only pass: uptime, load, memory, swap, disk, gateway process state, listener bindings, certificate validity, and the enforcement state of the intrusion-prevention tables. It is the first thing run when something is suspected, and it is deliberately incapable of changing anything.
The verification scripts are the ones that made this article possible. They check that a gateway is running on the version it claims, that its certificate is the one actually being served rather than the one sitting on disk, that mail is accepted and delivered rather than merely queued, and that a firewall rule is not merely present but reachable. Several of the findings in this article came from a script that asked a system to demonstrate its own state rather than trusting a configuration file.
Because these are beta, the correct expectation is that they will change. The correct posture is to run the dry-run first, to read what the script intends to do, and to prefer the check that measures over the check that asserts.
Use Cases
The cluster is designed for workloads where the data matters and the compute is uneven.
Ingestion and synthesis. The Sentinel polls and captures; the Buffer cleans and structures; the Core reasons over the result; the Archivist keeps the record. This is the pattern for monitoring feeds, regulatory filings, or any source that publishes more than a person can read.
Private document analysis. Documents arrive at the Archivist, are sanitized at the Buffer, and are analyzed at the Core, with no third-party inference provider in the path. For material that cannot leave the premises, this is not a preference; it is the requirement.
Long-running research tasks. The pressure-relief pipeline exists so that a large synthesis job on the Core does not starve the ingestion path. The cluster can keep collecting while the Core is busy, because the collecting is not being done by the Core.
Mail and notification services. The Archivist carries mail delivery and the associated authentication, which makes the cluster able to notify, report, and receive instructions without depending on an external service.
What This Is Not
The cluster is not a cloud replacement. It does not offer the elasticity, the geographic distribution, or the managed services that a cloud provider does. It offers ownership, legibility, and a predictable cost structure: your hardware, your models, your logs as plain files on a disk you can inspect.
It is also not finished. The tunnel orchestration has phases that remain to be implemented, the beta scripts will change, and the architecture will keep acquiring the scars that come from running rather than from planning. That is the point of writing this down now, while the reasoning is still visible.
Conclusion
If "free" AI makes you the product, then running your own AI asks a different question: what does it make you? The THSC cluster is one answer. It is a small, privately held piece of infrastructure in which the compute is yours, the data stays where you put it, the logs are files, and the failures are ones you can read and fix. It is not grand. It is legible, and that turns out to be worth more.


Recently, I received notice from the music service Spotify that "