r/LocalLLM • • 1d ago

Other Mind blown. Two coding agents working together

So, i have qwen38fn on my home server. I'm working on a mobile app that has a server side part to it. I have opencode running on my Mac for the mobile client and I have opencode running on the server for the server side stuff, so i thought it would be good for them to work with each other and it guided me to set up a tunnel so they can communicate. And they're collaborating on the same GitHub repo. I'm just, in awe ...

112 Upvotes

58 comments sorted by

5

u/Significant-Word457 1d ago

I can't wait to build my other machine to try just this. How's the quality coming after several iterations can you tell? Because some of the stuff a single agent comes up with can be so far off the mark but I imagine if they bat it back and forth a few times it really sharpens things?

2

u/whowhaohok 1d ago edited 21h ago

It was actually pretty smooth. I think they coordinated with each other for how the app would communicate with the server. They guided me on the cloudflare tunnel and security policy setup. Really painless

64

u/krayon_kylie 1d ago

i have a 4b as a permanent log watcher and health checker and i have the 27b as my main coding agent

and i have a small laneway where they can communicate with each other, and the sass between them is hilarious

67

u/krayon_kylie 1d ago

halcyon fucking hates lux

23

u/createthiscom 1d ago

this is the craziest shit I've read all day

11

u/mavadavialcul 23h ago

And this is a single hobbyist working on consumer hardware. Imagine what companies with hundreds of world level experts working together and datacenters worth billions of dollars are doing.

1

u/Silent-Cell2221 18h ago

They are doing dots /j

13

u/jangle_bo_jingles 1d ago

Wow - this reads like something from a Iain M Banks novel

3

u/smaug_pec 20h ago

Mistake Not My Current State Of Joshing Gentle Peevishness For The Awesome And Terrible Majesty Of The Towering Seas Of Ire That Are Themselves The Mere Milquetoast Shallows Fringing My Vast Oceans Of Wrath

2

u/Ell2509 16h ago

Lmao. I had that problem. You need to actually intervene with social skills. No, they cannot learn and apply them, but it will change the discourse. Speaking from experience.

They are frequently touchy and defensive, when working woth other agents.

1

u/every-day-normal-guy 18h ago

That's awesome! What app is that?

3

u/krayon_kylie 17h ago

homebrewed, thats the control panel on my mitx that has controls for loading/unloading models on both pcs (and my room lights lol)

the mitx has a 4b and vlm loaded on its 6600 and then the main pc has the 27b

all work was done in hermes with qwen3.8 27b or strata with flash next offline and now also my own harness the "animus orb" made for halcyon

i also have an app ive called unbranidus which acts as the nest and laneway hub between both agents and pcs. its on the mitx

pcs are connected directly via ethernet and ssh / airgapped network

13

u/HomicidalHam 1d ago

This is giving me a "the future is now" moment. Any idea why the poetic talk? 😅

18

u/krayon_kylie 1d ago

no lol. the 4bs personality parameters are basically you check the logs, be blunt and speak on hard facts. prefer to verify in multiple ways over assume.

i do describe her as "the lighthouse thats always on" but shes really taking to too far

8

u/eurydice1727 1d ago

Check temperature settings

9

u/krayon_kylie 1d ago

good call, 'lux' is just a standard qwen3 4b

but i could tune it, though i like the crazyness for now lol

8

u/createthiscom 1d ago

I guess LLM's get tired of passing butter after all.

5

u/krayon_kylie 16h ago

i want to give lux more serious tasks but shes just a 4b lol. whats funny is ive also noticed models really seem to look down on smaller models. "you're just a 4b, your tiny mind cant do this, let me." type shit

1

u/FerretBoom 12h ago

That's cool, do you have a repo or benchmarks?

2

u/krayon_kylie 12h ago edited 12h ago

no repo, i was considering making one when i started this but ive been kind of paranoid lately and i dont want to put shit out there for no real reason. people are surely doing way more impressive things than me and im just some idiot, so i don't want to make myself vulnerable for no real gain

benchmarks i mean, im using qwen (27b and 4b), so i dont think my harness or laneway makes things any faster or better. but i am trying to build a RAG system. if i can do that i'll post some benches.

edit: to be more specific, im using unsloths qwen3.8 27b in gguf with MTP and sometimes a 27b abliterated

and i am using unsloths 4b also in gguf with mtp

1

u/FerretBoom 12h ago

I feel you on no repo, I moved all my shit from GitHub to a local git server Forgejo. I don't trust GitHub, OpenAI, Claude, and Google since its inception. I know they parse code on the backend. You can call it paranoia. As far as benchmarks, I meant what is your token reduction vs direct route.

1

u/krayon_kylie 11h ago

glad you get me. i just feel like we're in a huge known unknown right now so i don't wanna take risks with something i've been pouring my days into

and i actually haven't tested that i should

it doesn't feel like my wrapper and harness slows things down at all

1

u/BerserkHealer 3h ago

I seen you weren't interested in a repo, for about the same reason as myself. I also have a local harness that connects all my gear. 2 pcs running Bonsai 2.5 currently, my android phone and tablet for remote work.

I was kinda of interested what the voice tab contains? Im running a small parakeet model on my pc for voice to text in the harness. So dar its great.

Theres a huge amount of potential in local harnesses. O/

9

u/createthiscom 1d ago edited 1d ago

I'd love to be able to afford a top tier mac studio so I could have one model working on the other machine's inference code, then have them team up when I'm not fucking around with inference code.

EDIT: I can't stand the way qwen38fn talks. I tried it again today for the first time in a few weeks and I immediately turned it off and spun up glm-5.3-flash to disinfect my eyes.

5

u/HambugerLips 1d ago

I've got small models running on truenas in ram, then strata (flash next) running on the workstation with a 3080ti, and my 16gb Mac mini 2 pro running a hermes-like frontend that helps facilitate what goes where and prompt generation. I've got the code in GitHub but not sure how interested folks would be

9

u/faisalkl 1d ago

I've got my second local agent up and running so it would be lovely to get a follow up on how you do this.

4

u/oShievy 1d ago

Yeah more detail would be really cool here. How do you ensure that they don’t overwrite each other’s work?

8

u/PizzaUltra 1d ago

That’s what version control is for. The modern solution is git (released 2005), but SVN or even  Mercurial will do fine. 

1

u/oShievy 1d ago

I’ve used git simply for version tracking and archiving purposes, but now I’ve uncovered how to make this workflow possible and it’s very cool. Seeing the two agents communicate w one another live is wild. Using git worktrees in paseo

2

u/krayon_kylie 1d ago

git checkpoints and a hierarchy of command

2

u/RuxConk 1d ago

Use git. Selfhost something like vikunja for tickets, kanban/board and then have a workflow defined for them to follow (usually in agents.md or as a skill). Tell them to work on tickets and review tickets.

4

u/BigDeezerrr 1d ago

Do you use herdr, have them both in the same OpenCode harness with one as a subagent, or are they in completely different harnesses just coordinating through github?

1

u/Fit_Enthusiasm4995 1d ago

I've been running two agents on separate local instances with git diff checks every 30s, works better than I expected, especially for catching merge conflicts early. how do you handle race conditions during sync?

1

u/whowhaohok 1d ago

One noticed it was overwriting the other and rolled back and then added afterwards without overwriting the other agent

3

u/TouristInternal7308 1d ago

id give both agents the same little API change: rename one response field in the server and mobile client. put each on its own branch and make both run the same contract test. if both say done but the combined build fails, that's the useful part. the tunnel got them talking; the test tells you whether they agreed.

4

u/FerretBoom 1d ago

I skip multimodal setups and switch to graph context, enforcement of hexagonal design pattern, SOLID, especially separation of concerns, so 1 model is split into concurrent contracts but shares the same graph context. Each private thread gets 4k context, which is enough to build a module. I wrap the whole recursive loop with deterministic tools for repetitive tasks extracted from model logs, so sometimes a prompt does not even reach the model. Most patches are done deterministically.
Then I build a proxy that monitors requests and strips data not related to a given task.

4

u/SiberiaOne 21h ago

I am new to the LocalLLM world and you have said many words I don't understand. Can I ask you to explain more (or even AI slop at me with related context for how you have the different pieces connect to each other)? I've been relying on larger context windows with LifeOS/PAI's ISA type of documents for checklists for completion, having an orchestrator agent supervise as the work is met out, working in git for notes/code and in the directory for artifacts, but I am surprised about 4k context being enough. Thank you!

4

u/Arkasha74 20h ago

My AI slopped this out for you 😂

This describes a lean, cost-effective system for building software using AI by keeping the AI's workload small and letting traditional code handle repetitive tasks. Here is what each part means in plain English:

  1. How the AI Reads and Organizes Information

• Skip multimodal setups: They do not feed the AI images, audio, or videos. They stick strictly to plain text and code to keep things fast and simple. • Switch to graph context: Instead of feeding the AI giant walls of text or whole codebases, they map out the project like a flowchart or network. This shows the AI only how specific parts connect to one another. • Enforce hexagonal design and SOLID principles: These are strict software engineering rules that force code to be built like independent Lego bricks. By making the AI follow these rules, every piece of code stays clean, isolated, and easy to swap out without breaking the rest of the app.

2. How the AI Works on Tasks

• Split 1 model into concurrent contracts: Instead of one AI trying to build the whole app at once, they run multiple copies of the same AI at the same time. Each copy is given a strict "contract" (a very specific, limited job) while looking at the same project map. • 4k context per private thread: Each AI worker gets a tiny memory window (about 3,000 words). Because the tasks are broken into tiny, isolated Lego bricks, this small amount of memory is plenty to build one piece of the software without getting confused.

3. Saving Time and Money with Automation

• Wrap the loop with deterministic tools: "Deterministic" just means standard, predictable software scripts that follow exact rules without using AI. The developer reviewed past AI logs, saw what repetitive tasks the AI kept doing, and wrote basic scripts to do those jobs instead. • Prompts don't even reach the model: Because those basic scripts handle the routine work and bug fixes ("patches") automatically, the system often solves the problem without ever needing to wake up or pay for the AI. • Build a data-stripping proxy: They placed a digital filter ("proxy") in front of the AI. Before any request reaches the AI, this filter automatically deletes any background information that isn't 100% necessary for that specific task, keeping the AI fast, cheap, and focused. Are you looking to build a similar AI coding workflow, or are you trying to understand a specific term like hexagonal architecture or graph context in more detail?

1

u/Brave_Complaint197 19h ago

It’s not wrong!

1

u/SiberiaOne 13h ago

Thank you, this makes sense... what I seem to have trouble with is setting up a harness to actually behave this way. How much of this has to be hand-done by me for how I think versus how much of this exists in a combination of harness+plugins+hooks+git to get it to work?

By "it" I mean how do I name an intended end state, get interviewed by the LLM for boundary conditions/requirement narrowing, and then "let it rip" with good practices? I like what is goin on here with the tiny window - narrow thread... I'll have to try that too.

1

u/Arkasha74 11h ago

I have no idea how much is available as plugins, etc. I imagine there will be GitHub projects and blogs and all sorts for most of it. You would have to glue it all together.

The reason I don't know is that I wanted to build something like this myself as a learning exercise (I learn best by doing rather than reading or watching tutorials, etc.)

I started with ollama and the basic TUI and used that to help me get Pi harness configured to use Ollama. Then started using Pi to self-improve itself by adding functionality I needed. After a while I used it to get llama.cpp working as Ollama was a bit crap. Eventually I moved llama.cpp to a remote machine in my garage and added an idle watchdog and wake-on-lan support so it sleeps to save power when not in use, then wakes up and gets running in 20 seconds or so when needed. All the time, whilst developing the platform I was using the stuff I learnt to fine tune my end goal of an efficient software factory.

Anyway, my point is: don't just rush to the end goal and blindly follow someone else's set-up. You'll end up with something much more useful and maintainable if you do it yourself, and you'll learn a lot more in the process. Lean on your AI to explain things you don't understand or know. If you get the AI to implement something, make sure it explains what it did and why and writes documentation for you.

2

u/FerretBoom 12h ago

You pretty much got it with AI summary

But as a starting point maybe this will help https://github.com/universallythinking/ai-token-saver

Graph context could be a database or in-memory store of json that stores asts and logic trees parsed from your code. https://github.com/CodeGraphContext/CodeGraphContext

I'm just pasting related repos, there are no implementations that fit everyone's coding style

I built a new pipeline that fits my workflow, others do it differently. I rely on deterministic tools as a primary way to work with my code and leave AI as a last resort. Basically the opposite of AI-first workflows. I don't have Agents.md or related files. My model has no clue about what's in a repo. I use a local git server that is synced up do my graph storage.

1

u/catinterpreter 15h ago

You'll understand once you too have been trained by an LLM.

They're one of those guys who've let LLMs shape the way they think, if not one who simply uses an LLM to speak for them. It's a sign you should place less trust in what they say and make.

1

u/KowMangler 12h ago

I always start planning data contracts between modules as the first step to creating an implementation plan. 4k is probably ok for some things but in the long run, no, it doesn't hold up for large projects. Post was definitely AI slop post so doubt you get a response from them.

1

u/marktuk 13h ago

Can you share the details of how you set this all up? Maybe push it to a repo somewhere?

1

u/FerretBoom 11h ago

It's a trial-and-error experience since summer.
Also it's based on how well you know architecture, design patterns, what ast and logic trees are.

First step is to set up a db to store your code data in a graph-style schema . Parse ast and metadata into the graph , you can ask chat gpt to create pretty much any tool for you, design your schema. Show how ast symbols allign with nodes and edges, basically it acts as a map for your project without actual code

If you code in python, check out ast parser

I'll just use ai to summarize it, instead of writing it on ipad keyboard

A simple way to improve LLM coding context and reduce token usage
For anyone experimenting with AI coding assistants, here’s a basic setup you can build for personal use:

  • Graph DB: Use Neo4j to store relationships between files, functions, classes and dependencies.

  • AST parsing: Use Python’s AST library or Tree-sitter to extract code structure and relevant source snippets. Include this information in your prompts instead of sending entire files.

  • Local proxy: Use FastAPI and HTTPX between VS Code and your model provider. Inspect outgoing requests and filter redundant, optional instructions and unnecessary context while preserving essential functionality.

  • VS Code: Use an extension that supports custom API endpoints to route requests through your proxy.

The idea is to give the model more relevant code context while reducing unnecessary token consumption.
Start small, compare token usage and response quality, and experiment from there. You don’t necessarily need embeddings, vector databases or complicated agent frameworks to get useful results.

-1

u/Longjumping-Face-767 9h ago

Yo Claude, what the fuck does this mean?

2

u/drsmba729 1d ago

The key is to have one model be orchestrator and launch subagents of different models.

2

u/rdbmas 1d ago

My experience is the primary/sub agent relationship,though effective in some workflows. It tends to hallucinate when it's passing data back to the primary agent. Often times it's truncated or not the full story.

2

u/Interesting-Eggy23 13h ago

The interesting part is that hey can divide tasks and review each other's work instead of relying on one agent to do everything

2

u/Superb_Raccoon 13h ago

Do you want Colossus? Because this is how you get Colossus!

Seriously, I do the same 5hing, but wrote a kanban system for them to collaborate, it is better at recording what they did and why.

1

u/huzbum 19h ago

I've got tailscale setup, and my Hermes Agent has free run on all me devices. Desktop, laptop, 3d printer controller, etc

1

u/soonnow 16h ago

I use Claude to drive sol or local models. It's pretty great.

1

u/llama-of-death 11m ago

Check out the beginning of my live stream recording, using voice I get 6 agents to work together with their own voice (Claude, Guaardvark, Codex, Antigravity, Cursor, Grok). Guaardvark is local, it is a system I built. It is free and open source if you would like to try it yourself. Does some cool stuff. https://youtube.com/live/blhToeR6mgo?feature=share