Python client and CLI for the FastFold Jobs API.
From the project root:
pip install .Or for development:
pip install -e .Requires Python 3.8+.
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.
from fastfold import Client
client = Client() # Reads FASTFOLD_API_KEY from env by default
response = client.fold.create(
sequence="LLGDFFRKSKEKIGKEFKRIVQRIKDFLRNLVPRTES",
model="boltz-2",
)
print(response.id) # jobIdAdvanced options:
job = client.fold.create(
sequence="...",
model="boltz-2",
name="My Job",
from_id=None, # maps to ?from=<uuid>
params={"recyclingSteps": 3}, # merged into params
constraints={
"pocket": [
{
"binder": {"chain_id": "A"},
"contacts": [{"chain_id": "B", "res_idx": 10}],
}
]
},
)Submit a folding job:
fastfold fold --sequence "LLGDFFRKSKEKIGKEFKRIVQRIKDFLRNLVPRTES" --model boltz-2Optional flags:
fastfold fold \
--sequence "..." \
--model boltz-2 \
--name "My Job" \
--api-key "sk-..." \
--base-url "https://api.fastfold.ai"On success the CLI prints the created job ID to stdout.
Client(api_key: Optional[str] = None, base_url: Optional[str] = None, timeout: float = 30.0)- Reads
FASTFOLD_API_KEYifapi_keyis not provided.
- Reads
Client.fold.create(sequence: str, model: str, name: Optional[str] = None, from_id: Optional[str] = None, params: Optional[dict] = None, constraints: Optional[dict] = None) -> Job- Returns a
Jobobject withid,run_id,name,status,sequence_ids, andraw.
- Returns a