API Reference#
OpenAPI Schema#
The OpenAPI specification details the following endpoints:
/v1/inferInference endpoint for molecular dynamics simulations/v1/health/liveHealth liveliness endpoint/v1/health/readyHealth readiness endpoint/v1/statusSystem status monitoring endpoint
Endpoints#
POST /v1/infer#
Run a molecular dynamics simulation on a single atomic structure.
Request Body:
The request body contains the following fields:
Field |
Type |
Required |
Description |
|---|---|---|---|
|
object |
Yes |
Atomic structure for the simulation |
|
object |
No |
MD simulation configuration (uses defaults if not provided) |
|
string |
No |
Optional metadata to echo back |
BMDAtomicData Fields (atoms):
The following table lists the atoms field parameters (BMDAtomicData):
Field |
Type |
Required |
Description |
|---|---|---|---|
|
array[float] |
Yes |
Flattened coordinates [x1,y1,z1,x2,y2,z2,…] in Angstrom |
|
array[int] |
Yes |
Atomic numbers |
|
array[float] |
No |
Unit cell (9 elements, row-major) in Angstrom |
|
array[bool] |
No |
Periodic boundary conditions [x,y,z], default [true,true,true] |
|
int |
No |
System charge, default 0 |
|
int |
No |
Spin multiplicity (2S+1), default 1 |
|
array[float] |
No |
Atomic masses in amu (uses standard if not provided) |
|
array[float] |
No |
Initial velocities [vx1,vy1,vz1,…] in Å/fs (Maxwell-Boltzmann if not provided) |
MDConfig Fields (config):
The following table lists the config field parameters (MDConfig):
Field |
Type |
Default |
Description |
|---|---|---|---|
|
float |
300.0 |
Target temperature in K |
|
float |
1.0 |
Timestep in fs |
|
bool |
true |
Enable NVT ensemble |
|
float |
1.0 |
Langevin friction in ps^-1 |
|
bool |
false |
Enable NPT ensemble |
|
float |
0.0 |
Target pressure in kBar |
|
bool |
false |
Enable anisotropic barostat |
|
int |
25 |
Barostat update frequency |
|
float |
0.5 |
Shear move probability |
|
float |
0.01 |
Max shear magnitude |
|
float |
0.01 |
Max diagonal change |
|
float |
0.001 |
Max log-scale move |
|
float |
0.0 |
Starting time in ps (for restart) |
|
float |
10.0 |
Max simulation time in ps |
|
int |
100 |
Save every N steps |
|
int |
0 |
Starting step (for restart) |
|
array[float] |
[0,0,0] |
Electric field [Ex,Ey,Ez] in μV/Å |
Response:
The response contains the following fields:
Field |
Type |
Description |
|---|---|---|
|
array |
List of trajectory snapshots |
|
object |
Final MDConfig state (updated istep/md_time) |
|
string |
Status message (“Success” or error) |
|
string |
Echoed metadata from request |
BMDSnapshot Fields (trajectory items):
The following table lists the trajectory items (BMDSnapshot):
Field |
Type |
Description |
|---|---|---|
|
array[float] |
Atomic coordinates in Angstrom |
|
array[float] |
Atomic velocities in Å/fs |
|
float |
Potential energy in eV |
|
array[float] |
Unit cell (if periodic) |
|
array[float] |
Stress tensor in kBar (if periodic) |
|
array[float] |
Partial charges (if available) |
|
int |
Step number |
|
float |
Simulation time in ps |
GET /v1/health/ready#
Check if the NIM is ready to accept inference requests.
Response:
{
"status": "ready",
"backends_alive": 2,
"backends_total": 2
}
GET /v1/health/live#
Check if the Triton server is live.
Response:
{
"status": "live"
}
GET /v1/status#
Get detailed system status including worker metrics.
Response:
{
"total": {
"tasks_received": 100,
"tasks_completed": 95,
"queue_size_atoms": 1024,
"queue_size_tasks": 5,
"requests_received": 50,
"requests_completed": 48,
"requests_in_progress": 2,
"max_system_size": 36876
},
"workers": [
{
"device": "cuda:0",
"tasks_received": 50,
"tasks_completed": 48,
"queue_size_atoms": 512,
"queue_size_tasks": 2,
"batch_size": 36876,
"max_batch_size": 47136,
"gpu_model": "NVIDIA H100 80GB HBM3"
}
]
}
Error Responses#
The API returns the following error responses:
HTTP Status |
Meaning |
When |
|---|---|---|
200 |
Success |
Request completed. Check |
400 |
Bad Request |
Malformed JSON or missing required fields. |
422 |
Validation Error |
Invalid field types or values (for example, mismatched |
500 |
Internal Server Error |
Unexpected server failure or GPU out-of-memory (OOM) error. |
503 |
Service Unavailable |
NIM not ready (still estimating batch sizes at startup). |
Error Response Schema (422):
{
"detail": [
{
"loc": ["body", "atoms", "coord"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Timeout and Memory Behavior#
Requests with systems exceeding
max_system_size(check by usingGET /v1/status) might return 500 with an OOM error.There is no built-in server-side request timeout. Use client-side timeouts for long simulations.
Long trajectories (large
md_time_max) increase response time proportionally. Consider breaking long simulations into restart chunks.
Example Requests#
The following sections show how to use the API to start a simulation.
Basic NVT Simulation#
Start this simulation by running the following command:
curl -X 'POST' \
'http://localhost:8000/v1/infer' \
-H 'Content-Type: application/json' \
-d '{
"atoms": {
"coord": [0.0, 0.0, 0.0, 0.0, 0.0, 1.5],
"numbers": [1, 1],
"cell": [10, 0, 0, 0, 10, 0, 0, 0, 10],
"pbc": [true, true, true]
},
"config": {
"temperature": 300.0,
"dt": 1.0,
"md_time_max": 0.1,
"nvt": true,
"save_interval": 10
}
}'
NPT Simulation With Pressure Control#
Start this simulation by running the following command:
curl -X 'POST' \
'http://localhost:8000/v1/infer' \
-H 'Content-Type: application/json' \
-d '{
"atoms": {
"coord": [0.0, 0.0, 0.0, 0.0, 0.0, 1.5],
"numbers": [1, 1],
"cell": [10, 0, 0, 0, 10, 0, 0, 0, 10],
"pbc": [true, true, true]
},
"config": {
"temperature": 300.0,
"dt": 1.0,
"md_time_max": 1.0,
"nvt": true,
"npt": true,
"pressure": 1.0,
"barostat_every": 25,
"save_interval": 100
}
}'
NVE Simulation (Constant Energy)#
Start this simulation by running the following command:
curl -X 'POST' \
'http://localhost:8000/v1/infer' \
-H 'Content-Type: application/json' \
-d '{
"atoms": {
"coord": [0.0, 0.0, 0.0, 0.0, 0.0, 1.5],
"numbers": [1, 1],
"cell": [10, 0, 0, 0, 10, 0, 0, 0, 10],
"pbc": [true, true, true],
"velocity": [0.0, 0.0, 0.01, 0.0, 0.0, -0.01]
},
"config": {
"nvt": false,
"npt": false,
"dt": 0.5,
"md_time_max": 1.0,
"save_interval": 10
}
}'
Restart From a Previous State#
Start this simulation by running the following command:
curl -X 'POST' \
'http://localhost:8000/v1/infer' \
-H 'Content-Type: application/json' \
-d '{
"atoms": {
"coord": [0.0, 0.0, 0.0, 0.0, 0.0, 1.52],
"numbers": [1, 1],
"cell": [10, 0, 0, 0, 10, 0, 0, 0, 10],
"pbc": [true, true, true],
"velocity": [0.001, 0.002, 0.003, -0.001, -0.002, -0.003]
},
"config": {
"temperature": 300.0,
"nvt": true,
"dt": 1.0,
"istep": 100,
"md_time": 0.1,
"md_time_max": 0.2,
"save_interval": 10
}
}'