Building an (almost) fully self-hosted, sandboxed, agentic software factory (blog.jakesaunders.dev)

67 points by jakelsaunders94 6 hours ago

45 comments:

by ashu1461 3 hours ago

In such systems, producing code is the easy part, verification is hard. Verification via test cases just feels like the same agent validating its own assumptions.

Wondering what the actual verification loop looks like once you start taking these systems to production.

by fabianlindfors 3 minutes ago

Agreed, we had agents writing standard integration/unit/e2e tests but turned out to be a ton of work reviewing just that and hard to wrap one’s head around as a developer.

We ended up building our own test platform to reduce the human bottleneck in the verification loop.

Takes the form of a hermetic test environment that run all our code and infra in a way that matches production. Our tests interact with it from the ”outside”, e.g. by driving a browser, a terminal or making API calls.

We still have coding agents writing those tests but the big difference is that we record the browser and the API calls and can review and verify through a UI without having to do any manual testing. It also serves as a regression test suite with E2E coverage, which is kind of a must to avoid coding agents making assumptions and breaking things.

Not a huge fan of the term ”software factory” but working like this I actually think it’s achievable.

by alexpotato an hour ago

I just wrote a Twitter thread about how LLMs are like chainsaws [0]

In short:

- they are very powerful

- beginners feel like they are just as good as experts

- but they can cause a LOT of damage if you don't know what you are doing

- experts will get way more done and beginners may cut off a limb or drop a tree on their car

0 - https://x.com/alexpotato/status/2090872063464509912?s=20

by NewsaHackO 19 minutes ago

People have been making analogies like this since 2023, hardly worth a link to a random twitter thread.

by ReplaceMe 7 minutes ago

Maybe unpopular prediction:

I think vision models will come more into play for validating things. It’s the most like consciousness, and less like - as you put it an LLM validating its own assumptions.

It’s at least an independent way of analyzing the work (as glyphs and images).

by bheadmaster an hour ago

I've had an idea for an automated verification for a while, but too busy to implement it.

For every property of the system, implement a mock that simulates a system that works, and multiple variations with forseeable bugs (models are fairly good at predicting possible bugs). Then, write a unit tests that pass on the working simulation and fail on the buggy simulations.

This way model ensures reasonably well that the unit tests test what they're supposed to. Then, you use those tests as a verification to guide the model to implement the functionality.

This approach relies on the assumption that the model can design a reasonable architecture composed of independently-testable modules. In my experience, frontier models should be able to do that.

by bgilroy26 2 hours ago

It's really funny. I would read HN headlines about PhD research in the area of https://en.wikipedia.org/wiki/Correctness_(computer_science) and it always seemed really boring

Now it is obvious to me how important this work is

by thorrester32 an hour ago

We’re actually working on this problem. It’s an interesting space to be in. Initially started with static code verification, but now we’re expanding into the area of behavioral verification (does design intent match behavior) across the application lifecycle. Currently working on getting some open source stuff ready. Check us out (https://bohmian.ai - don’t mean for those to be a plug, it’s just relevant)

by sejje 2 hours ago

Some people have alternative models review each other's output.

The future might be parallel attempts and selecting the best-of-N solutions.

by alasano 2 hours ago

I'm building an orchestrator just for the "build" part of building.

The only thing we've truly got left realistically is deciding what to build and making all the product decisions on how it should work.

So that's what I'm trying to enjoy the most now and then when I'm done planning and writing the spec I just delegate to my orchestration engine and walk away while it builds.

It spawns fresh agents to implement, then verifies mechanically (test/lint/build etc.), then fans out multiple reviewers across different providers/models, all those findings go into a triage step with an agent who is given standardized context of previous triage and review rounds and who deduplicates issues and writes guidance for fixing issues fully, then a fix agent gets spawned , then a post-fix verification agent and then back to review until no more issues are found.

For a large feature it can work for a day or more uninterrupted and contrary to just using something like /goal or having an agent orchestrate the whole process, the code stays on track and gets delivered as close to the spec as possible.

All this repetition is necessary if the goal is to be able to generate tons of code and maintain quality while not needing to review everything yourself.

by RajT88 5 hours ago

So - apparently it's not fully self-hosted, since I don't see a GPU.

I'm interested in hearing from folks who are hosting their own GPU to run coding models. So far my own results are... not great. Seems like frontier models are needed via the big providers?

by primitivesuave 4 hours ago

My favorite real-world example that I worked on: I created a YouTube documentary series about corruption in a small town in Illinois. This required downloading thousands of hours of government meeting videos from YouTube, transcribing + chunking + embedding, summarizing meeting segments, running a couple passes of validation, then searching for interesting storylines. I also scraped thousands of public documents which exposed campaign finance violations and some truly nefarious stuff going on behind the scenes.

I did 90-95% of the work on this with a local GPU. I still ran Claude and Codex, but they were just writing code to orchestrate API calls against local models, local Whisper, etc. Doing the same with the public cloud would have cost thousands of dollars, instead it cost a few hundred dollars for a frontier lab subscription and tens of dollars for electricity.

I recently got into the DGX Spark and just a month ago, got an AMD Ryzen developer platform. Both are incredibly useful tools for some upcoming projects I'm working on (also related to government corruption), but in my limited experience of trying to run opencode on them, the "good models" are still completely unusable because the system prompt alone requires a minute of thinking.

by iforgetti 3 hours ago

Sounds amazing! What’s the name of the series if we wanted to find it on YouTube?

by RajT88 an hour ago

I don't know the creator handle or series name, but it's got to be Dixon, IL. lol

by 1123581321 23 minutes ago

Can’t be if they were having to scrub government meetings to put the puzzle together. Unless, of course, they made this before she was caught. :)

Completely coincidentally, I’m typing this from the Aldi at 88 and 26, waiting out a storm.

by 0x457 5 hours ago

I recently picked up R9700 to run Qwen 3.8-27B.

1) I have knowledge DB that I query, spend a lot of time to get "query N models, stream to me all N results, let me pick which one" - only to find out that qwen beat all other contenders (those were picked before I got R9700, so the rest is =<8B parameters)

2) Setup OpenCode to use it and gave it a few tasks:

   - first task (new feature to my MCP) took 40 minutes to complete with zero input from me, while it took 20 for sonnet-5 and sonnet-5 kept bugging me. Results are near identical.
 
   - second task (port a specific version of a package to my flake) it got stuck in a hilarious loop where model already been told what hash to use by nix itself, but it wanted to figure our how to get hash another way for some reason.

   - third task (another task, but much harder than first one with most of the discovery already done), kept doing discovery and running out of context, went through 3 compactions (256k context is what I can fit on R9700). Room got too hot, so I stopped it.

  3) virtual assistant like Hermes but my own: no notes, works great.

I'm pretty sure codding issues are just harness and lack of memory that Claude Code already had. Pretty nice setup, similar to mine but I built my own lightweight PaaS that is highly specific to what I run.
by nater5000 5 hours ago

I have a similar setup to the OP (although I'm not sure if I'd call it a "software factory"), and I utilize a local model for some aspects of the setup. Specifically, I have a single RTX 3090 Ti with 24GB VRAM on my (main) home server, and I've been primarily running Qwen 3.6 35B A3B out of it via Ollama (I just switched to Qwen 3.8 27B, though, and I've also tried other Qwen models as well as Gemma models).

The Qwen models are decent, but they don't come close to the full Claude experience I've come to expect. As such, I only use the local models for specific tasks where it makes sense to do so. Really the setup is that my Claude-powered agents are able to incorporate my local model into work it builds out. The agents can perform inference against the Ollama API as they see fit, and I encourage them to do so for tasks where (a) the low-level capacity of the local models make sense and/or (b) where costs can become a concern.

It seems to work well when it comes into play (like having Claude drive a web browsing session but letting Qwen handle much of the actual browser interactions, image analysis, etc.). Still, Qwen just isn't smart enough (or fast enough on my machine) to handle anything agentic that isn't non-trivial.

by Philpax 3 hours ago

Using a RTX 5090 ($3~4k), I can run Qwen 3.8 27B at ~180 TPS with ninfer [0]. With its thinking maxed out, I can confirm that the quality of output is roughly on par with Opus 4.5~4.6 - that is, this 20GB file really can write software by itself, but the amount of thinking required makes it strictly slower than larger models, even at 180 TPS.

Still, it's largely replaced the cheap tier of the frontiers that I would otherwise be using. It can be run with older GPUs (a 3090 is ~1k), but the time spent thinking will become a fairly noticeable impediment for staying in the flow.

The next step up would be to run DeepSeek V4 Flash 0731 on two DGX Sparks (~$10k), which serve at 60 TPS and sit somewhere around Opus 4.7 level without 3.8-tier thinking.

However, it is worth noting that, if you are buying this hardware just to serve LLMs, it is not cost-effective. It would take over a decade of continuous use to make back the cost of the DGX Spark setup in 0731 tokens. I'm running this setup because I happen to have a 5090, and the two 3090s in my server were cheap enough when amortised over several years.

[0]: https://github.com/Neroued/ninfer

by dang 4 hours ago

We've put almost back in the title above.

(Submitted title was "A self hosted AI software factory")

by jakelsaunders94 4 hours ago

Apologies, I was trying to choose between a snappy title and the whole story.

by yipinwong 4 hours ago

Check out some NIXOS communities. People they are doing fun crazy stuff, as NixOS is immutable, thus creates separate sandboxes (building/taking down) per agent, etc.

I don't know most of the stuff there, but at least you can dive there.

by fxtentacle 2 hours ago

"using Codex for inference" says the article

by Kinrany an hour ago

Is there a name for the infrastructure stack that is designed to be operated by a human instead? Spawn agents each in a separate VM with the repo checked out and the tooling set up, allow them to spawn subagents in the same manner, but pull their changes from their branches (set up as remotes in your own dev environment) and merge into trunk yourself?

by t0mas88 39 minutes ago

I've created a simple project for that, except that by default they open PRs on Forgejo/Github/Gitlab. It's open source and the workflows are config files, so you can configure it to allow you to pull from them instead of creating a PR. Source: https://github.com/smithy-ai/smithy-ai

One way I use it that is similar to what I think you want is to run a local Forgejo instance (just like OP) and have the Dockerised Claude instances work in that, then pull from there to my local git repo, review, test etc and push from my local repo to a remote like Github.

by copemaxxxing 4 hours ago

People who build software factory are in for a disappointing future. Spoken as someone who uses AI day to day for job and personal projects, I've came across a few super gnarly bugs already, ranging from frontend React apps (yes, believe it or not, frontend is far from solved) to embedded that Claude can't solve. Those bugs are feature breaker. My primary skillset is fullstack/frontend leaning, not embedded. Granted, I might be out of depth in embedded/RTOS but I am very qualified to do frontend. Yet I found bugs in those areas that Claude Opus high can't even solve for hours.

I pointed Claude at those for hours and hours, didn't fucking work, ended up creating more and more slop. Until I stepped in and fixed it in a few lines of code. Thankfully with all my AI assisted work, I took time to understand everything so I was able to debug and fix.

The problem for software factory is, that up to a certain point, you'll encounter some nasty bugs that are really important for your features, but you can't ship it because while the AI deals with the 90%, turns out that last remaining 10% are the one that make or break your project. And you need to deal with that remaining 10%. But how can you deal with the remaining 10% if you don't understand that 90% or majority of it?

Also, don't listen to influencers like Kent Dodds or Uncle Bob or Steve Yegge, who advocated for software factory walk away from the code kinda thing. They are already rich, and they sell teaching content, but most importantly, their time in this industry has passed. They are not in the weeds doing enterprise software development anymore.

Their first and primary concern is trying to be relevant to sell courses. They don't care about you. Yes I used to listen to them (though not often), but now not anymore. The world doesn't get better or worse whether they choose to sip margarita on a beach or spin yet another "so many words to say absolutely nothing" video/blogs.

by tcdent 3 hours ago

What most people leave out of the conversation is the element of time. We are early. The technology continues to improve.

Is it perfect now? Absolutely not. Will it continue to get better at a surprising pace? Absolutely yes.

So, just adjust your framing from "we're there" to "we're getting there" and all of your concerns go away.

by jagenabler2 a minute ago

On the other end of it, people regularly leave out the "why" and "how". Why do software factories not work at scale right now? What are the pieces of building software that agents don't excel at? Is it possible that the 10% that it can't get right, it'll never get right? Is the technology actually improving in the direction that makes this a possible future or we at a local maxima?

I won't admit to knowing the answers, but it feels like there's a lot of discussion that needs to happen around the meta of software engineering and systems before anyone can make conclusions about the direction of the technology.

by codazoda 4 hours ago

I was recently inspired by another article here to start my own. My skills are written and tested, the factory has built the first test project, and I’m setting up the final machine to run it. Here’s my initial post about my motivation and early plans plus some follow-ups, and there are more to come.

https://joeldare.com/creating-a-minimal-dark-factory

by jakelsaunders94 4 hours ago

Just read the intro post, it’s a good read! I’ll read the rest when I get home from work. It’s nice to see others have had the same idea.

by theahura an hour ago

(soft plug: in case this is really exciting to you but you don't want to own all of this infra for your company, check out our "software factory" factory over at noriagentic.com)

by ramon156 4 hours ago

Can anyone that has OpenClaw/Hermex experience tell me what it's like working on this over OpenCode served?

On bigger tasks OpenCode sometimes hangs. I'm not sure if that's on the provider side or on my network side, but i sometimes have to stop a subagent because its done but doesnt clean up. I wanted to try Pi, but now I'm wondering if Hermis is a better fit.

by deweywsu 3 hours ago

Why is it always assumed the reader knows the function of 15 obscure libraries and/or frameworks when posting projects like this?

by ashu1461 3 hours ago

I don't know most of these tools either, but that is why I find posts like this useful. Don't you end up learning something new in cases like this?

by mimischi 3 hours ago

I can relate to this feeling, having encountered it many times in academia. But the inverse would also be true, would you stop reading yet another article that explains for the umpteenth time what library Y does? Not arguing for the author, but there’s certainly something about knowing and writing for your audience.

by ceejayoz 3 hours ago

Maybe it's assumed you're capable of Googling?

by complex_fir_rea 2 hours ago

I skipped straight to the end to find exactly what I expected the tutorial would cover: security and isolation.

by 100percentjake 5 hours ago

Neat stuff. I use Hermes with the $20/mo ChatGPT Codex integration, myself, as well as Qwen running locally on a 64GB M1 Max Macbook Pro to help save my ever-quickly shrinking Codex credits. It's been wonderful for stuff like, say, giving Hermes an account on my Home Assistant server (after taking a backup) and having it make a bunch of configurations, or draw conclusions based on historical sensor data (trying to determine if my A/C is undersized by feeding Hermes all the capabilities of my system, size of house, and letting it pull room temp sensor data from HA is one project I did recently), is absolutely fantastic. It also spins me up little webapps for things like a very me-specific RSS reader, a "to do" checklist that references my email (and archives said emails when I mark an item off the list), and various little internal IT tools and report generators.

The Hermes subreddit is a curious place where every second person has quick their $300k a year job and is making a living off of Hermes doing... something? They treat themselves as the CEO of a bunch of agentic employees and have AI generated infographics of their "Stack" (all hail the mighty Stack) and everybody stands in a circle and applauds the most convoluted Hermes setups you've ever seen with not a single word how any of this is supposedly making anybody any money.

Are people developing like this? Are people asking money for something they one-shot instructions to an orchestration agent which delegated to fifteen other agents in Kanban and then spat out something that "works"? Every project I've ever had an LLM do a majority of the work for me has been strictly for my personal use; I'd never let anyone else use this stuff because it doesn't pass the vibe check. When a new frontier model comes out I'll pass the previous frontier model's work past the new model and let it tear it to shreds and see what improvements could be made for shits, giggles, and to waste a week's worth of tokens in the course of thirty minutes, but Reddit is overflowing with seeming non-coders who are passing this 100% organic slop off as sellable product?

I need fewer morals.

by pmontra 4 hours ago

In my experience agentic sw development delivers if you are not too picky with the details or if you don't notice what's not done according to your instructions. If you want exactly what you had in mind, the last 10% might last a very long time and cost many tokens. More or less like working with humans.

by jakelsaunders94 4 hours ago

That’s a great use of Hermes. Had it concluded if your A/C is undersized?

Before this little experiment I generally used it as a very specific search engine for houses, ‘Find me a house in the country but close to amenities with a workshop barn but close enough on the train to Manchester’. It’s great for this!

I’ve never been on the Hermes subreddit I’m gonna go check it out. I agree with the commenter below, it’s fine when I need no record my reps but don’t really care how. It writes tests but I don’t verify. It’s a manual ‘works or it doesn’t’ Thing. I’d never sell the code to anyone.

by pianopatrick 4 hours ago

Maybe I missed it but what AI model did you use for this?

by ramon156 4 hours ago

> All on my home server, without another cloud infrastructure bill. The only ongoing cost specific to this experiment is a £20 Codex sub.

by mettamage 2 hours ago

Quite a lot of people are automating the SDLC now and are looking at dark factory solutions.

by mempko 5 hours ago

It seems at this stage hermes has the upper hand over OpenClaw in people building multi-agent systems. What about hermes do people like above OpenClaw. I'm building a completely different kind of "software factory" called Abject and I'm curious what people are valuing in Hermes above other systems.

by tcdent 5 hours ago

People assemble projects from a collection of buzzwords these days without understanding the underlying technology. Did he need to use tailscale to interact with the box remotely? No. But, it's what a google search will tell you to do.

by aitchnyu 4 hours ago

Please share a link if its on the internet.

Data from: Hacker News, provided by Hacker News (unofficial) API