Grids
Architecture

Source on the left. A running model on the right.

A .grid file parses into an AST, builds into a dependency graph of typed cells, and executes on one of three runtimes — same language, same outputs, same error model.

portfolio.gridgrid
# allocation
weights = positions / SUM(positions) as percentage
returns = HISTORICAL_RETURNS( positions, 252)
cov = COV(returns)
port_var = WEIGHTED_VAR(weights, cov)
sharpe = (port_ret − rf) / SQRT(port_var)
positionsreturnscovweightsport_varsharpe
portfolio · live
Live
C7fx= (port_ret − rf) / SQRT(port_var)
PositionWeightReturn2AAPL24.0%+12.4%3NVDA22.5%+58.7%4MSFT21.0%+18.2%5AMZN17.5%+22.6%6JPM15.0%−2.1%7Sharpe1.84
01 · The lifecycle of a model

Source becomes a running cell, in four stages.

The pipeline is rigid; the substrate is not. Parse, build, compile (or interpret), evaluate. Same path in production, in dev, in tests — only the evaluator at the end is different.

The boundary between "your spreadsheet" and "a deployed program"doesn't exist. The.grid file is the program.

positionsreturnsrfweightscov_matrixport_retport_varvar_95sharpeINPUTSDERIVATIONSMETRICSOUTPUT
02 · The model is a graph

Recompute is local.

When positions changes, weights recomputes — and only the cells downstream of weights follow. In dependency order. Atomically. In Lua, in TypeScript, the same way.

Cycles fire #CIRC! at build time, with the cycle path in the error. Errors travel through the same channels as values, so every consumer sees them in context.

03 · Three substrates, one language

The model never moves. Only the evaluator does.

Same parser, same type system, same 496 functions, same error model. Byte-equivalent output for the portable subset across all three runtimes — selectable per-tenant, per-deployment, even per-file.

01 · Production

lua_generated

Each model becomes a self-contained Redis Functions library. Every cell write triggers an in-Redis recompute. Default at deploy time.

portablefastrule-aware
02 · Multi-tenant

lua_interpreter

One Lua runtime loads many models as JSON IR. Useful when many tenants share a single Redis. Same scheduler, same outputs, smaller cold start.

multi-tenantsharedJSON IR
03 · Local & tests

ts

Pure TypeScript evaluator. Behaviorally equivalent for the portable language subset. Tests and local dev never need Redis to run.

localtestsno-redis

One tenant. One Machine.

Tier 1 deployments run as a single Fly.io Machine per tenant: Redis, the Grid runtime, and the worker fleet bundled into one durable artifact. Operators provision through the control plane; tenants get an isolated data plane in a region close to them.

Compiled Lua means the deployment is just a normal application — no special hosting, no proprietary substrate, no language nobody on your team knows.

FLY.IO MACHINE · 1 PER TENANTRedisstate · queue · pubsubGridparser · runtimeWorkersasync fanoutVolumedurable statePipeevent busSidecarspython · llm↑ heartbeat to control plane
NextCells that fetch the world