Show HN: Local LLM code-generation with Gemma 4 e2B via JSON AST to Clojure
The article discusses a local code-generation harness designed to convert text specifications into Clojure programs using the Gemma 4 E2B model. It emphasizes the use of JSON AST fragments for generating code, which are validated and compiled into Clojure source. Additionally, the harness supports generating Java Swing applications and includes various validation and logging features.
- ▪The harness runs a local Gemma 4 E2B GGUF model through llama-server.
- ▪It validates generated JSON AST using various checks and compiles it into Clojure source.
- ▪The system can also generate simple native Java Swing programs with a focus on deterministic GUI actions.
Opening excerpt (first ~120 words) tap to expand
JSON AST Agent Harness This project is a local code-generation harness for turning text specs into Clojure programs. The validated local setup was tested with Gemma 4 E2B GGUF served by llama.cpp. Other models may work, but they are untested. The core idea is to stop asking a small local model to write full source code directly. Instead, the model emits constrained JSON AST fragments. The harness validates those fragments, assembles larger structures programmatically, lowers the accepted AST to Clojure, and records every generation/repair artifact in SQLite. What It Does Runs a local Gemma 4 E2B GGUF model through llama-server. Can target another OpenAI-compatible chat endpoint experimentally. Uses a planner pass to derive a sanitized contract from a text spec.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.