# TZeroAlgorithm: AST-Driven Context Pruning Engine & MCP Server for LLM VRAM Optimization

**URL:** <https://forums.developer.nvidia.com/t/tzeroalgorithm-ast-driven-context-pruning-engine-mcp-server-for-llm-vram-optimization/388363>\
**Category:** NVIDIA AI Workbench\
**Tags:** tensorflow, llm, cuda, agentic-ai, nim, jetson-inference\
**Created:** [November 8, 2026, 8:31am UTC](https://forums.developer.nvidia.com/t/tzeroalgorithm-ast-driven-context-pruning-engine-mcp-server-for-llm-vram-optimization/388363 "2026-11-08T08:31:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toprakk](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/toprakk/32/549931_2.png) [@toprakk](https://forums.developer.nvidia.com/u/toprakk)\
**Post date:** [November 8, 2026, 8:31am UTC](https://forums.developer.nvidia.com/t/tzeroalgorithm-ast-driven-context-pruning-engine-mcp-server-for-llm-vram-optimization/388363/1 "2026-11-08T08:31:54Z")

</div>

Hi everyone,

I’ve been developing an open-source project called **TZeroAlgorithm** aimed at solving the context amnesia, KV-cache inflation, and VRAM memory bandwidth pressure caused by large-scale agentic tool calls and codebase-level payload passing.

### The Core Problem in Agentic Inference

When LLM agents operate across large repositories or complex tools, passing full code dumps or unoptimized AST payloads creates massive KV-cache bloat. This spikes Time-to-First-Token (TTFT) latency, degrades memory throughput, and exhausts GPU VRAM during multi-turn orchestration.

### How TZeroAlgorithm Solves It

Rather than relying on lossy text summarization, TZeroAlgorithm uses deterministic, structural pruning before payloads hit the inference API:

- **Hierarchical AST Pruning:** Extracts smart skeletons, call chains (`trace_symbol_call_chain`), and repository dependency trees (`get_project_context_tree`, `query_module_dependencies`) while stripping non-essential bodies.

- **Architecture Boundaries & Quality Audits:** Includes rule engines for enforcing structural boundaries (`enforce_architecture_boundaries`) and detecting dead code / duplication (`find_dead_code`, `find_code_duplicity`).

- **Zero-Leak & Hallucination Guardrails:** Validates payloads through built-in verification boundaries (`verify_zero_leak_security`, `verify_hallucination_guard`) prior to context injection.

- **Model Context Protocol (MCP) Architecture:** Runs as a standard MCP server natively exposing 20+ specialized pruning and analysis tools across Claude, Cursor, Windsurf, and custom agent runtimes.

### Exploration with NVIDIA Inference Pipelines

I am currently exploring how this pre-inference AST pruning can be paired with **NVIDIA TensorRT-LLM** and **NVIDIA NIM** deployment microservices. The objective is to act as a hardware-aware context middleware that minimizes KV-cache memory footprints and token processing overhead on local RTX workstations and datacenter GPUs.

- **GitHub Repository:** [GitHub - toprakahmetaydogmus/TZeroAlgorithm: Deterministic AST Context Compressor, Pre-Flight Reality-Lock & 20-Tool MCP Server for Claude, Cursor, Windsurf & Copilot. Up to 95% token reduction, 1-Click Auto-Vault, and local engine. · GitHub](https://github.com/toprakahmetaydogmus/TZeroAlgorithm)

- **Architecture Specs:** Documented in the repo’s `ARCHITECTURE.md` and MCP schema definitions.

I would love to get feedback from NVIDIA runtime and inference engineers:

1. Where in the NIM / TensorRT-LLM pre-processing stack could AST-aware context pruning deliver the highest throughput gains?

2. Has anyone benchmarked structural context pruning against native attention window compression methods on long-context models?

Looking forward to your insights!  
 Feature Request
