Skip to main content

English | Tiếng Việt

VieForge

Code First, Local LLM Second, Cloud Last.

VieForge CI License: MIT Python 3.10+ Core: 100% Stdlib OS: Windows | macOS | Linux Crafted in Vietnam Website: vieforge.dev

Turn any consumer workstation into a checkpointed, budget-guarded, multi-project local AI worker to cut Cloud Agent quota and API spend by 70–90%. Built on open MCP (Model Context Protocol) + Agent Skill (SKILL.md / AGENTS.md) standards for Antigravity, Claude Code, Cursor, Windsurf, and Codex CLI.


Zero-Knowledge Setup (Just Ask Your AI Agent)

New to Git, Python, or MCP? You do not need to touch a terminal manually. Open Antigravity, Claude Code, Cursor, Windsurf, or Codex CLI and paste this single message:

"Clone https://github.com/vieforge/vieforge, read AGENT_INSTALL.md, run python scripts/quick_setup.py, and show me the Savings Receipt in plain language."

Your AI agent will automatically detect your hardware, install the TierForge skill for your IDE, generate exact absolute-path MCP configs, and run a $0 live demo.


3-Tier Hybrid Architecture

flowchart LR
    U["User / Multi-Project Workspaces"] --> T1["Tier 1: Cloud Brain\n(Antigravity / Claude / Cursor / Codex)\nArchitecture, Reviews, Gates"]
    T1 -- "Compact JSON / MCP Calls" --> T2["Tier 2: Local Backbone ($0)\nPython + SQLite WAL Checkpoints\nOllama Local LLM (Lease-Managed)"]
    T2 -- "Trimmed Summaries (-85% to -95%)" --> T1
    T2 -- "Stage-by-Stage Handoff" --> T3["Tier 3: Isolated Muscle\nChild GPU Subprocess (Exclusive Lock)\nor Capped Paid APIs (--dry-run + Caps)"]
    T3 -- "Cost Ledger & Status" --> T2
Tier Executor Responsibilities Target Cost
Tier 1 (Brain) Cloud Agent (Antigravity / Claude / Cursor / Windsurf / Codex) Architecture, schema design, code review, Approval Gates, root-cause debugging Cloud Quota
Tier 2 (Backbone) Python Stdlib + SQLite WAL + Local LLM (Ollama / OpenAI-compat) Per-item checkpoints, SHA-256 deduplication, bulk extraction/JSON formatting, log trimming $0.00
Tier 3 (Muscle) OS-Isolated Local GPU Subprocess / Capped External APIs Heavy local inference, media/data batching, paid APIs under --dry-run, MAX_RETRY <= 2, MAX_JOB_USD, DAILY_USD_CAP $0 or Capped

5-Minute Quickstart ($0, Zero Dependencies)

# 1. Clone the repository
git clone https://github.com/vieforge/vieforge.git
cd vieforge

# 2. Run 1-command setup (preflight + skill install + MCP config generator + live demo)
python scripts/quick_setup.py

# Or run the 3-phase interrupt/resume demo manually (works even without Ollama via --mock-llm):
python examples/01_batch_doc_processor/run_demo.py --dry-run
python examples/01_batch_doc_processor/run_demo.py --reset --mock-llm --simulate-interrupt-after 2
python examples/01_batch_doc_processor/run_demo.py --mock-llm

Example Savings Receipt printed at the end of the resumed run:

=== TierForge Savings Receipt (demo_01_batch) ===
Items processed : 5
Actual cost     : $0.0000 USD
Cloud baseline  : $0.0405 USD (external/text-frontier)
Estimated saved : $0.0405 USD (100.0%)
Context trimmed : 2169 -> 108 chars (-95.0%)

Reproducible Token Savings Benchmark ($0, 0.3s)

Verify exact Cloud Agent token burn on your own machine (ceil(chars / 4) estimator):

python scripts/benchmark_token_savings.py
Real-World Workload Cloud-Only Tokens VieForge Cloud Tokens Reduction Factor Saved
One-time Session Overhead (SKILL.md 691 + AGENTS.md 448 + MCP 320) 0 1,459 — Paid once
100-Document Batch Classification & JSON Extraction 23,662 200 118.3x -99.2%
Noisy CI / Pytest Log + Traceback Compression (390 lines) 11,150 998 11.2x -91.0%
50-Item Job Crashed at 30/50 + SQLite Checkpoint Resume 17,920 457 39.2x -97.4%
COMBINED NET (incl. 1,459-token session overhead) 52,732 3,114 16.9x -94.1%

Break-even transparency: VieForge pays off its 1,459-token one-time session overhead after just 1 noisy CI log or 3–5 batch items. For quick 1-turn Q&A or single-file edits, you do not need to invoke VieForge.


Multi-Agent Ecosystem Support

Run python scripts/install_skill.py --target all to install the three-tier-orchestrator skill across every supported agent detected on your machine and generate absolute-path MCP snippets:

AI Agent / IDE Skill Path MCP Config Format Repo Instructions
Antigravity ~/.gemini/config/skills/three-tier-orchestrator JSON (data/mcp_config.generated.json) AGENTS.md + SKILL.md
Claude Code ~/.claude/skills/three-tier-orchestrator JSON (data/mcp_config.generated.json) AGENTS.md + SKILL.md
Cursor ~/.cursor/skills/three-tier-orchestrator JSON (data/mcp_config.generated.json) AGENTS.md + SKILL.md
Windsurf ~/.codeium/windsurf/skills/three-tier-orchestrator JSON (data/mcp_config.generated.json) AGENTS.md + SKILL.md
Codex CLI ~/.agents/skills/three-tier-orchestrator TOML (data/codex_mcp.generated.toml) AGENTS.md

To start the MCP server, install the optional MCP extra (pip install "mcp>=1.2.0" or uv sync --extra mcp) and paste the generated snippet into your IDE settings.


Multi-Project Concurrency Safety

Running 3+ projects simultaneously in Antigravity or Claude Code on one workstation? core/concurrency.py prevents cross-workspace race conditions using 100% stdlib OS advisory locks (msvcrt on Windows, fcntl on macOS/Linux):

  • Ref-Counted Ollama VRAM Lease (OllamaLeaseManager): LLMRouter.batch_session() keeps your local model warm during a batch (avoiding 5–10x cold-start reloads) and only triggers keep_alive=0 unload when the last active project releases its lease. Dead PIDs are pruned automatically.
  • Exclusive Tier 3 GPU Queue (exclusive_gpu_lock): Heavy GPU subprocesses serialize cleanly across workspaces instead of colliding on an 8 GB VRAM card.
  • Atomic Daily Spend Ledger: CostTracker wraps daily_spend.json in a cross-process lock + atomic os.replace, preventing lost spend records across parallel runs.
  • Project-Scoped Checkpoints: scoped_job_id(project_id, job_id) + SQLite WAL (busy_timeout=15000ms) isolates job state when multiple workspaces share a database.

Hardware Profiles & Zero OS-Mutation Policy

TierForge never modifies OS services, Windows Registry, network/IPv6 stacks, or system pagefiles. All memory hygiene runs strictly in application space.

Profile Recommended Local Model Batch / VRAM Strategy Min Free VRAM Guard
CPU-Only (16–32 GB RAM) qwen2.5:3b / llama3.2:3b batch_session() + JSON auto-retry (<= 2) CPU fallback
8 GB VRAM (RTX 3060 Ti / 4060) qwen2.5:7b (Q4_K_M) Stage-by-stage isolation; unload Ollama before Tier 3 GPU 4096 MB
12–16 GB VRAM (RTX 4070) qwen2.5:7b / 14b Subprocess isolation per stage 6144 MB
24 GB+ VRAM (RTX 3090 / 4090) qwen2.5:14b / 32b High-throughput batching + exclusive_gpu=True 10240 MB
Apple Silicon (16–64+ GB) 7b (16 GB) / 14b–32b (32 GB+) Unified memory subprocess isolation Leave >= 4 GB headroom

Clean-Room Comparison & Companion Synergy

TierForge's core is 100% MIT-licensed Python stdlib with an automated clean-room auditor (python -m core.license_audit) that blocks BUSL-1.1, AGPL-3.0, and CC-BY-NC dependencies.

Capability TierForge Harness (MIT) rtk-oss (Apache-2.0) ppgranger/token-saver (Apache-2.0)
SQLite per-item checkpoint & $0 resume Built-in No No
Budget caps (--dry-run, job/daily USD) Built-in No No
Multi-project GPU VRAM lease & subprocess isolation Built-in No No
Worker stdout/traceback compression Built-in (output_trimmer.py) Companion CLI (shell proxy) Companion CLI (context saver)
Commercial-safe clean-room license MIT (100% stdlib) Apache-2.0 (avoid BUSL-1.1 std rtk) Apache-2.0

Companion Setup: scripts/preflight_check.py detects optional rtk-oss (Apache-2.0) and token-saver (Apache-2.0) side-by-side without vendoring their source code.


Zero-Cost Architect Handoff & Optional BYOA Companion

  • Pattern A — Zero-Dependency Prompt Handoff (100% Enterprise-Safe): Export a compact spec/audit prompt (e.g., via scripts/audit_step.py), paste it into any Web AI to draft a Blueprint, and hand the Blueprint back to TierForge for local execution.
  • Pattern B — Optional Personal BYOA Browser Bridge: For personal productivity on your own machine, extensions/tierforge-bridge/ provides an auditable, localhost-only (127.0.0.1:19876) Manifest V3 bridge. See LEGAL_AND_COMPLIANCE.md — enterprise/high-volume commercial workloads should use official paid APIs via Tier 3 budget guards rather than Web UI automation.

Verification & Cross-OS Quality Gate

VieForge is continuously verified across Ubuntu Linux, macOS, and Windows (Python 3.10 & 3.12) via a 2-Axis Cross-OS Quality Gate that tests clean wheel installation outside the repo, real multi-process OS locks (fcntl / msvcrt), and 100% token benchmark parity:

# Run full unit test suite (pytest)
uv run --extra dev pytest -v

# Run 2-Axis quality audit (5 Core Contracts + Performance/DX score + portability scan)
uv run python scripts/audit_step.py --step verify

# Run full clean-wheel E2E + multi-process OS lock check locally
uv run python scripts/verify_cross_os.py run --step local_check --out data/os_report_local.json

Local LLM Backends: LLMRouter works natively with Ollama (http://127.0.0.1:11434, with keep_alive=0 VRAM lease hygiene) and auto-detects OpenAI-compatible local servers (LM Studio :1234/v1, llama.cpp :8080/v1, vLLM :8000/v1) via TIERFORGE_LLM_BASE_URL / TIERFORGE_LLM_API_STYLE=auto.

Open-Core Roadmap

  • MIT Core (Always Free & Open Source): 3-Tier orchestration engine (core/), SQLite checkpointing, Ollama lease manager, clean-room output trimmer, budget guard, MCP server, multi-agent skill installer.
  • Pro / Team Extensions (Planned Commercial Add-ons): Multi-node LAN worker pool, team-wide spend dashboards & RBAC approval webhooks, enterprise SSO/audit compliance packs.

See LICENSE and LEGAL_AND_COMPLIANCE.md for full licensing and compliance terms.


Support the Project

VieForge is 100% MIT-licensed and free forever. If it saves you Cloud API budget, you can buy the maintainer a coffee on Ko-fi to help cover local test hardware and maintenance costs.

Trademark Notice

The source code in this repository is licensed under the MIT License. The VieForge name, logo, and associated brand marks are not licensed under MIT and remain the property of VieForge Contributors. Forks and derivative works must use a distinct name and may not imply official endorsement.

Metadata

Release files for vieforge 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vieforge 0.4.1
File Size Uploaded Provenance Actions
vieforge-0.4.1.tar.gz 715.3 kB With provenance Details for vieforge-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vieforge 0.4.1
File Interpreter ABI Platform Actions
vieforge-0.4.1-py3-none-any.whl Python 3 none any Details for vieforge-0.4.1-py3-none-any.whl

Total release size: 828.8 kB

Release files / vieforge-0.4.1.tar.gz

Download URL vieforge-0.4.1.tar.gz
Size 715.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0e058521c3da23001f90082f4ee71c1660c9b7a4140a0c1df5b547ee417bcea1
BLAKE2b-256 checksum
How to use checksums
f9b7253e0adb36bc4dc538f69aa6275357c296d8dd7201811c8286ba3c2ee212
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / vieforge-0.4.1-py3-none-any.whl

Download URL vieforge-0.4.1-py3-none-any.whl
Size 113.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46bd165a6f7a51ea6ef8313b7a0999672dd41cbd35a0c3bccabb638c83e877e9
BLAKE2b-256 checksum
How to use checksums
4bdc863572dc79c22fe5c5251af1170f49833140e263e40f0171e90d91aae05c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for vieforge 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vieforge-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page