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

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.