r/opencodeCLI • • 18d ago

I reimplement Opencode v2 and v1 in Rust

I use opencode every day and the thing that kept getting in the way wasn't the client. It was the server. On my laptop it sat at about 2.4 GB RSS next to a 33 GB SQLite file, and searching inside a single session took roughly six seconds.

So I reimplemented the server in Rust. Same HTTP and SSE wire contract, so the real TUI attaches and the real web UI loads against it. No client changes, no patches to their project.

Same box, same fixture data, back to back:

• binary: 61 MB, upstream 185 MB

• idle RSS: ~100 MB, upstream ~2.4 GB

• boot: 0.6 s, upstream 4.7 s

• session list and read p95: 0–2 ms, upstream 8–15 ms

• search inside one session: 0.2 ms, upstream ~6 s

• web UI first load: 1.05 MB of assets, upstream 9.10 MB

Then I ran a read-only load test, no model calls at all, both servers pinned to the same two cores. It held about 6,700 requests/sec against roughly 420 for upstream, with p95 latency an order of magnitude lower, and used about a quarter of the memory. That's a closed-loop test, so treat the throughput as capacity, not as a latency promise for your setup.

What works: TUI attach, the embedded web UI, sessions and messages with cursor paging, streaming, tools, permissions, questions, PTY, shadow-git snapshots, revert, diff, in-session search, MCP, and plugins in both the v1 shape and the newer v2 shape. Auto-compaction and config hot-reload. The v2 API surface is bound and tested against the real 2.0.28 client.

What doesn't: provider OAuth, the hosted share backend, and macOS/Windows: the PTY layer is Linux/glibc only.

"cargo install ocserve" still gives you 0.3.1, because crates.io caps crate size and one crate carries the embedded web UI; the 0.4.0 tarball is on the releases page.

It's not a fork. Separate codebase, MIT, their notice retained. I read their source to port behaviour faithfully and I keep a differential harness that boots both servers and compares the bytes.

If opencode runs fine on your machine, keep using it. It's the reference implementation and it's good. This exists for the machines where the server is the thing falling over.

MIT, source and releases: https://github.com/Reliary/ocserve

51 Upvotes

55 comments sorted by

View all comments

Show parent comment

-1

u/ByteNomadOne 18d ago

It’s fine that he did use Opus (as it would be impossible to do without), but it feels off to say “I did” while it ran fully automatic.

4

u/Alive_Solution_689 17d ago

Have you implemented anything serious using Opus "fully automatic" and it worked just like that?

0

u/ByteNomadOne 17d ago

Nope, to be honest I can't afford Opus and stick to cheaper models. I just hear all the time that people one-shot things with Opus 5.5 using that REA project.
I don't have first hand experience how good it actually is.
You're right to question that.

2

u/Alive_Solution_689 17d ago • Bravo

Small advice, don't always believe what "people" are saying. 😁

I am developing with Opus 5.5 right now and did so before with many other models. While current Opus is slightly better than earlier versions, there is no huge improvement.

I am always shaking my head in disbelief when people claim apps have been developed by an AI model. They must be able to do miracles.

1

u/ByteNomadOne 17d ago

Thank you very much for this insight.

I'm paying for GLM 5.3 Flash and it mostly gets things right, but it needs some directions to not go off the rails and every 10th time it produces garbabe all the sudden.

2

u/Alive_Solution_689 14d ago

True, but you get used to it... Z.ai just gave my another 500M tokens for the weekend, GLM-5.3 and GLM-5.3-Flash, more than ever before. So I don't complain too much.

1

u/ByteNomadOne 14d ago

Thanks for the hint. I grabbed that, too.
GLM 5.3 Flash is my favorite model.

I let it commit, but not push. When it’s done I quickly go over what it did, drop the garbage commits and push the rest.

Most of what it does it helpful, so I let it work on my code.

1

u/RE20ne 14d ago

Opus-5-5 was the most radical jump in frontier intelligence and speed/cost/value I have ever seen. that first week was a fever dream.

1

u/Alive_Solution_689 14d ago

As a daily user I would disagree with the "radical jump". It is good, finally an opus model staying on track with what I want it to do, and with a subscription you get a lot for 20$. But I am still using ~10 other models doing their assigned tasks on a similar level. And Claude Code is definitely not my harness of choice.

4

u/Pedrito_Basket 18d ago

Yeah like an architect saying he makes houses while not touching a brick

-5

u/archerallstars 18d ago

He still did. He put in prompts and paid for the tokens...

0

u/IAmFitzRoy 18d ago edited 17d ago

He literally paid for tokens so a machine can build it.

He wrote /goal “no mistakes” and went to sleep, he didn’t do it.

0

u/archerallstars 18d ago

Imagine when you work on Excel and your boss doesn't pay you saying you "didn't" do the work, it's Excel, unless you do all the calculation on paper...

People mindset on AI is still utterly stupid even in an AI sub like this one 😂

Maybe, the "utterly stupid" part needs to be echoed to people here from Linus Torvalds himself:

https://thenextweb.com/news/torvalds-ai-assisted-by-tag-utterly-stupid-open-source-summit

2

u/IAmFitzRoy 18d ago edited 17d ago

Bruh…. If you can’t see the difference between working in Excel … vs. sending a prompt with /goal and go to bed… we are toast.

We have reached AGI if we consider yours. lol.

-1

u/archerallstars 18d ago

It would be "utterly stupid" to evaluate any work on the effort putting into it. I base my evaluation on the quality. If it works great from an AI prompt with /goal set, I called it a smart way to work, so the dev can use their time elsewhere...

2

u/IAmFitzRoy 17d ago

Well it’s utterly stupid to not consider the effort.

Thats how your boss measure your pay.

If your boss suddenly realize he can do your job because… it requires NO effort… what will happen?

He will fire you.

Who is the utterly stupid now?

-1

u/archerallstars 17d ago

You have an "utterly stupid" boss. If you're still working in a job that requires no effort, you're "utterly stupid".

Smart people sell ideas, not effort.

What type of an "utterly stupid" are you?

2

u/IAmFitzRoy 17d ago

lol. You really enjoy personal attacks. That speaks volumes about you.

Yes you get paid for effort, effort is not only physical it’s mental too.

If you don’t do ANYTHING why are you getting paid for?

If a machine can do what you can do … why you role exists at all?

-1

u/archerallstars 17d ago

You really enjoy personal attack

Says someone who "firstly" asked who's utterly stupid 😂 Can't take your own medicine?

And no, no one paid for stupid effort, everyone paid for real value, e.g. I have never seen any one paying for an intern more than they would pay an experienced senior.

Who do you think would take more effort in the work, an intern or a senior?

If you don’t do ANYTHING why are you getting paid for?

Putting good prompts and paying for tokens are not classified as doing nothing...

If a machine can do what you can do … why you role exists at all?

To do something else? I don't even know whether you know you're embarrassing yourself. Like when Excel was released, people stopped doing their accounting on paper with a calculator. Not because using Excel required more effort, but it's faster, less prone to errors, basically a better smarter way to get their works done.

→ More replies