Server Mode#
Long-running HTTP service for repeated energy/force requests. Useful with workflow managers and ORCA external optimization.
Commands#
Start server:
enerzyme listen -c server.yaml -m model_dir/ -o server_out/ -b 0.0.0.0:5000 -mc config.yaml
Client request:
enerzyme request -u http://127.0.0.1:5000 -f ORCA -i input.extinp.tmp -k FF02
Shutdown:
enerzyme kill -u http://127.0.0.1:5000
Implementation#
enerzyme/listen.py— Flask/Waitress, routePOST /calculateenerzyme/tasks/server.py— model forward passenerzyme/request.py— ORCA.extinp.tmp→.engradbridge
Request format#
JSON body (conceptual):
{
"model_key": "FF02",
"input_file": "/path/to/geometry",
"features": {
"Ra": [[...]],
"Za": [...],
"N": 100,
"Q": -1
}
}
Exact schema follows what Server.calculate expects for your model’s active features.
Response#
JSON with outputs (energy, forces, etc.) and units (Hartree_in_E, Bohr_in_R).
Multi-model serving#
listen loads all active: true models from config.yaml. Clients select via model_key (-k).
Server config#
No dedicated listen.yaml in the repository. A minimal config may only need:
Datahub:
preload: true
Model architecture and transforms come from -mc / model_dir/config.yaml.
Deployment notes#
Model load time is paid once at startup — amortize over many requests
Bind address
-bcontrols network exposureLogs go to
out_dirand waitress logger (wired to Enerzyme logger)For batch evaluation on static datasets, prefer
enerzyme predict