Docs
How to run Enthra yourself, read your own plant drawings, and call the engine.
How it fits together
Enthra is two parts:
- enthra, the web app (Next.js). It keeps plants, items, reviews and files in Postgres, and draws every screen.
- engine, a Python service (FastAPI). It reads drawings, builds the plant model, and runs the simulator, safety checks, design tools and live twin.
The web app talks to the engine over HTTP. Everything Enthra knows about a plant lives in one plant model: equipment, lines, valves, instruments, and what connects to what, following the DEXPI information model.
Run it on your computer
You need Node 20 or newer and Python 3.12 or newer. Start the engine:
git clone https://github.com/enthra-labs/engine cd engine python -m venv .venv .venv/bin/pip install -r requirements.txt .venv/bin/python -m uvicorn server:app --port 8320
Then the web app, in a second terminal:
git clone https://github.com/enthra-labs/enthra cd enthra npm install npm run dev
Open http://localhost:3320. The two demo plants load on first visit. The status bar at the bottom shows whether the engine is live. On Windows, use .venv\Scripts\ instead of .venv/bin/.
Read your own drawings
Reading needs an NVIDIA graphics card and the reader packages:
.venv/bin/pip install -r requirements-reader.txt
Click Read new drawings and upload the P&IDs as PDF or images. Add equipment data sheets too if you have them; they are matched to equipment by tag. Enthra finds every symbol, tag and line, follows lines across sheets, and builds the plant model.
The review screen colours each item by how sure the reader is. Confirm, fix, delete or add items. Every sheet you fix is saved as a practice page for retraining.
Want something to try it on? The example-plant repo has a full drawing set with the right answers.
Train the reader
The trained symbol finder is not in the repo (it is a 170 MB file). Make your own:
.venv/bin/python -m enthra.reader.synth --pages 1500 .venv/bin/python -m enthra.reader.detect train --iters 6000 .venv/bin/python -m enthra.reader.evaluate h2o2-demo
synth draws labelled practice sheets in the style of real P&IDs. detect train trains the symbol finder on them, about an hour on an RTX 4060. evaluate scores it against a demo plant. Once you have fixed sheets in the review screen, Retrain in the app adds them to the practice set.
Current score: 83% of all items right on both demo plants.
The tools
- Lists and exports. Equipment list, line list, instrument index, valve list and bill of materials, as Excel, CSV or PDF, and the whole plant as DEXPI XML.
- Search. Plain words like "pumps with no spare", with results shown on the drawings. Document lookup cites the page.
- Simulation. Flows, temperatures and pressures on every line, what-if questions, a bottleneck finder and an energy finder. Every assumption is listed.
- Change Manager. Upload a new revision of a sheet to see what changed and what it affects, and raise a change request.
- Safety Studio. A HAZOP draft, a relief valve check with the sums shown, a safeguard map and an action tracker.
- Design Studio. Change the plant by asking, copy and scale it, size equipment, estimate cost, compare options.
- Live Twin. Upload sensor history as CSV. Enthra matches tags to the drawings and finds fouling, stuck or drifting sensors, and upsets.
- Training. A training simulator on the plant's own drawing, with scenarios, scores and records.
Put it online
Both parts deploy to Vercel.
- Engine: import enthra-labs/engine. No settings needed. An online engine has no graphics card, so it can't read new drawings; everything else works.
- Web app: import enthra-labs/enthra. Add DATABASE_URL and ENGINE_URL. Files are kept in the database unless you add Cloudflare R2 keys.
Put both in the same region as the database, or every page waits on a long round trip.
Settings
The web app reads these from .env.local:
- DATABASE_URL: Postgres, for example Neon. Without it, an embedded Postgres is kept in .data/.
- R2_ACCOUNT_ID, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY, R2_BUCKET: Cloudflare R2 for drawings and documents.
- FILES_IN_DB: set to 1 to keep files in the database. Automatic on Vercel when R2 is not set.
- ENGINE_URL: where the engine runs. Defaults to http://127.0.0.1:8320.
Engine API
Every screen in Enthra is built on these endpoints. The online engine at https://enthra-engine.vercel.app answers all of them except reading. Try one:
curl https://enthra-engine.vercel.app/demo-plants
Status and demo plants
Reader
Needs the reader packages and an NVIDIA graphics card. The online engine answers /reader/status only.
Simulation
Every call takes the plant model as JSON: { "model": ... }.
Safety and design
Every call takes the plant model as JSON: { "model": ... }.