Deep Safety
Deep Safety is a physics-based process safety platform for verifiable consequence analysis, hazard evaluation, and software integration.
Documentation site: deepsafety.tech
It gives teams one model contract that can be used across:
- Python notebooks
- FastAPI services
- GitHub Pages browser-local workflows
- MCP and agent tooling
- Docker deployments
Deep Safety keeps the physics explicit and reusable so decision systems can rely on a consistent chain for source terms, dispersion, fire and explosion metrics, effects, and hazard-study workflows.
Quick Start
user@deepsafety.tech:~$ pip install deepsafety
Collecting deepsafety ...
Successfully installed deepsafety
user@deepsafety.tech:~$ deepsafety-api --host 0.0.0.0 --port 8000
Deep Safety API ready at http://0.0.0.0:8000 _
# Optional notebook stack
$ pip install "deepsafety[jupyter]"
Why Deep Safety
- Physics-first model chain: materials -> source -> dispersion/effects -> hazard evaluation
- Verifiable formulas: equations are documented and exposed in API metadata
- Transparent constants: physical meaning and source are documented
- Cross-platform integration: same model vocabulary in API, notebooks, app, and MCP tools
- Sensitivity-friendly design: constants can be overridden per request
- Product-ready deployment: package, Docker image, static site, and API are designed to be consumed directly by applications
Model Chain
- Materials and operating conditions define the basis.
- Scenario and source models calculate release rate, duration, and phase state.
- Dispersion, fire and explosion, and effect models compute consequence metrics.
- Hazard-evaluation workflows consume the same outputs in HAZOP, FMEA, and What-If studies.
Data Provenance
Starter registries are packaged as JSON data (not hard-coded in model logic):
deepsafety/data/materials_registry.jsondeepsafety/data/toxic_criteria_registry.jsondeepsafety/data/constants_registry.json
This keeps assumptions inspectable, versionable, and easier to govern.
Constants Override Example
Constants can be overridden request-by-request for sensitivity studies and controlled assumption audits.
{
"model_type": "jet_fire",
"inputs": {
"release_rate_kg_s": 2.5,
"heat_of_combustion_kj_kg": 46000,
"distance_m": 35
},
"constants": {
"fire.default_radiative_fraction": 0.4
}
}
from deepsafety import DeepSafetyClient
client = DeepSafetyClient("http://127.0.0.1:8000")
result = client.calculate(
"fire.point_source_heat_flux",
{
"distance_m": 35,
"burning_rate_kg_s": 2.5,
"heat_of_combustion_kj_kg": 46000,
},
constants={"fire.default_radiative_fraction": 0.4},
)
API Surface
Core service and metadata:
GET /modelsGET /models/{model_id}POST /models/{model_id}/calculateGET /constantsGET /constants/{model_id}GET /service-catalog
Materials and health:
GET /materialsGET /materials/{materialId}GET /materials/{materialId}/toxicityGET /materials/{materialId}/flammabilityGET /materials/{materialId}/reactivityPOST /health/convert-concentrationPOST /health/probit/evaluatePOST /health/exposure/twaPOST /health/exposure/compliancePOST /industrial-hygiene/ventilation/dilutionPOST /industrial-hygiene/ventilation/local-exhaustPOST /industrial-hygiene/liquid-pool/evaporation
Scenario and source:
POST /scenario-engine/defineGET /scenario-library/templatesPOST /source-models/liquid-holePOST /source-models/tank-holePOST /source-models/liquid-pipePOST /source-models/gas-holePOST /source-models/gas-pipePOST /source-models/flashing-liquidPOST /source-models/scenario/selectPOST /source-models/conservative-analysisPOST /source-models/solve
Dispersion, fire/explosion, effects:
POST /dispersion/gaussian-plumePOST /dispersion/gaussian-puffPOST /dispersion/dense-gasPOST /dispersion/isoplethPOST /dispersion/toxic-endpoints/evaluatePOST /dispersion/prevention-mitigationPOST /dispersion-models/solvePOST /fire-explosion/flammability/mixturePOST /fire-explosion/locPOST /fire-explosion/ignition-energyPOST /fire-explosion/tnt-equivalencyPOST /fire-explosion/multi-energyPOST /fire-explosion/vcePOST /fire-explosion/blevePOST /fire-explosion-models/solvePOST /effect-models/solvePOST /toxic-criteria/lookup
Prevention, reactivity, relief, hazard evaluation:
POST /prevention/inerting/purgePOST /prevention/static-electricity/riskPOST /prevention/area-classificationPOST /prevention/fire-protection/strategyPOST /reactivity/calorimetry/interpretPOST /reactivity/screeningPOST /reactivity/controlPOST /relief/devices/selectPOST /relief/system/analyzePOST /relief/effluent-handling/selectPOST /relief/sizing/liquidPOST /relief/sizing/gas-vaporPOST /relief/sizing/two-phasePOST /relief/sizing/deflagration-ventPOST /relief/sizing/external-firePOST /relief/sizing/thermal-expansionPOST /hazard-evaluation/checklistPOST /hazard-evaluation/safety-reviewPOST /hazard-evaluation/inherent-safety-reviewPOST /hazard-evaluation/preliminary-hazard-analysisPOST /hazard-evaluation/relative-rankingPOST /hazard-evaluation/hazopPOST /hazard-evaluation/fmeaPOST /hazard-evaluation/what-ifPOST /hazard-evaluation/what-if-checklistPOST /hazard-evaluation/information-requirements/validatePOST /prevention-response-models/solve
GIS, visualization, and sign analysis:
POST /visualization/solvePOST /signs/analyzeGET /gis/pipeline-routesPOST /gis/pipeline-routesGET /gis/pipeline-routes/{route_id}POST /gis/scenarios/evaluatePOST /gis/impact-zonesPOST /gis/pipeline-routes/{route_id}/evaluatePOST /gis/pipeline-routes/{route_id}/impact-zones
GitHub Pages Structure
docs/index.html-> documentation landing pagedocs/api-docs.html-> endpoint and formula referencedocs/tutorials.html-> guided training and incident walkthroughsdocs/use-cases.html-> interactive/app + notebook entry pointsdocs/app.html-> interactive map app (with consequence rings)docs/readme.html-> web copy of this README
The public documentation surface is published at deepsafety.tech.
Notebook Entry Points
notebooks/all_endpoints_tutorial_workbook.ipynbnotebooks/deepsafety_explorer.ipynbnotebooks/buncefield_tutorial.ipynbnotebooks/csb_incident_tutorial.ipynb
Runtime Options
# Local API
python -m uvicorn deepsafety.api:app --host 127.0.0.1 --port 8000
# Docker
docker build -t deepsafety .
docker run --rm -p 8000:8000 deepsafety
# Compose
docker compose up --build
CI/CD and PyPI Publishing
Deep Safety publishes through GitHub Actions:
CIworkflow:- runs tests
- builds
sdistandwheel - runs
twine checkon artifacts
Publish PyPIworkflow (.github/workflows/publish-pypi.yml):- triggers on tags matching
v*and on manual dispatch - reruns tests and package checks before publish
- publishes artifacts to PyPI
- triggers on tags matching
Required repository configuration:
- Add
PYPI_API_TOKENin GitHub secrets (repository orpypienvironment secret) - Optional fallback secret name:
PYPI_TOKEN - Optional org/repo-specific fallback:
DEEPSAFETYPYPI - Configure a
pypienvironment in GitHub if you want protected release approvals
Release flow:
git tag v1.0.2
git push origin v1.0.2
MCP
deepsafety-mcp exposes Deep Safety operations for tool-driven and agent-driven workflows against the same API model chain.
License
MIT
Metadata
Release files for deepsafety 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| deepsafety-1.0.2.tar.gz | 93.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deepsafety-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 186.0 kB
Release files / deepsafety-1.0.2.tar.gz
| Download URL | deepsafety-1.0.2.tar.gz |
|---|---|
| Size | 93.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e19c9a439f365e57591fd9b7d0ce2c63facbb8c871cd3cdd82b8b6917034e96e
|
|
BLAKE2b-256 checksum How to use checksums |
fa00a04250a89d3f6e91e37258c1328b13a1d4904b4eb793efcd1a6332fa6ce8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / deepsafety-1.0.2-py3-none-any.whl
| Download URL | deepsafety-1.0.2-py3-none-any.whl |
|---|---|
| Size | 93.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b1395c99b10e18f646d6c381945ea2d3fe3e34260f9a505ed1b11eccfebe6b4
|
|
BLAKE2b-256 checksum How to use checksums |
52971544d00ab5ff2f883b896ac7f1013affd372f4c302dfbd8f72bb216cd0b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for deepsafety 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.