Skip to main content
Docs

Search guides and API endpoints, for example “Idempotency-Key” or “submit job”.

    Tools · Cheminformatics & Structure

    MolGen

    Generate novel, chemically valid analogs of a seed molecule with a SELFIES molecular language model
    On this page

    Prices, workflows, and method papersOpen in the app

    Run it from the API

    Submit with Submit a job and the job_type below. Price it first with Estimate job reservation cost: submitting reserves that amount from your wallet, and the charge settles at the actual runtime.

    MolGen molgen

    Job type
    molgen
    Hardware
    t4l4a10 (default)l40sa100-40gba100-80gbh100h200b200
    Typical runtime
    10 min on Nvidia A10

    Payload

    Payload fields
    FieldTypeDescription
    moderequiredstring

    Default: "generate"One of: "generate", "sample"

    input_data[](string | object)[]

    Limits: max items 1000

    input_formatstring

    Default: "smiles"One of: "smiles", "sdf", "molblock", "inchi"

    num_sequencesinteger

    Default: 10Limits: ≥ 1, ≤ 10000

    max_lengthinteger

    Default: 64Limits: ≥ 8, ≤ 128

    num_beamsinteger

    Default: 5Limits: ≥ 1, ≤ 10

    temperaturenumber

    Default: 1Limits: ≥ 0.1, ≤ 2

    top_pnumber

    Default: 0.95Limits: ≥ 0, ≤ 1

    top_kinteger

    Default: 0Limits: ≥ 0, ≤ 1000

    repetition_penaltynumber

    Default: 1Limits: ≥ 1, ≤ 2

    exclude_inputsboolean

    Default: false

    max_output_moleculesinteger

    Default: 1000Limits: ≥ 1, ≤ 10000

    Example

    from cognichem_client import CogniChem
    
    client = CogniChem.from_env()  # reads COGNICHEM_API_KEY
    payload = {
        "mode": "generate",
        "input_data": ["c1ccccc1"],
        "input_format": "smiles",
        "num_sequences": 4,
        "max_length": 64,
        "num_beams": 5,
        "temperature": 1,
        "top_p": 0.95,
        "top_k": 0,
        "repetition_penalty": 1,
        "exclude_inputs": True,
        "max_output_molecules": 1000,
    }
    
    estimate = client.jobs.estimate(job_type="molgen", payload=payload, resource="a10")
    print(f"Reserves ${estimate.cost:.2f}")
    
    job = client.jobs.submit(
        job_name="my-molgen-run",
        job_type="molgen",
        payload=payload,
        resource="a10",
    )
    status = client.jobs.wait(job.process_id)
    if status.status == "completed":
        client.jobs.result(job.process_id, save_path=".")

    Sample data from the job catalog; long values are shortened here. Each job_name must be unique among your jobs.

    Workflow inputs

    • Molecules (list) · optionalSMILES, SDF, MOLBLOCK, INCHI

    Workflow outputs

    • ArchiveZIP
    • TableCSV
    • MoleculesSMILES