2026-10-11 16:37 UTC

AgentJIT maintainer eminsk claims the released compiler replaces recurring LLM-agent trajectories with guarded deterministic Python and dynamic fallbacks, potentially eliminating repeated reasoning tokens and sharply reducing latency without losing workflow correctness.

state: corroboratedheat: lowuncertainty: mediumconvergesscott: mediumagent-harnesses agent-workflow-compilation inference-economicseminskAgentJIT

What is this?

AgentJIT (github.com/eminsk/agentjit, Apache-2.0, maintainer eminsk) is an installable Python package claiming to just-in-time compile recurring multi-step LLM-agent trajectories into deterministic Python — advertised at 0.08 ms warm path, zero token cost — with runtime guards that bail out to the dynamic agent on mismatch. Nothing in these snippets validates the artifact itself: the GitHub description merely restates the claim, the Show HN submission visible here (posted by account 'eminskinfo', not 'eminsk'; 2 points, no comments at snapshot) fits the established pattern of commentless self-promotion, and no third-party testing or adoption appears anywhere in the results. The surrounding direction keeps gaining independent weight, however: TraceCompiler (Yadouni et al., EPFL — mined traces compiled into mostly-deterministic workflows, precision measured on AppWorld), Winston et al.'s agent JIT compilation, Oya's record-once/replay-without-LLM browser product, practitioner pieces on the deterministic-workflow-vs-agent distinction and LLM-response caching (the cruder end of the same reuse spectrum), and — new in this pass — OpenAI winding down AgentKit's visual Agent Builder and Evals (gone by Nov 30, 2026), telling users with 'workflows that should continue as code' to move to the Agents SDK. The package-specific questions remain unresolved: whether the released code implements the full trace→compile→guard pipeline, real-agent latency/correctness numbers, and safe handling of divergent workflows.

Why it matters to Scott

The new element in the grounding β€” OpenAI winding down AgentKit's visual Agent Builder and telling users 'workflows that should continue as code' β€” is a consequential other party newly arriving, at product-strategy level with an enforced migration deadline, at the exact position Scott's Deterministic-AI Pendulum, Code-First Architecture, agent-native-computing crystallisation claim, and Generative Pendulum ebook already hold: repeatable workflows should crystallise into deterministic code. That is dated-receipts material for his publishing queue and new centre-of-gravity evidence for the trajectory-compilation direction this case tracks. The AgentJIT artifact itself remains unvalidated (mocked-agent benchmark, commentless launch, zero adoption), so it stays a watching-only anchor β€” the convergence is what lifts the case, not the package.
ip:concept.deterministic-ai-pendulumip:framework.code-first-architectureip:source.the-generative-pendulum-ebookip:framework.agent-native-computingdev:concept.deterministic-agent-control-planeradar:compiled-agent-skills-token-reduction
queries asked of Scott's wikis
  • code-first architecture: persisting successful agent procedures as reusable deterministic code
  • deterministic control plane β€” when a known sequence means the agent should not reason
  • guard and bailout fallback patterns in my agent harness designs
  • tool-call tracing and trajectory capture in my dev projects
  • agent token cost and latency reduction via caching or compilation
  • how I treat benchmarks produced against simulated or mocked agents

Measured heat

now 0 pts/hpeak 7 pts/hcomments 0/hpeers p14momentum: steady2 platformsage 675h
points/hour across evidence Β· reading as of 2026-10-12 02:59:37.977291+11:00 Β· deterministic, not a model opinion

How the heat travelled

09-13 13:21 (minted)⭐ origin echo-reconstructedThe released package claims to trace agent tool calls into Python pipelines with runtime guards and fallback to the dynamic agent; its simul
eminsk on github (echo) Β· attributed from hn.story.49683344 Β· published time unknown
β€”
09-13 12:39first on hacker news Β· published Β· lag ?Show HN: AgentJIT – Compile dynamic LLM agent workflows into 0.1ms Python
eminskinfo
β€”
09-13 12:39amplified on hacker news πŸ‘‘hn.story.49683344
eminskinfo
peak 4 Β· 0 comments Β· 39% of case engagement
09-25 22:03amplified on hacker newshn.story.49850532
nlpnerd
peak 1 Β· 0 comments Β· 11% of case engagement
09-29 13:28amplified on hacker newshn.story.49892901
oyadoti
peak 2 Β· 0 comments Β· 20% of case engagement
10-07 16:22amplified on hacker newshn.story.49994981
krishna_bhatnag
peak 2 Β· 1 comments Β· 30% of case engagement
09-13 13:20our radar first saw it Β· lag ?discovery anchor: hn.story.49683344β€”
pace: p32 vs 1032 stories at the 336h mark (now 675h old) β€” ahead of addom-local-coding-harness (1.5x), behind agentsec-static-config-auditing (0.8x)

Evidence (5) β€” ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnShow HN: AgentJIT – Compile dynamic LLM agent workflows into 0.1ms Python
Retrieved article excerpt

Open article Β· Retrieved 2026-09-13T13:21:38.428087+00:00

# ⚑ AgentJIT

### Just-In-Time Compiler for AI Agent Trajectories

**Compile flaky, 30-second multi-step AI Agent workflows into 5-millisecond deterministic code.**

[PyPI Version](https://pypi.org/project/agentjit/)
[Python Version](https://pypi.org/project/agentjit/)
[Free-Threaded No-GIL](https://pypi.org/project/agentjit/)
[License](https://github.com/eminsk/agentjit/blob/main/LICENSE)
[CI Test Suite](https://github.com/eminsk/agentjit/actions/workflows/ci.yml)
[Speedup](https://github.com/eminsk/agentjit/blob/main)
[Token Cost](https://github.com/eminsk/agentjit/blob/main)
[PRs Welcome](https://github.com/eminsk/agentjit)
[Open In Colab](https://colab.research.google.com/github/eminsk/agentjit/blob/main/notebooks/AgentJIT_Interactive_Demo.ipynb)

[**Quickstart**](https://github.com/eminsk/agentjit#quickstart) β€’ [**Why AgentJIT?**](https://github.com/eminsk/agentjit#the-problem-in-2026-why-agentjit) β€’ [**Architecture**](https://github.com/eminsk/agentjit#architecture) β€’ [**Benchmarks**](https://github.com/eminsk/agentjit#benchmarks) β€’ [**Speculative Execution**](https://github.com/eminsk/agentjit#speculative-execution--bailouts)

---

## πŸ’₯ The Problem in 2026: Why AgentJIT?

In 2026, autonomous AI agents solve real-world workflows across business, DevOps, and data analysis. However, running stochastic LLM loops in production faces four critical barriers:

1. **Massive Latency:** A standard 4-step agent workflow (`think -> tool -> observe -> think`) takes **15 to 45 seconds**.
2. **Exponential Costs:** Running the loop 10,000 times/day costs thousands of dollars in redundant API tokens.
3. **Flakiness & Hallucinations:** Even 98% reliability per step leads to compounding errors across multi-turn trajectories.
4. **Redundant Reasoning:** Most agent invocations execute the *exact same structural trajectory* with slightly different input parameters (e.g. different user IDs or dates).

---

## πŸ—οΈ Architecture & Trajectory JIT Compilation

Just like **V8** compiles hot JavaScript into machine code, and **PyTorch `torch.compile`** traces dynamic tensors into optimized CUDA kernels, **AgentJIT traces dynamic agent trajectories and compiles them into pure, type-safe, ultra-fast Python code.**

```
       [Dynamic Agent Task]
                β”‚
         (1st run / warmup)
                β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚   AgentJIT Tracer    β”‚ ── (Captures tool calls, data flow, variables)
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
                β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚ DAG Flow Analyzer    β”‚ ── (Parameter generalization, dependency graph)
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
                β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚ AST Code Generator   β”‚ ── (Synthesizes pure Python pipeline + Guards)
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
                β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚   Compiled JIT Pipeline    β”‚ ──► Subsequent runs: <1ms, $0 tokens!
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
       (Guard failure? Deopt!)
                β–Ό
     [Fall back to LLM Agent]
```

---

## ⚑ Key Features

- 🏎️ **Up to 100,000x Speedup:** Hot paths drop from ~20,000 ms to **< 0.1 ms**.
- πŸ’Έ **100% Token Savings:** Once compiled, recurring workflows run completely locally with **0 LLM tokens consumed**.
- πŸ›‘οΈ **Speculative De-Optimization (Bailout):** Automatically generates runtime input guards. If unexpected data formats or divergent branches appear, AgentJIT transparently falls back to the dynamic LLM agent.
- πŸ” **Transparent & Inspectable:** Inspect the exact Python code generated by the JIT with `agent.source_code`.
- 🧡 **Free-Threaded / No-GIL (PEP 703) Ready:** Thread-safe runtime fully tested on Python 3.13t and 3.14t for true multi-core parallel agent execution without GIL contention.
- πŸ”Œ **Framework Agnostic:** Seamlessly wraps LangChain, CrewAI, AutoGen, OpenAI Tool calls, or native Python functions.

---

## πŸš€ Quickstart

### Installation

```
pip install agentjit
# or with uv
uv add agentjit
```

### 10-Second Example

Decorate your agent with `@jit` and mark your tools with `@trace_tool`:

```
from agentjit import jit, trace_tool

# 1. Define your tools
@trace_tool()
def search_product(name: str):
    return {"name": name, "price": 49.99, "stock": 120}

@trace_tool()
def apply_tax(price: float, tax_rate: float):
    return round(price * (1.0 + tax_rate), 2)

# 2. Decorate your agent with @jit
@jit
def checkout_agent(product_name: str, tax_rate: float):
    # This dynamic workflow could call an LLM (Claude, GPT, Gemini)
    item = search_product(name=product_name)
    total = apply_tax(price=item["price"], tax_rate=tax_rate)
    return {"item": item["name"], "total": total}

# --- Run 1: Warmup & Tracing (runs dynamic agent, compiles to Python) ---
order1 = checkout_agent("Mechanical Keyboard", 0.19)

# --- Run 2+: Instant compiled execution (ZERO tokens, sub-millisecond!) ---
order2 = checkout_agent("Wireless Mouse", 0.19)  # Takes 0.05 ms!
```

---

## πŸ”Ž Inspecting Generated Code

You can view the exact synthesized Python code generated by the JIT at any time:

```
print(checkout_agent.source_code)
```

**Synthesized Output:**

```
def compiled_checkout_agent(product_name, tax_rate):
    """JIT-compiled trajectory pipeline generated by AgentJIT.
    Executes deterministically in sub-millisecond time with zero token cost.
    """
    # --- Speculative Guards ---
    if not (product_name is not None):
        raise GuardViolation("Argument 'product_name' must not be None", param="product_name")
    if not (isinstance(product_name, str)):
        raise GuardViolation("Argument 'product_name' must be of type str", param="product_name")

    # --- Execution Steps ---
    step_1_out = _tools['search_product'](name=product_name)
    step_2_out = _tools['apply_tax'](price=step_1_out['price'], tax_rate=tax_rate)

    # --- Return Final Result ---
    return {'item': step_1_out['name'], 'total': step_2_out}
```

---

## πŸ“Š Benchmarks

Benchmark comparing a simulated 3-step reasoning agent (15s latency, 2,500 tokens) vs AgentJIT compiled execution over 100 runs:

| Execution Mode | Mean Latency | 99th Percentile | Cost per 1k runs | Token Usage | Determinism |
| --- | --- | --- | --- | --- | --- |
| **Standard LLM Agent** | `14,820 ms` | `22,400 ms` | **$75.00** | 2,500,000 | ~94% |
| **AgentJIT (Warm Path)** | **`0.08 ms`** | **`0.12 ms`** | **$0.00** | **0** | **100%** |
| **Improvement** | **185,000x faster** | **186,000x faster** | **100% savings** | **Zero tokens** | **Rock-solid** |



---

## πŸ›‘οΈ Speculative Execution & Bailouts

What happens when an input is unusual or triggers an unexpected branch?

AgentJIT uses **Speculative De-Optimization**:

1. Input variables are validated against synthesized guards.
2. If any guard fails (e.g. wrong type, missing required key) or a tool raises an unhandled exception, AgentJIT catches `GuardViolation`.
3. It seamlessly bails out to the dynamic LLM agent to handle the edge case.
4. Telemetry records the bailout for future multi-branch specialization.

```
# Normal input: runs compiled pipeline in 0.08ms
checkout_agent("Monitor", 0.19)

# Divergent input (e.g. invalid type): automatically bails out to dynamic agent
checkout_agent(12345, None)  # Transparently de-optimizes, no crash!
```

---

## πŸ› οΈ Telemetry & Observability

Monitor your compiled agents in real time:

```
print(checkout_agent.stats)
# Output:
# {
#     "total_calls": 1500,
#     "compiled_hits": 1492,
#     "bailouts": 8,
#     "compiled_hit_rate": 99.47,
#     "total_time_saved_ms": 22380000.0,
#     "total_tokens_saved": 3730000
# }
```

---

## πŸ—ΊοΈ Roadmap for 2026–2027

- **Core Tracer & DAG Flow Analyzer**
- **AST Code Generation with Speculative Guards**
- **De-optimization / Bailout Runtime**
- **`@jit` Decorator with Auto-Warmup**
- **Multi-Branch Polyhedral JIT:** Merge multiple execution paths into a unified control-flow graph (`if/else` branching synthesis).
- **eBPF-Isolated Micro-Sandbox:** Ultra-fast sub-millisecond process sandbox for compiled shell actions.
- **WebAssembly (Wasm) Export:** Compile agent trajectories into standalone Wasm binaries for browser and edge runtime.

---

## πŸ“„ License

AgentJIT is open-source software licensed under the [Apache 2.0 License](https://github.com/eminsk/agentjit/blob/main/LICENSE).
eminskinfo40
🟧 echo.github ⭐The released package claims to trace agent tool calls into Python pipelines with runtime guards and fallback to the dynamic agent; its simuleminskβ€”β€”
🟧 hnSkill-Guided Mining and Compilation of LLM Agent Tracesnlpnerd10
🟧 hnOya, an agent does a browser task once, then it replays with no LLMoyadoti20
🟧 hnCompiling the jobs AI agents repeat: 58% fewer LLM callskrishna_bhatnag21

Interpretation history

Decision trace