Production compiler for AI agents

Agents are interpreted. We compile them.

Same behavior. A fraction of the cost. Millisecond latency. Deterministic.

Hardpath watches production agent runs, finds the recurring paths, and compiles them into verified code. Only novel cases reach the LLM.

For teams running AI agents at scale.

trace · document-extraction · illustrativeinterpreted
Model calls6
Wall time12.2 s
Outputa41f0c · varies
01The problem

Every run is re-reasoned from scratch.

Agents call the model at every step of every run, at full price, even for cases they have solved thousands of times. Cost scales linearly with volume. Latency and variance never go down.

Interpreted agentillustrative trace
llmplan2.1s
llmclassify_doc1.6s
llmextract_fields1.9s
llmvalidate_fields2.4s
llmresolve_entities3.0s
llmformat_output1.2s
Model calls6
Wall time12.2 s
3 runse41a · 9b07 · c3d2
Compiled pathillustrative · same task
fnclassify_doc0.4ms
fnextract_fields1.1ms
fnvalidate_fields0.3ms
fnresolve_entities0.4ms
fnformat_output0.2ms
Model calls0
Wall time2.4 ms
3 runs7c2e · 7c2e · 7c2e
02How it works

Novel cases go to the model. Everything else runs as code.

01New task arrivesEvery request enters the Hardpath router in front of your agent.
02Known path?
yes →run compiled code
no →frontier LLM handles it
03Compile and shadow-verifyThe LLM's trace is compiled to code, then run in shadow against live traffic until outputs match.
04PromoteThe verified path joins the compiled set. Next time, step 02 answers yes.
↺loop: 04 → 02 · coverage grows with every verified trace
03Safety

Knowing when it's safe to stop reasoning.

Path eligibility
A new input runs as code only if it truly belongs on a compiled path, not just because it looks similar.
Change detection
When policies, tools or data change, affected paths are retired automatically.
Safe fallback
Anything unfamiliar goes back to your agent. Nothing is forced through code.

Generating code is the easy part. This is the hard part, and it's what we build.

04Three tiers

Each step runs on the cheapest tier that is correct.

Deterministic code
Fixed logic: parsing, lookups, calculations, routing rules.µs–ms · compute only · bit-identical
Small decision models
Fuzzy forks: classifications and thresholds that don't need a frontier model.ms · pinned weights · versioned
Frontier LLM
Novel cases only. Every trace it produces is a candidate for compilation.seconds · per token · your model
05By owner

One change. Three problems closed.

CFOMost repeat-work cost removed.Compiled paths run on compute, not tokens. Gross margin improves as volume grows instead of eroding.
ComplianceSame input, same output.Every compiled path is versioned code with a full audit trail from source trace to promotion.
EngineeringMillisecond paths. No flaky runs.Compiled paths are testable and diffable. They fail loudly instead of drifting.
06Evidence

The approach is already measured.

Results reported in published 2026 research on compiling LLM workflows into deterministic code. These are not Hardpath customer results.

57xfewer tokens
450xlower median latency
100%reproducibility
Published research · 2026Compiled AI, Trooskens et al., 2026
07Integration

Drop-in SDK.

Works with your existing agents, models and frameworks.

Wrap the agent you already run. No rewrite.
Shadow mode first. Nothing is promoted until outputs match.
Anything novel falls through to your agent unchanged.
Early access
from hardpath import compile_agent
agent = compile_agent(
my_agent, # your existing agent
workflow="document-extraction",
verify="shadow",
)
result = agent.run(task) # compiled if known, LLM if novel
08Pricing

You pay a share of verified savings. If we don't save you money, you don't pay.

savings = baseline_cost − compiled_cost
fee = share × savings
if savings ≤ 0: fee = 0
09Design partners

Compile your highest-volume workflow first.

We're working with a small number of design partners running high-volume agents in production.

Monthly agent spend