DuckDB Jev Spatial: Jev-Style SQL Decisions with a Local Laya Model
When DuckDB published Jev and DuckDB: Plain-English Conditions in SQL , I wanted to try it on my North Sea wells and pipelines right away. The idea is simple and powerful. You write a plain-English condition inside a SQL query, and a decision model answers it for each row. But those Jev functions send the row data to the hosted TypeSafe API, and that needs an API key. I already had Laya, an open-weight decision model, running on my Mac from Lunar Laya . So I asked a direct question: can the same SQL run on a local model, inside DuckDB, with no network at all? The result is duckdb-jev-spatial . It is a native DuckDB extension, written in Rust, that registers seven Jev functions. Laya Rust and ONNX Runtime run the model inside the DuckDB process. The DuckDB spatial extension does the geometry. In this post, I show how the pieces fit together, what the NorthSea data shows, and where the model is wrong. Two kinds of conditions A model that reads one well row cannot find the pipelin...