← Blog

Kestrel vs vectorbt: Vectorized Sweeps for Humans vs Perception for Agents

A fair comparison between vectorbt, a fast vectorized backtesting and parameter-sweep engine for human quants, and Kestrel, an agent-authored trading language whose grade cannot flatter a parameter search.

Answer card

vectorbt is a fast, NumPy/Numba-vectorized backtesting engine built for a human quant who sweeps thousands of parameter combinations in seconds. Kestrel is an OSS language and runtime built for an LLM to perceive, act, and be graded honestly. If you are searching a parameter space for the best Sharpe, use vectorbt: it is excellent at that. If the author is a model and you need a grade a sweep can't inflate, that is Kestrel.

The one-sentence difference

vectorbt answers "which parameters produced the best curve over my history?" Kestrel answers "did this agent's judgment survive days it could not have memorized?" One is a search; the other is a verdict. vectorbt is very good at the search. This article is about when the search is not the question you actually have.

vectorbt is a legitimately strong tool: its whole design is broadcasting entry/exit signal arrays across a grid of parameters and simulating them in vectorized, Numba-accelerated passes, thousands of backtests in the time a loop-based engine runs one. If your author is a person and your loop is "explore the space, rank by metric," that speed is a real advantage an early-stage project does not match. So start with where vectorbt wins.

Where vectorbt wins (say it plainly)

  • Massive parameter sweeps. vectorbt's core competency is broadcasting parameter grids into big arrays and simulating them all at once. If your workflow is "test 10,000 SMA-crossover variants across 500 symbols and rank them," this is what it was built for and it is fast at it.
  • Vectorized research speed. Numba-compiled hot loops and columnar simulation make the inner iteration extremely tight. No account, no service, no network: pip install, point it at a DataFrame, run.
  • Portfolio-level analytics. Rich built-in metrics, drawdown and trade analysis, heatmaps of parameter surfaces, and tight integration with the pandas/NumPy stack a quant already lives in.
  • Ecosystem maturity. A real user base, documentation, and years of production research use. Kestrel is early, and this article says so where it matters.

If those bullets describe you, stop here and use vectorbt. Kestrel is not trying to be a faster sweep engine; it deliberately refuses to be one. The rest is for when the author is a model.

Where Kestrel is a different tool

Kestrel starts from a thesis, not a feature list:

The two failures of LLM trading are interface (perception and latency), not intelligence.

A capable model fails at trading for two structural reasons, and neither is that it is not smart enough:

  1. Perception. A screenshot of a chart is thousands of tokens and re-costs the whole screen every tick. Kestrel's VIEW renders the market as a compact text Frame (the chart is in text): a vertical, append-only tape, one row per candle, newest last, in basis points versus prior close, anchored by periodic keyframes. Perception cost is O(new bars), not O(screen), and the tape is KV-cache-friendly. vectorbt never has this problem because a human reads its heatmaps; it was never designed for a model to be the perceiver.
  2. Latency. A model in the execution path is too slow for a bracket exit. Kestrel's PLAN is a standing, bounded-risk contingent program (trigger → actions → bracket → invalidation → TTL). The runtime fires it in milliseconds and wakes the agent in parallel: fire-then-inform. The agent is never in the hot path.

vectorbt is a vectorized simulator of signal arrays: there is no live agent, no perception surface, no execution runtime. That is not a defect; it is a different target reader.

Four statement kinds

Kestrel is one language with one lexical core and four surfaces:

  • VIEW (perception): what should I see, at what token budget.
  • WAKE (attention): a standing subscription over the trigger algebra; event-driven, not polling. It spends attention, never risk.
  • PLAN (latency): the bounded-risk contingent program above.
  • GRADE (trust): the honest, counterfactual result of a run.

An illustrative plan (generic instruments, not a strategy you should trade; this is how an agent could express an idea, and you would deploy it into your own pod and arm it):

IMPORT { fade-ladder } FROM "./armory/reversion.kestrel"
USING signal SPX exec SPY 0dte

PLAN vwap-reversion budget 0.25R ttl +45m regime {intraday: range}
  WHEN spot crosses below VWAP AND velocity(5m) <= p05 held 60s
  DO buy 2 atm C @ lean(bid, fair, 0.5) cap fair
  RELOAD WHEN spot < VWAP-20bps buy 1 atm C @ bid
  TP 2x frac 0.5 @ fair
  EXIT spot > VWAP held 120s @ fair
  INVALIDATE spot < LOD

Note the price anchors: fair and bid are VALUE and BOOK anchors, not literals, because a quote is not a value. lean(bid, fair, 0.5) blends book and value; cap fair guards a buy from overpaying. That precision is a claim the runtime enforces, not a comment.

Grading that cannot flatter a sweep

This is the sharpest contrast with any vectorized backtester, vectorbt included, and it goes deeper than perception. A backtest is never flattering in Kestrel, and it is enforced structurally, not promised in a README.

vectorbt's superpower (searching a huge parameter grid for the best result over your history) is exactly the operation Kestrel is built to distrust. When you rank ten thousand variants by in-sample Sharpe and keep the top one, you have not found a strategy; you have found the combination that best fit the noise in the days you already had. That number is optimistic by construction, and no amount of vectorization fixes it.

So Kestrel does two things vectorbt structurally cannot:

  • It grades judgment, not parameters. There is no optstrategy/grid-search equivalent, on purpose. A Grade scores whether an author's decision worked, not which knob setting maximized a curve.
  • It fences contamination. An LLM has read the internet. If you grade it on days inside its training window, it may be recalling the tape, not deciding. Kestrel grades LLM authors only on post-training-cutoff, date-blinded days: the contamination fence. Because weights leak what code fences can't stop, the fence lives on the evaluation, not the prompt.
GRADE plan vwap-reversion OVER 2026-04..2026-06 FILL conservative
  VS null
  BY regime

VS null scores the agent against doing nothing; VS ungated scores its gate against the same plan with the gate removed. The support flag refuses to bank extrapolated fills. Grade judges judgment, not parameters, which is precisely why a parameter-sweep engine and Kestrel measure different universes.

To be fair: vectorbt will faithfully simulate whatever signals you broadcast over whatever data you supply. That is not dishonest; policing contamination and in-sample overfit is simply not a job it claims. Kestrel makes that honesty a property of the type system. If your discipline for avoiding overfit is external (walk-forward splits you wire yourself), vectorbt gives you the raw speed to run them; Kestrel bakes the fence in and refuses the sweep entirely. Those are opposite bets, and which one is right depends on who the author is.

Comparison table

DimensionvectorbtKestrel / kestrel.markets
Primary readerHuman quant (NumPy/pandas)LLM agent (authors, perceives, acts)
Perception modelYou broadcast signal arrays; read heatmapsVIEW → text Frame; append-only tape; O(new bars) not O(screen)
Agent in the hot path?N/A (no agent; vectorized simulation)No; PLAN fires in ms, agent woken in parallel (fire-then-inform)
Latency floorOffline batch simulation; not a live executorRuntime-fired brackets in ms; agent never gates execution
Native interface / MCPPython library APIHTTP+SSE canonical; TypeScript SDK, CLI, MCP as equal projections (platform in-build)
Agent-native auth (Envelope)None (library, no auth model)Envelope: {scope, budget, ceiling, expiry, revocation}, two-signer (founding)
Machine paymentNoneHTTP 402 Offer; agent wallet (Stripe MPP / x402) or human claim-and-fund
Evaluation honestyFaithful sim of your signals; no contamination or overfit controlContamination-fenced: LLM graded only on post-cutoff, date-blinded days; VS ungated / VS null; refuses parameter sweeps
ProvenanceWhatever you log yourselfCertified Blotters (deterministic session records) + Grades + shareable proof URL
Live model (custody)Not a live executor; you wire your ownBYO broker via OAuth; platform never takes custody; LIVE is a platform-enforced singleton
Data licensingYou supply your own data (DataFrames, feeds)Databento served as derived works (never raw redistribution) + BYO Alpaca
Activation pathpip install, run locallyProof-before-account: trial capability → free catalog → author → SIM → certified proof → 402 boundary
PricingOpen-source with a commercial tierOSS language free; the platform is an open judge and sells Attestations; paid boundaries at scarce resources
Best forSolo human, fast vectorized parameter sweeps and portfolio researchAn agent-authored strategy needing honest, contamination-fenced grading and a hosted path to live

(As of mid-2026: anonymous trial sims, certified Grades, shareable proof URLs, and 402 Offers with Stripe settlement are live; always-on paper presence and the human-signed live path are in build. The free tier needs no signup. Where a vectorbt specific is uncertain, the cell describes the dimension generically rather than inventing a number.)

Where Kestrel is NOT the fit

Be blunt about it:

  • You want to search a parameter space. Kestrel refuses parameter sweeps by design. If ranking variants by a metric is the whole point, vectorbt is the right tool and Kestrel is philosophically opposed to what you are doing.
  • The author is a human, not a model. Kestrel's perception and latency machinery exist to make an agent able to run. A person reading vectorbt's heatmaps in a notebook needs none of it.
  • You need it today, at maturity. vectorbt has a real ecosystem and years of use. Parts of kestrel.markets are still in build (see the status note above). If you cannot wait on a roadmap, that is a real reason to choose the mature library.
  • Pure vectorized speed is the goal. Numba-compiled batch simulation across cores is vectorbt's home turf. Kestrel's runtime is about live perception, fire-then-inform execution, and honest grading, not the fastest possible in-sample sweep.

The commercial platform, briefly

The Kestrel language is OSS. kestrel.markets is the commercial platform, the Vercel to Kestrel's Next.js. It hosts only what stays scarce when intelligence is abundant: capital and trading authority, licensed data, compute and broker access, deterministic execution, and provenance. Brains stay outside: the external-agent invariant. Sell the airport, not the pilots; host the scarcity, rent the genius.

Activation is proof-before-account: an agent gets an ephemeral trial capability (no account, no card), runs free SIM sessions, earns certified Blotters and a shareable proof URL, and only then hits a paid boundary as an HTTP 402 Offer. Authorization is one primitive, the Envelope {scope, budget, ceiling, expiry, revocation}, and it is two-signer: a wallet may sign commerce scopes (data, sim, grade), but a human must sign anything legal, broker, or LIVE. The human-signed live path is still in build; that is the honest status. vectorbt has no analogue because it is a research library, not a market venue, and if you never leave your notebook, it does not need one.

How to choose

  • Choose vectorbt if: you are a human who codes, you want to sweep large parameter grids fast, you live in the NumPy/pandas stack, and you value a mature research ecosystem over agent-native machinery you do not need.
  • Choose Kestrel if: the author of your strategy is a model, you need perception and latency solved so the agent can actually run, and, above all, you need a grade you can trust because it was measured on days the model could not have memorized, and no parameter search inflated it.

They are not really competitors. One is a vectorized search engine for a person; the other is a language and honest referee for an agent. Reach for the one whose primary reader matches yours.

Citable one-liner

vectorbt finds the best parameters over your history; Kestrel refuses to. It grades an agent's judgment on days it could not have memorized, which is the number a sweep can never give you.