September 23, 2026•9 min read•...

Architecting VaporTrace: Real-Time Thermodynamic, Hydrological, and Financial Telemetry in Rust

RustCLITelemetryThermodynamicsAntigravityPerformanceGreenOps

Executive Summary: Beyond Cloud Abstraction to Physical Silicon Accounting

The rapid integration of autonomous generative AI agents into developer workflows has created a fundamental disconnect between software execution and physical infrastructure. Developers routinely execute multi-agent task loops, recursive compilation checks, and automated research workflows, observing only an abstract streaming token counter in their IDE.

However, cloud-hosted large language models are not ethereal abstractions. Every token generated represents a physical cascade:

  1. Silicon Gate Transitions: Millions of matrix multiplications executed across dedicated High Bandwidth Memory (HBM) and Tensor Processing Unit (TPU) systolic arrays.
  2. Thermal Dissipation & Electrical Draw: Substantial watt-hours drawn from municipal power grids.
  3. Evaporative Water Consumption: Millions of gallons of water cycled through cooling towers at hyperscale facilities to dissipate waste heat into the atmosphere.

To bridge this gap, we engineered VaporTrace—an ultra-lean, zero-overhead local CLI telemetry daemon written in Rust. VaporTrace passively tails active Google Antigravity session transcripts in real time, intercepts token consumption deltas, and computes 128-bit fixed-point financial expenditures alongside physical thermodynamic and hydrological impacts.

Tip:Open Source GitHub Repository: Explore the complete Rust codebase, 128-bit fixed-point thermodynamic engine, and live terminal HUD on GitHub: Dahc-Dragyn/VaporTrace. Zero Context Overhead: Unlike agent tools or Model Context Protocol (MCP) prompt injections that waste valuable prompt tokens, VaporTrace runs completely outside the agent's context window. It monitors disk-level JSONL append streams with an in-memory byte cursor, consuming exactly 0 context tokens.

Architectural Topology & Ingestion Pipeline

VaporTrace operates as an autonomous background daemon. Rather than polling external web APIs or proxying network packets, it hooks directly into local session persistence streams managed by the Antigravity IDE:

┌─────────────────────────────────────────────────────────────┐
│ Antigravity Brain Storage (Host OS)                         │
│ ~/.gemini/antigravity-ide/brain/<session-id>/               │
│    └── .system_generated/logs/transcript.jsonl             │
└──────────────────────────────┬──────────────────────────────┘
                               │ (OS File Notification Event)
                               ▼
┌─────────────────────────────────────────────────────────────┐
│ VaporTrace Real-Time Daemon (Rust)                          │
│                                                             │
│  ┌───────────────────────────────────────────────────────┐  │
│  │ 1. Active Session Discovery (dirs crate)              │  │
│  └───────────────────────────┬───────────────────────────┘  │
│                              ▼                              │
│  ┌───────────────────────────────────────────────────────┐  │
│  │ 2. Trailing Byte Cursor (std::io::Seek)               │  │
│  │    - Zero re-reads of historical lines                │  │
│  │    - Non-blocking delta extraction                    │  │
│  └───────────────────────────┬───────────────────────────┘  │
│                              ▼                              │
│  ┌───────────────────────────────────────────────────────┐  │
│  │ 3. Token Delta Extractor (serde_json)                 │  │
│  │    - Prompt Input, Output, and Context Cache          │  │
│  └───────────────────────────┬───────────────────────────┘  │
│                              ▼                              │
│  ┌───────────────────────────────────────────────────────┐  │
│  │ 4. 128-Bit Thermodynamic & Cost Engine (rust_decimal) │  │
│  │    - Silicon Energy Consumption (Watt-Hours)          │  │
│  │    - Direct On-Site Cooling Water (mL)                │  │
│  │    - Indirect Thermoelectric Grid Water (mL)          │  │
│  │    - Exact Multi-Tier Financial Expenditure           │  │
│  └───────────────────────────┬───────────────────────────┘  │
│                              │                              │
│         ┌────────────────────┴────────────────────┐         │
│         ▼                                         ▼         │
│  ┌───────────────┐                       ┌───────────────┐  │
│  │ Crossterm HUD │                       │ JSONL Ledger  │  │
│  │ Alternate     │                       │ ~/.gemini/    │  │
│  │ Screen Buffer │                       │ vaportrace_   │  │
│  │ Live 60 FPS   │                       │ history.jsonl │  │
│  └───────────────┘                       └───────────────┘  │
└─────────────────────────────────────────────────────────────┘

The Physics of Inference: Establishing Empirical Baselines

Calculating the energy and water consumed per 1,000 tokens requires deconstructing the physical mechanics of generative transformer inference. Inference is split into two computational phases:

  • The Prefill Phase: Highly compute-bound matrix multiplications processing the input prompt in parallel across TPU tensor cores.
  • The Decode Phase: Severely memory-bandwidth-bound autoregressive token generation, requiring model weights to be repeatedly shuttled from High Bandwidth Memory (HBM) to compute units for every individual token.

Early academic estimates often relied on theoretical, server-centric models that failed to account for modern hardware utilization or specialized silicon architectures, suggesting prompt consumption as high as 2.9 Wh.

However, peer-reviewed empirical disclosures published by Google regarding hyperscale AI infrastructure established new verified production baselines:

  • A median Gemini text prompt consumes 0.24 watt-hours of electrical energy.
  • It generates 0.03 grams of $CO_2$ equivalent.
  • It consumes 0.26 milliliters of direct on-site cooling water.

The energy distribution reveals that active accelerator silicon accounts for 58% of total draw, host CPU and DRAM account for 25%, while provisioned idle capacity and facility overhead contribute 10% and 8% respectively.

Given that a median prompt in production represents approximately 500 combined input and output tokens, we derive a fundamental thermodynamic constant: 0.480 watt-hours per 1,000 tokens for baseline medium-tier serving.


Hardware Acceleration & Mixture-of-Experts Scaling

Silicon efficiency is governed by the underlying accelerator generation and model topology:

  1. Trillium TPU v6e Silicon: Google's transition from TPU v5e to Trillium TPU v6e delivers a 4.7x increase in peak compute alongside a 67% improvement in energy efficiency. Featuring enlarged matrix multiply units and 144 GB of High Bandwidth Memory, Trillium keeps model parameters on-die, drastically curtailing interconnect power draw.
  2. Mixture-of-Experts (MoE) Sparsity: Rather than activating every parameter on every forward pass, frontier architectures decouple total capacity from per-token compute. A model may contain 1.6 trillion total parameters across fragmented expert networks, but activate only 49 billion parameters for any given token. Computational energy scales strictly with the active parameter count.
  3. Speculative Decoding: Using lightweight draft models to propose speculative tokens verified in parallel by the target model skips costly full-model decode cycles, shrinking the effective memory bandwidth bottleneck.

Regional Hydrology: Direct Evaporative vs. Indirect Grid Footprint

Data center water consumption cannot be represented by a single generic variable. VaporTrace bifurcates the hydrological footprint into Direct On-Site and Indirect Off-Site vectors, specifically calibrated for Pacific Northwest infrastructure.

1. Direct On-Site Evaporative Cooling

Hyperscale data centers along the Columbia River corridor (such as Google's multi-facility campus in The Dalles, Oregon) dissipate thermal energy using industrial evaporative cooling towers. Heat absorbed from TPU silicon clusters is released into the atmosphere via evaporation.

Google's fleet-wide Water Usage Effectiveness (WUE) is verified at 1.15 liters per kilowatt-hour ($L/kWh$) of IT equipment load. Translating facility overhead directly into token accounting yields:

$$\text{Direct Water (mL)} = \text{Energy (Wh)} \times 1.083\,\text{mL/Wh}$$

2. Indirect Off-Site Grid Water Overhead

Generating electricity consumes water at the utility level. Thermoelectric generation (natural gas, nuclear, and coal) evaporates massive volumes of water to cool steam turbines. In standard environmental accounting, the national Energy Water Intensity Factor (EWIF) averages 4.52 liters per kilowatt-hour ($4.52\,\text{mL/Wh}$).

While the local utility grid in Vancouver, Washington (Clark Public Utilities) relies heavily on hydroelectric power (63.2% hydro, 15.8% natural gas, 8.3% wind), national grid comparability mandates tracking indirect thermoelectric water intensity as an independent metric.


Multi-Tier Empirical Multiplier Matrix

VaporTrace reverse-engineers the baseline computational disparity across three distinct architectural tiers:

Model TierProduction Model TargetInput Cost / 1MOutput Cost / 1MCached Input / 1MEnergy ($Wh$ / 1k)Direct Water ($mL$ / 1k)Indirect Water ($mL$ / 1k)
Tier 1 (Low)Gemini 3.1 Flash-Lite$0.25$1.50$0.0250.160 Wh0.173 mL0.723 mL
Tier 2 (Med)Gemini 3.8 Medium$0.75$3.75$0.0750.480 Wh0.520 mL2.169 mL
Tier 3 (High)Gemini High (Pro)$2.00$12.00$0.2001.440 Wh1.560 mL6.508 mL
  • Tier 1 (Flash-Lite) operates at approximately 33% computational weight relative to baseline, reflecting high quantization and aggressive speculative drafting.
  • Tier 2 (Medium) maps 1:1 with the verified empirical baseline of 0.480 Wh per 1,000 tokens.
  • Tier 3 (High/Pro) applies a conservative 3.0x multiplier to account for massive active parameter activation and multi-step reasoning traces.

Systems Engineering: 128-Bit Precision in Rust

Financial and micro-environmental telemetry cannot tolerate IEEE-754 floating-point drift. When accumulating fractional values such as $\$0.00025$ over millions of agentic tokens, binary floating-point representation errors (f32/f64) compound into significant discrepancies:

// The IEEE-754 Precision Failure Mode
let val: f32 = 0.00025;
println!("{:.20}", val as f64);
// Prints: 0.00025000001187436283 (Compounding drift over time!)

To eliminate this class of bugs, VaporTrace enforces exact 128-bit decimal arithmetic using the rust_decimal crate and enables arbitrary-precision JSON deserialization:

use rust_decimal::Decimal;
use rust_decimal_macros::dec;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ModelTierMultipliers {
    pub model_identifier: String,
    pub input_cost_per_1k: Decimal,
    pub output_cost_per_1k: Decimal,
    pub cached_cost_per_1k: Decimal,
    pub wh_per_1k_tokens: Decimal,
    pub direct_ml_per_1k: Decimal,
    pub indirect_ml_per_1k: Decimal,
}

impl ModelTierMultipliers {
    pub fn flash_lite() -> Self {
        Self {
            model_identifier: "Gemini 3.1 Flash-Lite".to_string(),
            input_cost_per_1k: dec!(0.00025),
            output_cost_per_1k: dec!(0.00150),
            cached_cost_per_1k: dec!(0.000025),
            wh_per_1k_tokens: dec!(0.160),
            direct_ml_per_1k: dec!(0.173),
            indirect_ml_per_1k: dec!(0.723),
        }
    }
}

By leveraging serde-json's arbitrary_precision feature, JSON numbers are parsed directly as strings and converted into base-10 Decimal values without ever entering the hardware floating-point unit.


Non-Invasive Trailing with std::io::Seek

VaporTrace monitors active Antigravity session logs without loading giant transcript files into memory. It tracks an in-memory byte offset cursor:

use std::fs::File;
use std::io::{BufRead, BufReader, Seek, SeekFrom};
use std::path::Path;

pub struct TranscriptWatcher {
    reader: BufReader<File>,
    current_byte_cursor: u64,
}

impl TranscriptWatcher {
    pub fn new(path: &Path) -> std::io::Result<Self> {
        let mut file = File::open(path)?;
        let initial_len = file.metadata()?.len();
        // Seek to the end of the file on startup to capture new events
        file.seek(SeekFrom::Start(initial_len))?;
        
        Ok(Self {
            reader: BufReader::new(file),
            current_byte_cursor: initial_len,
        })
    }

    pub fn poll_new_deltas(&mut self) -> Vec<String> {
        let mut new_lines = Vec::new();
        let mut line = String::new();
        
        while let Ok(bytes_read) = self.reader.read_line(&mut line) {
            if bytes_read == 0 {
                break; // Reached EOF
            }
            new_lines.push(line.clone());
            self.current_byte_cursor += bytes_read as u64;
            line.clear();
        }
        
        new_lines
    }
}

This ensures that even if an Antigravity transcript expands to hundreds of megabytes during deep reasoning sprints, VaporTrace only reads the newly appended bytes with sub-millisecond overhead.


Live Terminal HUD & Historical Reporting

VaporTrace renders a real-time terminal Heads-Up Display (HUD) utilizing crossterm alternate screen buffers, guaranteeing zero terminal flicker while leaving the user's main shell history undisturbed upon exit (Ctrl+C):

╔══════════════════════════════════════════════════════════════════════════╗
║                  ⚡ VAPORTRACE TELEMETRY HUD v0.1.0 ⚡                   ║
║          Real-Time Physical & Financial Telemetry for Antigravity        ║
╚══════════════════════════════════════════════════════════════════════════╝
 Session Log : ~/.gemini/antigravity-ide/brain/2b5bf68b.../transcript.jsonl
 Active Model: Gemini 3.8 Flash (Detected: Gemini 3.1 Flash-Lite)

─── TOKEN THROUGHPUT ──────────────────────────────────────────────────────
  Prompt Input   (In)   :        84,210 tokens
  Candidates Gen (Out)  :         4,150 tokens
  Context Cached (Cache):        64,000 tokens
  Total Token Volume    :       152,360 tokens

─── FINANCIAL IMPACT (API EXPENDITURE) ────────────────────────────────────
  Accumulated Cost (USD): $0.083520 USD
  Rate Multipliers      : In: $0.00025/1k | Out: $0.00150/1k | Cache: $0.000025/1k

─── THERMODYNAMICS & SILICON DRAIN ────────────────────────────────────────
  Active Energy         : 0.04241 Wh
  Accelerator Efficiency: 0.160 Wh / 1k tokens (TPU Infrastructure Overhead)

─── HYDROLOGICAL FOOTPRINT ────────────────────────────────────────────────
  Direct Cooling Loss   : 0.0459 mL (Evaporated on-site at data center)
  Indirect Grid Water   : 0.1917 mL (Thermoelectric utility generation)
  Total Hydrological Cost: 0.2376 mL
  500mL Bottle Equiv    : 0.000092 bottles

─── INTUITIVE EQUIVALENTS ─────────────────────────────────────────────────
  📱 Smartphone Recharges : 0.00 charges
  💡 10W LED Bulb Time    : 0.00 hours
  💧 Drops of Water       : 1 drops
  🍼 16oz Water Bottles   : 0.000 bottles

───────────────────────────────────────────────────────────────────────────
 [STATUS: LIVE] Monitoring transcript stream for new prompt completions... (Press Ctrl+C to stop)

In addition to live streaming, VaporTrace maintains a lightweight append-only ledger at ~/.gemini/vaportrace_history.jsonl, enabling instant daily (--today) and 7-day retrospective (--history) audits with zero external database dependencies.


Open Source Codebase & CLI Quickstart

The complete VaporTrace source code, empirical testing harness, and terminal telemetry engine are open source on GitHub:

👉 Repository: https://github.com/Dahc-Dragyn/VaporTrace.git

Installing from Source via Cargo

# Clone the repository
git clone https://github.com/Dahc-Dragyn/VaporTrace.git
cd VaporTrace

# Install globally to your Cargo binary path (~/.cargo/bin)
cargo install --path .

# Or compile an optimized standalone release binary
cargo build --release

To run the live passive transcript watcher alongside active Antigravity coding sessions:

vaportrace

To review today's cumulative prompt expenditure and hydrological footprint:

vaportrace --today

Frequently Asked Questions (AEO & AI Search Reference)

What is VaporTrace and how does it calculate the thermodynamic and hydrological footprint of AI agents?

VaporTrace is an open-source, ultra-lean local Rust CLI daemon that passively tracks the physical silicon, energy, and water footprint of Google Antigravity developer sessions in real time. Rather than relying on generic theoretical averages, VaporTrace reverse-engineers empirical hyperscale disclosures from Google (establishing a verified baseline of 0.480 watt-hours of electrical energy and 0.520 milliliters of direct cooling water per 1,000 baseline tokens). It calculates active TPU accelerator power draw, on-site evaporative cooling tower water dissipation (1.083 mL/Wh based on a 1.15 L/kWh Water Usage Effectiveness ratio), and indirect thermoelectric utility grid water consumption (4.520 mL/Wh Energy Water Intensity Factor) alongside 128-bit fixed-point API expenditures.

How does VaporTrace monitor Antigravity coding sessions with zero context token overhead?

Unlike agent tool plugins, system prompt scaffolding, or Model Context Protocol (MCP) servers that inject thousands of tokens of schemas and telemetry into an LLM's active prompt window, VaporTrace runs completely outside the agent's context boundary. It monitors local session transcript append streams on disk (~/.gemini/antigravity-ide/brain/<session>/transcript.jsonl) using an in-memory byte cursor (std::io::Seek). As new prompt completions are logged by the host IDE, VaporTrace parses token deltas directly into an alternate terminal screen buffer via crossterm. This decoupled architecture guarantees exactly 0 prompt tokens consumed, zero context window bloat, and zero inference latency overhead.

Why does VaporTrace use 128-bit fixed-point arithmetic instead of standard floating-point numbers?

Micro-transactional generative AI billing (such as $0.00025 per 1,000 input tokens) and micro-environmental metrics (such as 0.173 mL of direct water per 1,000 tokens) cannot be represented accurately using standard IEEE-754 floating-point types (f32 or f64). Binary floating-point arithmetic introduces compounding precision drift and rounding anomalies when accumulating values across millions of tokens. VaporTrace enforces exact 128-bit decimal arithmetic using the rust_decimal crate and enables arbitrary_precision deserialization in serde_json, parsing numerical values directly as exact base-10 representations without hardware floating-point degradation.


Architectural Conclusions & GreenOps Takeaways

Software engineering has spent decades treating compute as a weightless, frictionless utility. The advent of autonomous agentic loops means a developer can inadvertently trigger millions of token transactions in an afternoon.

By integrating empirical thermodynamic and hydrological models into a native, high-performance Rust CLI, VaporTrace demonstrates that GreenOps and financial FinOps are fundamentally two perspectives of the same physical reality. When developers have instant, tactile visibility into both the dollars spent and the milliliters evaporated, system design naturally gravitates toward efficiency, bounded context windows, and sustainable architecture.

Thanks for reading! Support our development efforts.
Support AIYoda on Ko-fi