Documentation · First model · Worked examples · Discussions
Bilt is a Python framework for scientific and engineering models built from equations and reusable systems. Describe how quantities relate, supply what you know, and ask for the value you need. Bilt determines a supported calculation instead of requiring a fixed sequence of computations.
Bilt requires Python 3.15 or newer and uv. Released wheels are available from the Bilt package index once the release build has completed. No Rust toolchain is needed for a supported platform:
uv init --python 3.15 my-bilt-project
cd my-bilt-project
uv add bilt --index bilt=https://bilt-framework.github.io/bilt/packages/ --no-build-package biltThe index targets Linux x86-64 (glibc 2.28+), macOS (Apple Silicon and Intel) and Windows x86-64. It serves stable releases only. For unreleased changes or an unsupported platform, install from GitHub with a Rust toolchain:
uv add "git+https://github.com/bilt-framework/bilt.git"If your existing project uses Bilt from its previous GitHub location, run the appropriate uv add command above to update the dependency source. The named index keeps Bilt tied to its own package source rather than a similarly named package on PyPI.
Replace main.py with this model:
from bilt import Implementation, Interface, equation, field, system
@system
class Converter(metaclass=Interface):
energy_in: float = field()
energy_out: float = field()
efficiency: float = field()
@equation
def energy_balance(energy_in: float, energy_out: float, efficiency: float) -> bool:
return energy_out == energy_in * efficiency
model = Implementation(Converter, [energy_balance])
with model:
print(Converter(energy_in=100.0, efficiency=0.4).energy_out) # 40.0
print(Converter(energy_out=40.0, efficiency=0.4).energy_in) # 100.0Run it with uv run python main.py. Both requests use the same equation; only the known values and the requested output change.
Build your first model step by step
The same relationships can be used for forward calculations, inverse questions or parameter identification where supported. You do not need to write a separate function for each direction.
Equations and acausal modelling
Build larger models from reusable systems. Bilt can solve supported coupled linear equations across subsystem boundaries without requiring you to flatten the model or assemble the matrix yourself.
Two springs in series · Coupled systems
Declare physical dimensions on model fields. Bilt checks equation dimensions and converts compatible units during evaluation.
Units in models · Quantity annotations
Supply values over named dimensions such as samples, scenarios and routes. Bilt aligns and broadcasts those dimensions, allowing the same relationships to be evaluated across many cases. Propagating samples is not the same as fitting a statistical model or estimating a Bayesian posterior.
Battery-electric mission uncertainty analysis
Bilt also supports directed transforms, conditional equations, Python and JAX execution backends, and a bilt check . command for model definitions.
- First model — a guided introduction, from a system to forward and inverse evaluation.
- User guide — systems, equations, units, tensors, backends and model composition.
- Worked examples — two springs, a two-shaft gas turbine, mission uncertainty and JAX.
- API reference — signatures, supported operations and limitations.
- Model checking — validate model definitions locally or in CI.
Bilt is developed at the Aviation Impact Accelerator, University of Cambridge and remains under active development. The API may change. Not every equation can be rearranged; coupled blocks currently need to be linear in the unknowns solved together. General nonlinear coupled solving and statistical calibration are not yet supported.
To contribute:
git clone https://github.com/bilt-framework/bilt.git
cd bilt
uv syncFor an existing checkout, update the remote with git remote set-url origin https://github.com/bilt-framework/bilt.git.
Questions and suggestions are welcome in issues and discussions.
Bilt provides optional coding-assistant skills: bilt for users and bilt-development for contributors. Install the user skill with npx skills add bilt-framework/bilt --skill bilt. Skills provide instructions for assistants; they do not install the Python package.
The README figures are generated from scripts/readme_figures.json with scripts/generate_readme_svgs.py. Run python scripts/generate_readme_svgs.py --check to verify them.
Maintained by James Emberton and Sam Brockie. MIT license.