Inference runs a trained property-prediction model on your molecules. Today the model family is MPNN (message-passing neural networks, Chemprop-style). You can use:
- Public models that CogniChem provides: list them with List public MPNN models.
- Your own models, trained on your data with the MPNN Models training job (
train-mpnn): list them with List your MPNN models. Each plan allows a set number of custom models; see Plans and limits. The guide Train an MPNN model walks through both steps.
Like utilities, inference is not charged to your wallet. Each molecule counts toward your plan's monthly inference allowance, and at the limit submits return 403.
Run a prediction
Submit an inference request with model_type, model_name, and a payload (set is_public_model to true for a public model; leave it false for one you trained), then poll Get inference status and read Get an inference result. Submit a batch of inference requests sends several requests at once.
from cognichem_client import CogniChem
client = CogniChem.from_env()
print(client.inference.models.mpnn.public()) # pick a model_name
result = client.inference.run(
"mpnn",
"MODEL_NAME",
{"input_data": ["CCO", "c1ccccc1O"], "input_format": "smiles", "is_public_model": True},
)
print(result.data)Payload
mpnn Property prediction with a trained MPNN (Chemprop-style) model: a public model or one you trained with the train-mpnn job.
| Field | Type | Description |
|---|---|---|
input_data[]required | string[] | Limits: |
input_formatrequired | string | One of: |
is_public_model | boolean | True for a public model name from list_inference_models; false for your own trained model. Default: |
return_contributions | boolean | Return per-atom contributions (larger result). Default: |
return_coordinates | boolean | Return atom coordinates (larger result). Default: |
generate_3d | boolean | Embed 3D coordinates during preprocessing. Defaults to the model's training-time setting. |
add_hydrogens | boolean | Add explicit hydrogens. Defaults to the model's training-time setting; a different value is rejected. |
remove_hydrogens | boolean | Remove explicit hydrogens. Defaults to the model's training-time setting; a different value is rejected. |
batch_size | integer | Default: |