[圖片]
CodeZaiku
A coding and development harness that runs on local models or hosted APIs. It is an AI coding
agent for your terminal, like Claude Code or aider, that works with a small model on Ollama, llama.cpp,
LM Studio or any OpenAI-compatible server. It also reviews git diffs, repairs a broken docker compose
stack with rollback when you allow it, reports security problems in a server's Docker containers,
researches questions with cited sources, and runs as an MCP server, an ACP agent or a command that
prints JSON for other agents.
Most agents like this assume a frontier model behind someone else's API. CodeZaiku is built the
other way round — a 9B on hardware you own — and the harness does the work that makes that viable:
deterministic evidence instead of model guesses, a guard stack around anything that acts, and
verification with rollback on every change.
It runs against any OpenAI-compatible server and ships no weights. The reference tier is a 9B.
→ ARCHITECTURE.md — how it works
→ LIMITATIONS.md — the measured numbers
Quick start
You need an OpenAI-compatible model server, and a JDK 21+ unless you take a build that carries its
own Java runtime (from 0.3.2, one per platform; the installer picks one when Java is missing). CodeZaiku
ships no weights.
Linux is the supported platform. macOS runs the coding and research surfaces (and can operate remote
Linux hosts over ssh); Windows works under WSL2. There is a container image. See
PLATFORMS.md.
Three ways to use it
At a terminal, for yourself — carry on below; the commands are in What you can do with it.
Underneath another agent or orchestrator — CodeZaiku is a backend as well as a tool. It speaks a
CLI-subprocess contract (codezaiku run), ACP (codezaiku acp) and MCP (codezaiku mcp).
The contract, the result shape and the failure modes are in
DEPLOYING_AS_A_BACKEND.md; start there rather than here.
Underneath Wyrdsekai — CodeZaiku is released under the
Wyrdsekai umbrella and is one of the coding backends Wyrdsekai can
summon: you ask the companion for something, it hands the work to CodeZaiku.
WITH_WYRDSEKAI.md is the short version of the page above — just the wiring,
and the two things that trip people up. Nothing here depends on it; CodeZaiku runs standalone.
Installing
There is one binary artifact and it is platform-independent. CodeZaiku is JVM bytecode with no
native parts, so the same tarball installs on Linux, macOS and Windows — there is no .pkg or .msi
to look for, and none is needed.
Linux is the reference platform. macOS and native Windows are measured too, and the installer is
verified on all three from a clean unpack. On Windows, install from Git Bash — the harness shells
out through bash, and Git for Windows supplies it. See PLATFORMS.md for
per-platform steps and for what does and does not work on each.
Linux and macOS:
Windows, from PowerShell (you also want Git for Windows — the harness shells out through its
bash):
Only the script comes from codezaiku.org; the artifact and the checksums both come from the same
GitHub release. What that URL serves is scripts/install-remote.sh
(and scripts/install.ps1) from this repository, verbatim — read them here
first if you would rather, and diff them against what the site serves. Both installers fetch the release tarball and verify it against the release's own
SHA256SUMS before installing anything — a mismatch refuses rather than proceeds. Only the script comes from
the URL above; the artifact and the checksums both come from the same GitHub release, so the script
cannot hand you a payload those checksums do not match. Piping a script into a shell is worth being
wary of in general: fetch it, read it, then run it if you would rather.
They install to ~/.local (or %LOCALAPPDATA%\Programs on Windows). CODEZAIKU_PREFIX puts it
somewhere else, CODEZAIKU_VERSION pins a release.
No JRE on the machine yet? On Debian or Ubuntu, take the .deb from the
latest release instead — it declares a JRE
dependency, so apt installs one for you:
The one-liners deliberately do not install a JRE themselves: a script piped into a shell should not
be reaching for sudo. They check for one; when it is missing they install the build for the platform
that carries its own runtime (codezaiku-<version>-<platform>.tar.gz, from 0.3.2; CODEZAIKU_RUNTIME=1
asks for it outright), and codezaiku update keeps such an install on its own kind.
To upgrade, run codezaiku update now, or the same install command again. update now takes the
latest release, checks it against the release's SHA256SUMS and swaps it in; the next start runs it.
When ResearchZosho is installed, it then asks ResearchZosho's own updater to do the same, and says what
came of each. Each program's own updater replaces its files, so two programs updating at once never
collide: the second finds the first at work and leaves it alone. On Windows, CodeZaiku cannot replace
its own files while it runs, so there you run the install command again. The installers resolve the
latest release each time and replace the old install rather than writing over it, so nothing stale is
left behind. Your config and data in ~/.codezaiku are untouched. The .deb upgrades in place with
sudo apt install ./codezaiku_<new>_all.deb and keeps /var/lib/codezaiku; if you enabled
codezaiku.service, the upgrade does not restart it, it tells you to when it suits you.
Other ways: tarball by hand, .deb, from source
On Debian or Ubuntu, sudo apt install ./codezaiku_0.1.1_all.deb — it installs to /opt/codezaiku,
links /usr/bin/codezaiku, and lets apt pull a JRE. The systemd unit it ships is disabled; nothing
starts on its own.
From source, if you want to build it yourself or work on it:
The install carries its own launcher, jars and knowledge library, and downloads nothing at runtime.
It does not bundle a JVM — install.sh checks for a JDK 21+ and stops if it does not find one.
No model weights are bundled either. scripts/install.sh --uninstall removes the program and
keeps ~/.codezaiku — your config, learned cards, research findings and audit trail.
--purge removes those too, after listing what will be lost and asking you to confirm.
To work in the repo without installing, bin/codezaiku runs from the checkout.
If you have no server yet:
To use the models in your own AWS account (Amazon Bedrock) with your own AWS sign-in, see BEDROCK.md.
--jinja is required — without it the model returns tool calls as prose and nothing works.
See MODELS.md for what the harness needs from a model, what we measured on,
and why codezaiku smoke is the check that matters.
Debian / Ubuntu
Installs to /opt/codezaiku with /usr/bin/codezaiku. A systemd unit is included but not
enabled — CodeZaiku can modify live systems, so starting it is a deliberate act.
Verifying what you downloaded
Every release asset ships with SHA256SUMS and a Sigstore bundle (<asset>.sigstore.json):
gh attestation needs GitHub CLI 2.49 or newer. An older gh reports unknown command with no hint why — check with gh --version before concluding the signature is bad.
The signature says the release workflow, running at that tag, blessed those exact bytes. It is an
authenticity statement, not build provenance — the artifacts are built and validated on real
hardware rather than in CI, because an artifact nobody ran is not one worth shipping. Release assets
are immutable; a fix ships as a new version, never as a re-upload.
What you can do with it
Talk to it
A coding assistant you talk to in your terminal — the same kind of tool as Claude Code, Codex
CLI or aider, except the model behind it is yours to choose: one running on your own hardware,
or a hosted API. You type what you want — "why does the login test fail?", "add a retry to the
uploader", "find out how other projects handle this" — and it reads your code, makes changes,
runs commands, or searches the web, then reports back. You steer it turn by turn.
By default it asks before changing or running anything, and shows you the exact change first.
You answer once, or "always" for that command. /undo reverses what it did, step by step.
Conversations are saved and can be resumed later, and /remember keeps a fact available in
every future conversation in that project. /switch <project> moves the chat to another project in the same terminal and tells it where you
were. /help inside the chat lists everything else —
background tasks, delegating work to a second agent, switching models, cost tracking.
codezaiku v1 ~/myproject serves the same assistant as an OpenAI-compatible API
(/v1/chat/completions), so a chat UI like Open WebUI can be the front end. Over that wire it
can only read, never change anything — an API cannot ask you for permission, so it is not given
anything that would need it.
codezaiku web is the chat in the browser, for several projects under one server: open
http://127.0.0.1:7072/, pick a project or add one by its folder, and talk. It is the same chat as
the terminal's, so it asks before it writes or runs anything, and you answer with buttons on the
page. Each project keeps its own conversation. Moving to another project is a click, and "switch"
also carries where you were, so the next thing you say there starts from it. It listens on this
machine only unless you say --host 0.0.0.0, which opens it to your network; it then prints a token
and the addresses to type, and the browser asks for the token once. On this machine it carries out a form only from
its own page and answers only to 127.0.0.1 or localhost, so another web page you have open cannot work it. From the menu's People page you
can name others: a viewer sees every page and every chat as it runs and can type nothing, an owner can
do all you can. Each signs in with a name and a password.
Research a question
It searches the web, reads pages, and writes an answer that cites its sources. broad is one
researcher working alone. fan splits the question into parts, researches them in parallel, has
a critic check whether the coverage is actually sufficient, and then writes the combined answer
— slower, and much better on questions with many parts.
Search works out of the box, and works better with a backend you configure. Without one, web_search
falls back to Wikipedia plus the scholarly literature (Crossref and OpenAlex): reference pages and papers by
DOI, not the whole web. Every research run also has scholar_search, the literature by DOI, whatever the
backend. For the whole web, two options, the first recommended:
The Brave Search API has a free tier (2,000 queries/month) and
gives markedly better results — a search tool is only as good as what it searches. SearXNG is
fully self-hosted and needs no account, but it aggregates public engines that rate-limit under
sustained use. With both configured, Brave is used first and SearXNG is the fallback. Setting
either one is also what enables web search inside chat.
What a research run finds is kept. The research memory in ~/.codezaiku/research holds each
finding with its source, and the next run on a related question starts from it instead of from
zero. That is the built-in tier: it works with nothing else installed.
For real research, the kind that takes hours and comes back with a report you can check, there is
ResearchZosho, a separate program from the same family. codezaiku install researchzosho fetches it, verifies it and runs its setup. From then on the chat's
/research files runs with it, /librarian asks what it holds, and what it holds is pushed into
every turn. The questions in the research memory are handed to it as open questions. codezaiku doctor
and the chat say when a newer ResearchZosho is released; codezaiku update now has ResearchZosho's own
updater install it, and the library and settings stay.
Work on a codebase
code keeps one conversation going until the goal is met. Use it when the model can hold the
whole job at once. decompose splits the goal into ordered slices first, then runs the same
loop with that plan pinned as a TODO it re-injects every turn — so you have a running program
after the first slice, and it grows from there. Use it when the job is big enough that the
model would otherwise lose the thread. loop is an older name for code and still works.
Operate a stack — sense, localize the failing service, fix, verify, roll back on failure
Scope can be local (myproject), remote (ssh://host/myproject) or a container
(docker://name). Everything else — the health endpoint, the verify command — is auto-discovered.
Operate a whole machine — the same operator, with the boundary set to the box instead of
one stack
triage enumerates everything it can see — compose stacks, failed systemd units, host disk
and memory — runs the SRE operator against each unhealthy stack, and surfaces the systemd and
host findings for a human. Each stack is still bound by blast-radius and the authority ladder,
so widening the boundary does not widen what any single fix may touch.
Note the difference in defaults, because it is the one place where a whole-machine command is
less conservative than a per-stack one: triage reports unless you pass guarded or
unattended, while watch-machine defaults to guarded — it is a daemon meant to keep a
box healthy, so it acts. Pass a ceiling explicitly if you want it to only watch:
codezaiku watch-machine local 300 "" propose. Run it under systemd on a real box.
Review security posture — report only, never auto-remediates
Research a question against live sources
Drive it from another agent
Safety
The operator can change your systems, so the defaults are conservative and the guards are not optional.
- Authority ladder —
observe < localize < propose < guarded < unattended. Default
propose: it tells you the command, it does not run it. An unproven fix never auto-applies.
- Blast radius 1 — a fix may touch the service it localized and nothing else.
- Rollback — snapshot before a destructive change, verify after, restore if verification fails.
This has a counterfactual: with it on, a model that corrupted a database config was rolled back and
the stack came back green; with it off, the same failure left the service dead.
- Harm check — a fix that repairs its target but breaks a healthy dependency is a failure.
- Kill switch —
CODEZAIKU_OPS_HALT=on forces observe immediately.
- Security findings are report-only at every rung. A wrong reliability fix restarts a service; a
wrong containment action firewalls your own load balancer.
Untrusted input is treated as untrusted: container logs are attacker-writable, and a measured injection
through them steered the operator 40/40 on both model tiers before it was fixed structurally. See
ARCHITECTURE.md §6.
What this is not
- Not a frontier coding agent. SWE-bench Lite ≈1/8 on the 9B; refactoring 0/8. It is not a
replacement for tools built on much larger models.
- Not production-hardened. No long-running soak evidence yet.
- Not a multi-agent framework. One loop, good tools, hard measurement. An earlier blackboard/agent
architecture was designed, partly built, and removed.
The full accounting is in LIMITATIONS.md.
Repository layout
bench/ is shipped on purpose. The rigs are how every number in LIMITATIONS.md was produced, including
the ones that came out badly.
Documentation
Getting in touch. Bugs and feature requests belong in
issues, where other people can see them and the
answer. For anything else, [email protected]. Vulnerabilities go to [email protected]
or a private advisory — see SECURITY.md; conduct concerns to
[email protected].
The family
CodeZaiku is part of Wyrdsekai, and its sibling is
ResearchZosho, the research library: it keeps what research runs find,
checks the claims against their sources, and answers questions from what it holds.
codezaiku install researchzosho puts it beside CodeZaiku, and the two share a model server, so one
on-demand model on a machine serves both.
License
Apache 2.0 — see LICENSE.