Skip to main content
Glama

localVibeCode


🎯 What is localVibeCode?

In high-security enterprise environments (banking, financial services, telecom, defense, healthcare), developers face a strict constraint: no public internet access or high network bottlenecks. At the same time, traditional AI coding tools rely on frontier cloud LLMs with 200k+ token context windows by dumping dozens of files into the prompt.

When running local models (7B – 14B) on laptops (16GB – 32GB RAM):

  1. Dumping multiple files causes severe "Lost in the Middle" hallucination and memory blowup.

  2. Running multiple models (Planner + Coder + Reviewer) causes VRAM thrashing and 10–20 second swapping freezes.

  3. Unchecked edits cause breaking contract changes across dependent modules.

localVibeCode solves this by shifting structural discovery and verification to the CPU (0 LLM Tokens), feeding your local model only surgical, high-precision context (< 4,000 tokens) under a deterministic state machine.


Related MCP server: CodeMap

⚡ The 3 Architectural Breakthroughs

[Developer Requirement]
          │
          ▼
┌────────────────────────────────────────────────────────────────────────┐
│  Phase 0: Graphify AST Indexer (CPU • 0 LLM Tokens)                    │
│  - Parses AST across codebase in < 0.1s                                │
│  - Identifies Architectural God Nodes & Leiden subsystem clusters      │
│  - Extracts 1-Hop Inbound Callers & Outbound Signatures                │
└───────────────────────────────────┬────────────────────────────────────┘
                                    │
                                    ▼
┌────────────────────────────────────────────────────────────────────────┐
│  Phase 1: PLAN (Fresh Context #1 • Constrained JSON Schema)            │
│  - Analyzes Requirement + GRAPH_REPORT.md + Enterprise Guardrails      │
│  - Generates minimal ordered Atomic Tasks (Model -> Service -> Test)   │
└───────────────────────────────────┬────────────────────────────────────┘
                                    │ (Context Reset)
                                    ▼
┌────────────────────────────────────────────────────────────────────────┐
│  Phase 2: EXECUTE (Fresh Context #2 per file • Surgical Slice)         │
│  - Blast-Radius Slicer feeds ONLY: Target File + 1-Hop Signatures      │
│  - Single Pinned Base Model generates surgical patch                   │
│  - Immediate Zero-Token Verifier (AST check + SAST + Unit Tests)       │
│  - Self-Healing loop with error traceback if verification fails        │
└───────────────────────────────────┬────────────────────────────────────┘
                                    │ (Context Reset)
                                    ▼
┌────────────────────────────────────────────────────────────────────────┐
│  Phase 3: VERIFY (Fresh Context #3 • Spec Critic)                      │
│  - Evaluates unified git diff against original requirements            │
│  - Produces pass/replan scorecard and compliance score (0-100)         │
└────────────────────────────────────────────────────────────────────────┘
  1. Deterministic AST Knowledge Graph (Graphify Style):

    • 0 LLM tokens consumed.

    • Maps classes, functions, and import/call dependencies deterministically using AST parsing.

    • Ranks Architectural God Nodes so AI knows which core interfaces cannot be broken.

  2. Blast-Radius Slicer (< 4,000 Tokens Surgical Context):

    • Extracts only: Target file + 1-Hop Outbound Signatures (function bodies stripped) + 1-Hop Inbound Callers.

    • Allows a 7B or 14B model to make multi-file modifications with the precision of a 200B cloud model.

  3. Single Pinned Base Model & Deterministic PEV:

    • Keeps only 1 model pinned in Unified Memory/VRAM (keep_alive: -1m), eliminating model swapping.

    • Resets context at every phase (Plan $\rightarrow$ Execute $\rightarrow$ Verify) to keep the model in its Peak Reasoning Zone.

    • Zero-token verification (AST, Security SAST, Test Suite) before displaying changes.


🚀 Quickstart

1. Prerequisites

  • OS: macOS (Apple Silicon M-series recommended) or Linux.

  • RAM: 16GB+ Unified Memory / RAM recommended.

  • Python: Python >= 3.9.

  • Inference Engine: Ollama running locally.

  • Recommended Model: qwen2.5-coder:7b (fast) or qwen2.5-coder:14b (deep reasoning).

# Pull your preferred local coding model
ollama pull qwen2.5-coder:7b

2. Installation

Clone the repository:

git clone https://github.com/dhluong90/localVibeCode.git
cd localVibeCode

# Make the CLI launcher executable (or add to your PATH)
chmod +x ./localvibecode

3. Run Preflight Health Check

Verify your local environment, RAM budget, Ollama daemon, and models:

./localvibecode doctor
──────────────────── SYSTEM PREFLIGHT DIAGNOSTICS ────────────────────
  [PASS] Python Version (Runtime)
         ↳ Python 3.9.6 (/usr/bin/python3)
  [PASS] System Memory (Hardware)
         ↳ 24.0 GB RAM / Unified Memory detected (Darwin arm64)
  [PASS] Git CLI (Toolchain)
         ↳ Found at /usr/bin/git
  [PASS] Ollama Binary (Inference)
         ↳ Found at /usr/local/bin/ollama
  [PASS] Ollama Daemon Service (Inference)
         ↳ Responding at http://localhost:11434 (2 model(s) installed)
  [PASS] Coding LLM Models (Inference)
         ↳ Available: ['qwen2.5:7b', 'gemma4:latest']
──────────────────────────────────────────────────────────────────────
[SUCCESS] All environment checks passed! localVibeCode is 100% ready to run offline.

4. Test on the Included Enterprise Demo Repo

./localvibecode pev "Add 20% discount for ENTERPRISE tier in order service and add unit test verifying 500.0 USD charges 400.0."

📊 Automated Acceptance Benchmarking Suite

localVibeCode comes with a formal, reproducible benchmark harness designed for technical evaluation and acceptance sign-offs (Nghiệm thu dự án):

# Run all 5 enterprise benchmark use cases in isolated workspaces:
./localvibecode benchmark

# Run a specific test case (e.g., Case 1: Ideas to Code):
./localvibecode benchmark --case 1

The 5 Standard Benchmark Use Cases

Case

Category

Real-World Scenario

Acceptance Criteria

#1

Ideas to Code

Implement cross-layer bulk purchase discounts across service and tests

100% test pass rate; zero code regression

#2

Unit Test Gen

Generate boundary tests (currency validation, negative amounts)

Covers edge-cases with exact mock signatures

#3

Self-Healing

Injected VIP calculation defect triggers automated self-healing loop

Identifies failure trace and self-heals $\le 2$ retries

#4

Blast Radius

Modify central God Node (models.py) with optional fields

Zero breaking changes across 1-hop inbound callers

#5

Zero-Token SAST

Injected eval() triggers zero-token security blocker (0 tokens, 0.01s)

Immediate blocker + safe enterprise rewrite

📖 Full Acceptance Specification & Protocol: See docs/BENCHMARK_AND_ACCEPTANCE_GUIDE.md for detailed pass/fail thresholds, KPI metrics, and formal sign-off templates.

📄 Live Generated Report: Each run produces a complete Markdown evaluation report in benchmarks/BENCHMARK_REPORT.md.


☕ Real-World Enterprise Java Evaluation (7B vs. 14B Benchmark)

To validate localVibeCode on real-world enterprise architectures, we stress-tested a multi-module Java Clean Architecture repository (clean-architecture-java, 5 Maven modules, Spring Boot, JUnit 5, AssertJ, Checkstyle) comparing qwen2.5:7b vs qwen2.5-coder:14b:

Capability Metric

Model 7B (qwen2.5:7b)

Model 14B (qwen2.5-coder:14b)

VRAM Footprint

4.7 GB (Ultra-lightweight)

9.5 GB (100% GPU on Apple M5, 0 swap)

Inference Speed

~42 tokens / sec

~35 tokens / sec

QA Scorecard

82 / 100

100 / 100 (Flawless PASS)

Spring Context Runner Pattern

❌ Fails (invokes naive new())

✅ Native Mastery (ApplicationContextRunner)

AssertJ & JUnit 5 Syntax

⚠️ Uses legacy assertEquals

✅ Idiomatic assertThat(...).isEqualTo(...)

Zero-Human Intervention Pass@1

~60%

~95%

Maven Reactor Multi-Module Build

✅ PASS (1.8s)

✅ PASS (1.75s)

📖 Comprehensive Evaluation Document: Read the complete 6-Phase SDLC report at docs/JAVA_ENTERPRISE_SDLC_EVALUATION.md.


🛠️ Onboarding an Existing Project

You can apply localVibeCode to any existing repository in one command:

./localvibecode init /path/to/your/existing/project

What init does automatically in 1 second:

  1. Detects project test suite (pytest, npm test, go test).

  2. Generates localvibecode.json config.

  3. Configures OpenCode CLI integration (opencode.json).

  4. Configures VS Code / Cursor MCP integration (.vscode/mcp.json).

  5. Generates starter enterprise_rules/ folder.

  6. Builds the initial Graphify AST map in graphify-out/GRAPH_REPORT.md.


💻 IDE & Tool Integrations

1. OpenCode CLI (Terminal Agent)

Run OpenCode in any onboarded repository:

cd /path/to/your/project
opencode

Use custom slash commands:

  • /graph — Inspect architectural God Nodes and repository skeleton (0 tokens).

  • /impact path/to/file.py — View 1-hop blast-radius surgical slice.

  • /pev <requirement> — Trigger autonomous offline Plan-Execute-Verify cycle.

2. VS Code & Cursor (MCP Integration)

The onboarded project includes .vscode/mcp.json. Any MCP client (VS Code Cline, Roo Code, Continue.dev, Claude Code) connects directly to:

{
  "servers": {
    "localvibecode": {
      "type": "stdio",
      "command": "python3",
      "args": ["-m", "localvibecode.mcp_server"],
      "env": {
        "PYTHONPATH": "/path/to/localVibeCode/src"
      }
    }
  }
}

Exposed MCP Tools:

  • localvibecode_build_graph

  • localvibecode_blast_radius

  • localvibecode_verify

  • localvibecode_pev_run


📖 CLI Reference

Command

Description

localvibecode doctor

Run environment diagnostics (Python, RAM, Ollama, Models)

localvibecode init <path>

Onboard an existing codebase for CLI, OpenCode, and VS Code

localvibecode pev "<req>"

Run end-to-end Plan $\rightarrow$ Execute $\rightarrow$ Verify with 1 local pinned model

localvibecode graph

Generate & display Graphify AST structural report & God Nodes (0 tokens)

localvibecode slice <file>

Extract 1-hop surgical context (< 4K tokens) for a specific file

localvibecode verify

Run zero-token AST check, offline security SAST, and unit tests

localvibecode mcp

Launch stdio MCP server for IDE agents

localvibecode benchmark

Run automated 5-case acceptance benchmark suite in isolated workspaces

Options:

  • --repo <path>: Specify target project path (overrides config).

  • --model <name>: Override Ollama model (e.g. --model qwen2.5-coder:14b).

  • --no-banner: Hide ASCII logo.


🇻🇳 Dành Cho Kỹ Sư Việt Nam (Vietnamese Summary)

localVibeCode được thiết kế đặc thù cho các môi trường doanh nghiệp Việt Nam (ngân hàng, tài chính, viễn thông, cơ quan nhà nước):

  • 100% Không cần Internet: Source code, tài liệu và logic nghiệp vụ không bao giờ rời khỏi laptop.

  • Khắc phục triệt để giới hạn của Local LLM (7B - 14B):

    • Không nhồi bừa bãi hàng chục file vào context làm AI "lú" (Lost in the Middle).

    • Dùng Graphify AST (0 token) để trích xuất đúng vùng ảnh hưởng (Blast-Radius < 4,000 tokens).

    • Ghim cố định 1 model duy nhất trong VRAM, chia nhỏ quy trình thành vòng lặp Plan $\rightarrow$ Execute $\rightarrow$ Verify với context sạch ở mỗi bước.

    • Tự động chạy AST Check + Security SAST + Unit Test để tự sửa lỗi (Self-Healing) trước khi giao code cho dev.


📄 License

Licensed under the Apache License 2.0.

Available Tools

8 tools
aisdlc_blast_radiusC

Legacy alias for localvibecode_blast_radius.

Inputs: target_file (required), repo_path.

aisdlc_build_graphD

Legacy alias for localvibecode_build_graph.

Inputs: repo_path.

aisdlc_pev_runC

Legacy alias for localvibecode_pev_run.

Inputs: requirement (required), repo_path.

aisdlc_verifyC

Legacy alias for localvibecode_verify.

Inputs: repo_path.

localvibecode_blast_radiusB

Extract the Surgical Context (< 4,000 tokens) for a target file: includes target code, 1-hop outbound signatures (bodies stripped), and 1-hop inbound callers.

Inputs: target_file (required), repo_path.

localvibecode_build_graphB

Build/refresh the deterministic AST Code Knowledge Graph (Graphify) with 0 LLM tokens. Returns Architectural God Nodes, import/call dependencies, and public signatures.

Inputs: repo_path.

localvibecode_pev_runC

Execute an Enterprise Local Vibe Coding task using the Deterministic PEV (Plan -> Execute -> Verify) pipeline with Fresh Context isolation on 1 Local Ollama Model.

Inputs: requirement (required), repo_path.

localvibecode_verifyB

Run Zero-Token Deterministic Verification (AST syntax check, Enterprise Security SAST, and Unit Tests).

Inputs: repo_path.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.5/5.0

    Scored across 8 tools

    Disambiguation3/5

    The four localvibecode_ tools are distinct in purpose (graph build, context extraction, verification, pipeline run), but each has an exact aisdlc_ duplicate. Descriptions explicitly mark these as aliases, which mitigates but does not eliminate misselection risk.

    Naming Consistency3/5

    Within each prefix, names follow a clear verb_noun pattern (build_graph, blast_radius, verify, pev_run), but the set mixes two different namespace prefixes (localvibecode_ vs aisdlc_), which is inconsistent across the surface.

    Tool Count2/5

    The server registers 8 tools, but 4 are pure legacy aliases, so the real functional surface is only 4. The count is inflated by duplication rather than reflecting genuine capability.

    Completeness4/5

    The four real tools cover the core workflow—graph construction, surgical context extraction, deterministic verification, and the PEV execution pipeline. Minor gaps like graph inspection/reset or model management exist but are workable around.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to retrieve hyper-targeted, token-efficient context from a codebase by querying a locally built AST knowledge graph, and to persist cross-session agent memory through 17 MCP tools. All indexing and retrieval run entirely offline, so proprietary code never leaves the machine.
      24 PyPI
      1
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI agents to explore a repository by querying a pre-built structural knowledge graph of symbols and their relationships — definitions, callers, callees, blast radius, and file-level impact — instead of grepping and reading files. This cuts the tokens spent on code exploration by roughly 96–99% while running entirely on local SQLite with tree-sitter parsing.
      1
      MIT