DEV Community

Cover image for I built a local AI engine you can access from anywhere
Linggen
Linggen

Posted on • Originally published at linggen.dev

I built a local AI engine you can access from anywhere

I was building a distributed system — microservices, message queues, shared schemas, the works. I tried every AI agent I could find. Cursor, Claude Code, Codex, others. Weeks of bouncing between them.

Each one was brilliant at one thing and broken at the rest. Great reasoning but terminal-only. Beautiful editor but thinks in files, not systems. Powerful but cloud-only — and I wasn't sending my credentials through someone else's servers. Open source but feels like 2015.

One night I just stopped. Closed my laptop. Done.

The novel

I picked up a book I'd been meaning to read. A Chinese fantasy novel — Fanren Xiuxian Zhuan (凡人修仙传). "A Record of a Mortal's Journey to Immortality." It's about an ordinary guy — no talent, no special bloodline, nothing — who enters a world of cultivators and immortals. Everyone around him has advantages he doesn't have. He survives anyway. Not through genius. Through patience, stubbornness, and an obsessive focus on building his foundation before reaching for power.

The concept that stuck with me was Linggen (灵根) — the spiritual root. In that world, it's the innate foundation that determines what you can become as a cultivator. No flashy techniques. No legendary weapons. Just the root. The quiet, invisible thing that everything else grows from.

And it hit me: that's exactly what's wrong with AI agents.

Everyone is building flashy techniques. Fancy UIs. Clever prompts. Marketing pages with animations. But the foundation — the root system — is garbage. Context management is an afterthought. Tool execution is brittle. Planning is "let the model figure it out." Permission systems don't exist. There's no way to extend capabilities without the vendor shipping a feature.

The models themselves are like cultivators with incredible talent. But they've been given broken spiritual roots. No foundation. All power, no structure.

And the other concept — Xiulian (修炼), cultivation — is about relentless, incremental improvement. Not one big breakthrough. A thousand small ones. Refine the body. Then refine the spirit. Then refine both together. Step by step. No shortcuts.

I put the book down and opened my laptop.

I built the root system

An agent, at its core, is not complicated. You take what the user said. You send it to a model. You get a response. You show it. That's the loop.

Everything else is just making that loop better:

Context management? Be smart about what you include. Don't dump everything — curate it, compress it, know when to let go.
Tool use? Let the model call functions. Execute them safely. Feed results back.
Planning? Ask the model to think before it acts. Review the plan. Then execute.
Permissions? Don't destroy things without asking first.

None of this is magic. It's engineering. Patient, stubborn, one-step-at-a-time engineering. Xiulian for code.

The first version was a Rust server calling Ollama, dumping text into a terminal. It crashed constantly. But it was mine. When it broke, I fixed it. I didn't file a ticket and hope someone cared.

So I kept building. Every night. Weekends. The loop got tighter. Tools got added. The terminal became a web UI. One model became any model. Single tasks became multi-agent delegation. The root system grew.

Then I got stuck in bed

11 PM. The agent was running a big refactor across multiple services. I'd approved the plan, felt good, went to bed.

Couldn't sleep.

Is it stuck on a permission prompt? Did it break the shared schema? Is it just sitting there waiting while I'm lying here?

I got out of bed. Walked to my desk. Checked. It had finished twenty minutes ago. Everything was fine.

I'd gotten out of bed for nothing. And that's a stupid problem.

So I built remote access. Not cloud remote access — I wasn't about to send my distributed system's configs through someone else's servers. Direct connection. Phone to desktop. Peer-to-peer. Encrypted. Nothing in between.

NAT traversal nearly broke me. But the first time I opened my phone in bed and saw live agent output streaming from my desktop — I knew this was right. Like finally forming your first Golden Core after years of body refinement. Everything clicks.

Now I check on tasks from everywhere. Approve permissions from my phone while making coffee. The agent runs on my powerful desktop. I'm wherever I want to be.

It outgrew coding

I built Linggen to survive a distributed system. It refused to stay small.

The core idea is skills — markdown files that teach the agent new abilities. Plain language. No SDK. No plugin framework. Just describe what you want.

Market research every Monday. PDF reports from raw data. Server health monitoring. Competitor tracking. Weather briefings. Someone built a skill for cryptocurrency prices because of course they did.

And the part that still surprises me: you can ask Linggen to build skills for you. "I need something that checks my competitors' pricing every week." It writes the skill, schedules it, runs it. You wrote zero lines of code.

It's not a coding agent. It's an engine. A root system. Like Linggen — the spiritual root that determines what can grow above it. What you build from it is your choice.

Check out what people have made: linggen.dev/skills.

The web UI. Because I have standards.

Here's what it looks like now:

After using every terminal-based agent on the market, I have opinions.

Reviewing a multi-step plan across a distributed system in a terminal is insane. Scrolling output that disappears. No way to see the big picture. Can't use it on your phone. "Syntax highlighting" means green text.

Linggen has a real web interface. Real-time streaming. Tool calls rendered inline with actual highlighting. Plans you approve with one click. Sub-agent trees showing who's working on what. Permission cards that explain exactly what the agent wants before it does anything.

And it works on your phone. Because that is the point.

Any model. Because lock-in is a disease.

My distributed system uses different tools for different jobs. My AI should too.

Ollama. Claude. GPT. Gemini. DeepSeek. Groq. OpenRouter. Use one, use all. Fallback chains — if one model goes down, it switches automatically. Use a local model for quick tasks, cloud model for hard problems. Switch mid-conversation.

Your keys. Your models. Your machine. No extra subscription — just pay for what you use, or run local models for free.

Agents that cultivate while you sleep

Schedule recurring tasks. Cron expressions. Code reviews before standup. Dependency checks weekly. Infrastructure reports every morning. Security scans on the hour.

I wake up to a summary of what happened overnight. Like having a diligent disciple who trains through the night and reports at dawn. Except it's real and it runs on my laptop.

Try it

curl -fsSL https://linggen.dev/install.sh | bash
ling
Enter fullscreen mode Exit fullscreen mode

Two commands. No Docker. No Python. No Node. Web UI at localhost:9898.

Remote access:

ling login
Enter fullscreen mode Exit fullscreen mode

Then linggen.dev/app from any browser. Anywhere.

MIT licensed. Fully open source: github.com/linggen/linggen


I built Linggen because every AI agent I tried was almost good enough, and "almost" made me want to throw things.

It started with a distributed system I couldn't wrangle. It took a detour through a Chinese novel about a stubborn mortal. And it became something I use every single day — the first thing I open in the morning, the last thing I check at night, from my phone, in bed, exactly like that first stupid night.

The mortal in the story had no special gifts. He just kept cultivating. One step at a time.

That's all this is. One step at a time.

Top comments (0)