# beamivalice/sushi — AlpLab Radar Static Code Audit

- Ring: `trial`
- Category: `ai-models`
- Overall score: `3.8/5`
- Implementation check: `verified`
- Maturity: `early`
- Audited commit: `7592f3655757` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-11-30T12:43:25Z
- Repository: https://github.com/beamivalice/sushi
- Radar entry: https://radar.alplab.co/#repo/beamivalice/sushi
- License: `NOASSERTION`
- CI workflows: `.github/workflows`
- Tags: `llm-inference`, `mlx`, `macos`, `quantization`, `speculative-decoding`, `http-server`

## Summary

A Zig/MLX local LLM inference server for Apple Silicon Macs serving OpenAI/Anthropic/Responses APIs with MTP/DFlash2 speculative decoding, KV quantization, SSD expert streaming, and its own low-bit quant pack format.

## Implementation Check

The README's main claims all have real code paths: server + routes in src/server.zig, spec decoding in src/mtp*.zig and src/dflash*.zig, expert streaming in src/expert_stream.zig, disk KV in src/kv_disk_cache.zig, guarded self-update in src/update.zig; the KLD/tok-s benchmark numbers are self-reported and unverifiable from code alone.

## When to Use

Reach for it on a 32-128 GB+ Apple Silicon Mac running macOS 26.2+ when you want to serve the specific beamster low-bit packs (1M context, agentic tool calling) behind an OpenAI/Anthropic-compatible API; not for other platforms, other orgs' checkpoints (pull refuses non-beamster repos), or small-RAM machines.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 4.5/5 |
| usability | 3.5/5 |
| reliability | 3.0/5 |
| security | 4.0/5 |
| integration | 4.0/5 |

## Code Evidence

src/ holds ~200 substantive Zig modules (expert_stream.zig 295KB, kv_disk_cache.zig 490KB, scheduler.zig 352KB) with unit tests embedded beside them (src/http_conn.zig tests the auth truth table and key redaction), plus tests/ shell suites, CI (.github/workflows/release.yml), a custom lint suite (scripts/lint/*.zig), and a thorough NOTICE; build.zig.zon version 1.7.3 matches the latest release tag. Security engineering is real: constant-time key compare and Bearer/Basic/x-api-key support (src/http_conn.zig apiKeyAuthorized), loopback-default bind, Origin checks on state-changing routes, updates gated on SHA-256 + codesign team match + rollback (src/update.zig).

## Issues Found

API key accepted via ?api_key= query parameter (src/http_conn.zig queryParamValue) — lands in client-side URLs even though the server redacts it from its own logs; src/cli.zig checkPullable refuses packs from any org but beamster (error.NotBeamster test), a deliberate trust boundary but a hard usability limit; /v1/tools web bridge exposes local file read/write, loopback+Origin gated but a wide surface if the user browses a malicious page that satisfies the origin check is not possible, so risk is low; README's bench tables carry no machine-readable methodology link at the claims themselves.

## Key Risks

Nothing was executed, so performance (tok/s tables), quality (KLD scores, tool-eval-bench ratings) and the 1M-context memory figures are the authors' own measurements, not verified. Hard platform lock: Apple Silicon, macOS 26.2+, 32-128 GB unified memory, packs gated to the beamster Hugging Face org. Young project (created 2026-09-20, 2 contributors, top-author share 1.0); MiMo pack already dropped to unsupported, which shows how fast the supported set churns. Daily update check and HF catalog fetch phone out by default (both opt-out); no prompt content leaves the machine on any path seen.

## Reviewed Files

- `README.md`
- `build.zig.zon`
- `.gitmodules`
- `src/main.zig`
- `src/server.zig`
- `src/http_conn.zig`
- `src/update.zig`
- `docs/usage.md`
