Official Python SDK and CLI for the Fastfold API
Project description
Fastfold SDK
Python SDK and CLI for Fastfold jobs, workflows, library operations, and reports.
Installation
Install from PyPI:
pip install fastfold-ai
Or for development:
pip install -e .
Requires Python 3.8+.
Authentication
Set your API key in the environment:
export FASTFOLD_API_KEY="sk-...your-api-key"
You can also pass an API key when creating the client or via the CLI flag --api-key.
SDK Usage
The SDK exposes both typed helpers and capability-oriented services:
client.foldfor the simplest fold-job flowclient.jobsfor raw payloads, YAML submission, polling, and rendering helpersclient.workflowsfor generic workflow create/get/status/task-results/execute/YAML APIsclient.libraryfor library item creation and file uploadsclient.openmm,client.openmmdl,client.evolla, andclient.boltzgenfor the most common multi-step workflow flowsclient.reportsfor Slack markdown report submission
For end-to-end walkthroughs, downloadable input files, and additional variants, see:
Fold job
Create a fold job, wait for completion, then inspect the returned artifacts:
from fastfold import Client
client = Client()
job = client.fold.create(
sequence="LLGDFFRKSKEKIGKEFKRIVQRIKDFLRNLVPRTES",
model="boltz-2",
is_public=True,
)
results = client.jobs.wait_for_completion(job.id, poll_interval=5.0, timeout=900.0)
print(results.job.status)
print(results.cif_url())
print(results.metrics().mean_PLDDT)
print(results.get_viewer_link())
OpenMM first run from local files
Submit an OpenMM workflow from a local structure file and its matching PAE JSON:
from fastfold import Client
client = Client()
workflow = client.openmm.submit_from_manual_files(
pdb_path="./protein.pdb",
pae_path="./pae.json",
simulation_name="AF-P00698",
residue_profile="calvados3",
temp=293.15,
ionic=0.15,
ph=7.5,
step_size_ns=0.01,
sim_length_ns=10.0,
box_length=50,
)
print(workflow.workflow_id)
OpenMMDL from local files
Submit an OpenMMDL workflow from local topology and ligand files:
from fastfold import Client
client = Client()
workflow = client.openmmdl.submit_from_local_files(
topology_path="./KEAP1kd.pdb",
ligand_paths=["./IQK.sdf"],
simulation_name="KEAP1 + IQK",
input_json={
"smallMoleculeMode": "single",
"equilibration": "only_minimization",
"sim_length_ns": 0.05,
"step_time_ps": 0.002,
"failure_retries": 0,
"addWater": False,
"addMembrane": False,
"boxType": "geometry",
"geomPadding": 1.0,
"geometryDropdown": "cube",
"membranePadding": 2.0,
"writeDCD": True,
"dcdFrames": 5,
"pdbInterval_ns": 0.05,
"writeData": False,
"writeCheckpoint": False,
},
)
print(workflow.workflow_id)
Evolla from a local structure file
Upload a .cif / .mmcif / .pdb to your library and start Evolla in one call:
from fastfold import Client
client = Client()
workflow = client.evolla.submit_from_local_file(
"./structure.cif",
"What is the likely function of this domain?",
)
print(workflow.workflow_id)
Evolla from a completed fold job
Ask a natural-language question about a structure from an existing fold (uses the same workflow_input shape as the web app: sourceType / targetSource sequence, artifact URL, and ids):
from fastfold import Client
client = Client()
workflow = client.evolla.submit_from_fold_job(
"YOUR_JOB_ID",
"What is the likely function of this domain?",
)
print(workflow.workflow_id)
If the CIF URL in job results is not a signed path that embeds your user id, pass source_user_id="..." or set FASTFOLD_EVOLLA_SOURCE_USER_ID. See Evolla.
BoltzGen minimal workflow
Create a draft BoltzGen workflow, upload a minimal workflow.yml, and execute it:
from pathlib import Path
from fastfold import Client
client = Client()
draft = client.boltzgen.create_draft(name="boltzgen_demo")
client.boltzgen.upsert_workflow_yml(
draft.workflow_id,
Path("fastfold/examples/boltzgen/minimal.workflow.yml").read_text(),
)
client.boltzgen.execute(draft.workflow_id)
print(draft.workflow_id)
For preset bundles, downloadable design-spec files, and multi-spec examples, see BoltzGen.
Slack report sharing
Send a markdown report and optionally persist it as a library item:
from fastfold import Client
client = Client()
result = client.reports.send_agent_cli_report(
"## Demo Report\n\n- Workflow completed.\n- Artifacts are ready.",
report_name="demo_report",
)
print(result.ok, result.library_item_id)
CLI Usage
The CLI keeps fastfold-cli fold working, but it now also exposes resource-oriented subcommands.
For the complete command matrix, see CLI.
# Fold job
fastfold-cli fold --sequence "LLGDFFRKSKEKIGKEFKRIVQRIKDFLRNLVPRTES" --model boltz-2
# OpenMM first run from local files
fastfold-cli workflows openmm from-manual-files \
--pdb ./protein.pdb \
--pae ./pae.json \
--simulation-name AF-P00698 \
--force-field calvados3 \
--temperature 293.15 \
--ionic 0.15 \
--ph 7.5 \
--step-size-ns 0.01 \
--sim-length-ns 10 \
--box-length 50
# OpenMMDL from local files
fastfold-cli workflows openmmdl from-local-files \
--topology ./KEAP1kd.pdb \
--ligand ./IQK.sdf \
--simulation-name "KEAP1 + IQK" \
--input-json fastfold/examples/openmmdl/workflow_input.json
# Evolla from a local structure
fastfold-cli workflows evolla from-file ./structure.cif --question "What is the function of this protein?"
# Evolla from fold results
fastfold-cli workflows evolla from-fold-job YOUR_JOB_ID --question "What is the function of this protein?"
# BoltzGen draft
fastfold-cli workflows boltzgen create-draft --name demo
# Report sharing
fastfold-cli reports slack --markdown-file fastfold/examples/reports/sample_report.md
Most create and inspection commands are script-friendly: they print IDs by default, or full JSON with --json.
Packaged Examples
Small, reusable text assets ship under fastfold/examples/:
fastfold/examples/fold/job_payload.jsonfastfold/examples/openmm/from_manual_files.jsonfastfold/examples/openmm/from_fold_job.jsonfastfold/examples/openmmdl/workflow_input.jsonfastfold/examples/openmmdl/from_local_files.jsonfastfold/examples/openmmdl/quick_water_box.workflow_input.jsonfastfold/examples/openmmdl/quick_membrane.workflow_input.jsonfastfold/examples/evolla/from_fold_job.template.jsonfastfold/examples/boltzgen/minimal.workflow.ymlfastfold/examples/boltzgen/design_spec.example.yamlfastfold/examples/boltzgen/replacements.example.jsonfastfold/examples/fold/boltz2_affinity_input.yamlfastfold/examples/reports/sample_report.md
Larger reference bundles and downloadable preset files live in the docs:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastfold_ai-0.2.3.tar.gz.
File metadata
- Download URL: fastfold_ai-0.2.3.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c38cedaa34515604904bb8a37548b1b102bd96692649645b2c3f28f360ead3c6
|
|
| MD5 |
251c85610454a7143d3393892c68f3f2
|
|
| BLAKE2b-256 |
b338e51710ec7b257e00073eea6380fac91ec69e4cffa6488959dada0342855a
|
Provenance
The following attestation bundles were made for fastfold_ai-0.2.3.tar.gz:
Publisher:
python-publish.yml on fastfold-ai/fastfold-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastfold_ai-0.2.3.tar.gz -
Subject digest:
c38cedaa34515604904bb8a37548b1b102bd96692649645b2c3f28f360ead3c6 - Sigstore transparency entry: 1486962322
- Sigstore integration time:
-
Permalink:
fastfold-ai/fastfold-python@b01b31b56b4ebf724b40820c185e9bf1a4383e6a -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/fastfold-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b01b31b56b4ebf724b40820c185e9bf1a4383e6a -
Trigger Event:
release
-
Statement type:
File details
Details for the file fastfold_ai-0.2.3-py3-none-any.whl.
File metadata
- Download URL: fastfold_ai-0.2.3-py3-none-any.whl
- Upload date:
- Size: 37.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86aa8062f15692d13c732306dd2d12a8faca7c4a07c820caad63c1234d0e2532
|
|
| MD5 |
546fce403aeaf36128645e1010a87ced
|
|
| BLAKE2b-256 |
1de2735c850f24ac78a8158f145e37d1cc67209ff0114e4dd8fa9e380d621ff5
|
Provenance
The following attestation bundles were made for fastfold_ai-0.2.3-py3-none-any.whl:
Publisher:
python-publish.yml on fastfold-ai/fastfold-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fastfold_ai-0.2.3-py3-none-any.whl -
Subject digest:
86aa8062f15692d13c732306dd2d12a8faca7c4a07c820caad63c1234d0e2532 - Sigstore transparency entry: 1486962330
- Sigstore integration time:
-
Permalink:
fastfold-ai/fastfold-python@b01b31b56b4ebf724b40820c185e9bf1a4383e6a -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/fastfold-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b01b31b56b4ebf724b40820c185e9bf1a4383e6a -
Trigger Event:
release
-
Statement type: