cd /news/large-language-models/show-hn-psudo-47mb-2-bit-coding-mode… · home › topics › large-language-models › article
[ARTICLE · art-172570] src=github.com ↗ pub= topic=large-language-models verified=true sentiment=↑ positive

Show HN: Psudo – 47MB 2-bit coding model, Polish-prefix IR, and Rust transpiler

A developer released Psudo, an open-source coding stack built around a 47.0 MB, 100.7M-parameter 2-bit ternary (TQ2_0) model that runs local code synthesis within a 4 GB VRAM budget on an NVIDIA GTX 1660 Ti. The project pairs a token-compressed .psudo DSL with a Polish-prefix intermediate representation (pIR) that cuts token counts 45–60% versus surface syntax, and a pushdown-automaton mask (PirPdaConstraint) over the 8,192-token BPE vocabulary that the author reports yields a 0% syntax error rate at decode time. Verified .psudo code lowers through a borrow checker and sandbox into safe Rust with zero unwrap calls, and both quantized .gguf checkpoints (47.0 MB and 23.2 MB) ship in the repo, built with plain cargo and no CUDA or C++ toolchains, trained on roughly 7,800 borrow-checked trajectories.

key takeaway

A 100.7M-parameter TQ2_0 ternary model at 47.0 MB can emit Polish-prefix pIR instead of surface syntax to cut tokens 45–60%, with a pushdown-automaton mask over the 8,192-token vocabulary enforcing 0% syntax errors at decode time.

read6 min views3 publishedNov 19, 2026
Show HN: Psudo – 47MB 2-bit coding model, Polish-prefix IR, and Rust transpiler
Image: Michielbdejong (auto-discovered)

A token-compressed DSL (.psudo), a Polish-prefix intermediate representation ( pIR), a borrow-checked safe Rust transpiler, and a pure-Rust 2-bit ternary (TQ2_0) inference engine—built to run local code synthesis inside a 4 GB VRAM budget.

flowchart LR
    A[".psudo DSL"] --> B["pIR (Polish-prefix IR)"]
    B --> C["pseudo-engine (100M TQ2_0 + PDA Mask)"]
    C --> D["Borrow Checker & Sandbox"]
    D --> E["Safe Rust (0 unwrap)"]
Metric Value
Primary Model Footprint 47.0 MB (100.7M params,TQ2_0 2-bit ternary weights)
Context Compression 45–60% fewer tokens than surface syntax viapIR
Syntax Error Rate 0% at decode time via Pushdown Automaton (PirPdaConstraint ) masking
Runtime Dependencies Zero (pure Rust, memmap2 , no CUDA/C++ toolchains required)
Training Dataset ~7,800 borrow-checked & sandbox-verified trajectories

Both quantized .gguf checkpoints (47.0 MB and 23.2 MB) ship right in this repo, and everything compiles with plain cargo (zero C++, Python, or CUDA dependencies):

git clone https://github.com/steveSujo/psudo.git
cd psudo
cargo build --release && ./target/release/psudo demo

I wanted to run and train coding models on my own machine—not rent bigger GPUs or burn cloud token quotas on every loop and helper function.

My laptop has an NVIDIA GTX 1660 Ti with 4 GB of VRAM and limited RAM, so running frontier models locally is out of the question. Instead of seeing those limits as the problem, I treated them as creative constraints: how can I make the best out of this? Finding a creative solution is way more fun than throwing raw power at the problem or trying to vertically scale my PC.

Running a small, limited model with 2-bit precision (TQ2_0) shrinks the VRAM footprint enough to live comfortably alongside an IDE and compiler—and exploring how far that tiny model can push raw coding power became the whole point:

  1. A tiny surface language (.psudo): Python-indented, minimal punctuation, almost zero boilerplate tokens.
  2. Lowering to safe Rust (pseudo-transpiler): A toy language has no ecosystem. To build real binaries, verified and borrow-checked.psudo lowers into safe Rust (0``.unwrap() or.expect() calls) and compiles withcargo .
  3. The Cactus & Needle spark: SeeingCactus andNeedle —2-bit on-device models (29M–121M params in8–29 MB ) beating much larger models on constrained tool calls—showed what tight constraints can do.
  4. "What if?":* What if I trained a ~100M 2-bit ternary model (TQ2_0) whose only job is writing atomic .psudo function bodies locally, while I (or a frontier LLM) stay at the orchestrator level?*

Asking a 100M model to emit verbose surface syntax wastes half its context window on keywords and whitespace. Instead, the model emits pIR (Pseudo Intermediate Representation)—a Polish-prefix S-expression format where fn is f, let is v, return is r, if is ?, and while is w:

// Surface .psudo (what humans read)
fn clamp_val(val, lo, hi)
    if val < lo
        return lo
    if val > hi
        return hi
    return val

// Wire pIR (what the 100M model emits)
f clamp_val (val lo hi) [
  ? (< val lo) [ r lo ]
  ? (> val hi) [ r hi ]
  r val
]

That trade buys two things:

  • 45–60% fewer tokens per function body.

  • 0% syntax errors at decode time:pseudo-engine runs a pushdown automaton (PirPdaConstraint ) over the8,192 -token BPE vocab and masks out invalid tokensbefore sampling.

  • pseudo-100m-tq2_0.gguf (100.7M params, 47.0 MB) — Primary: d_model = 768 ,14 layers,12 heads (4 KV heads),FFN = 2048 ,vocab = 8,192 ,max_seq_len = 512 ,TQ2_0 ternary weights ({-1, 0, 1} ). Auto-discovered bypsudo synth for ~15-line atomic stubs (guards, math, loops, JSON/KV helpers).

  • pseudo-33m-tq2_0.gguf (33.6M params, 23.2 MB) — Embedded Fallback: d_model = 512 ,8 layers,8 heads (4 KV heads). Baked into thepsudo binary for offline smoke tests if no external.gguf is present.

Both were distilled from Qwen/Qwen2.5-Coder-7B-Instruct-AWQ plus a synthetic generator—every sample had to pass type checking, borrow checking, and sandbox execution in headless psudo before being compiled to canonical pIR (~7,800 verified trajectories across <pir>, <error> 1-shot auto-heal, <zettel>, and <clarify>).

Requires Rust 1.75+. Build both binaries ( psudo and pseudo-engine):

cargo build --release

examples/ ships three pre-built workspace capsules (psudo.bin) with mock sandbox data in .pseudo/sandbox/:

./target/release/psudo check examples/log-incident-filter/psudo.bin --all-modules
./target/release/psudo build examples/log-incident-filter/psudo.bin --run

./target/release/psudo build examples/sensor-alert-monitor/psudo.bin --run

./target/release/psudo build examples/quota-fee-calculator/psudo.bin --run

Your code lives inside a single signed capsule file (psudo.bin). You (or an outer coding agent) declare signatures, stubs, and tests; psudo synth fills in the bodies locally.

psudo init my-app --template blank --with-docs && cd my-app

psudo vfs stub compute_fee units rate free_tier \
  --directive "if units <= free_tier return 0, else return (units - free_tier) * rate"

psudo synth --write

psudo dag --format mermaid
psudo contract

psudo vfs test test_fee --call "compute_fee(15, 2, 10)" --expect "10"
psudo vfs wire --entry main_task --call "print(compute_fee(15, 2, 10))" --return "0"

psudo check -a
psudo test
psudo run --call "compute_fee(15, 2, 10)"
psudo build --run

When I tested outer LLM agents with this CLI, they kept peeking at the .psudo source and hand-writing functions instead of using psudo synth. So psudo vfs show --all and psudo synth --print stay locked unless you pass the key:

  • Question:"What jumped over the lazy dog?"
  • Key:--reveal-code "the slow pink elephant"

For agent harnesses, psudo-orchestrator and psudo mcp (stdio JSON-RPC) are included. Run psudo --help, psudo docs, or psudo -s for the full reference.

This is not a polished product. It is an exploration of an idea with plenty of sharp corners:

  1. Keep stubs atomic: A100M 2-bit model cannot write an HTTP server in one shot. Give it small, single-purpose functions (guards, clamping, arithmetic, simple loops, KV/JSON helpers).
  2. Grammar masking != semantic intelligence: The PDA mask guarantees validpIR brackets and ops, so an out-of-distribution prompt still produces valid syntax—just logically wrong fallback code.
  3. Strict 4-space indentation & // comments: 2-space indents and tabs fail withE002 ;# comments fail withE001 .
  4. Sealed psudo.bin feels weird at first: Keeping source inside a masked binary capsule is deliberately awkward for manual editing—it exists to keep outer agents in the orchestrator seat.
  5. Bimodal CPU speeds:pseudo-engine --benchmark swings between fast runs whenmemmap2 pages are hot and slow runs on cold pages or OS background scheduling.
  6. Windows-first mileage: Most testing happened on Windows 11. Rebuilding whilepsudo.exe is running hits Windows file locks, and Linux/macOS paths have less mileage.

Expect bugs! I'll keep tweaking the language and the tiny model as I experiment.

Path Description
pseudo-lang/ .psudo lexer, parser, borrow checker,psudo.bin VFS capsule, contract generator, andpsudo CLI
pseudo-engine/ Pure-Rust zero-copy GGUF parser, TQ2_0 ternary kernels, 2-tier INT8 KV cache, PDA sampler, and--daemon
pseudo-transpiler/ Deterministic IR lowering between .psudo and safe, zero-unwrap() Rust
examples/ Pre-built capsules ( log-incident-filter ,sensor-alert-monitor ,quota-fee-calculator )
templates/ Source .psudo templates and.pseudo/sandbox/ fixtures forpsudo init
.agents/skills/ psudo-orchestrator skill for LLM harnesses
── more in #large-language-models 4 stories · sorted by recency
── more on @psudo 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-psudo-47mb-2…] indexed:0 read:6min 2026-11-19 · —