Skip to content
cccskills
FreePublished on GitHub

alphafold3

Submit protein folding tasks to the AlphaFold3 C550 inference platform. Use when the user needs to run AlphaFold3 predictions with pre-prepared JSON input files on the AI4S Kubernetes cluster.

The English summary is being prepared. Showing the original description.

Works withKubernetes
See how to install

Files included (3)

  • SKILL.md8.0 KB
  • scripts/alphafold3_submit.sh15.2 KB
  • skill.json761 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

AlphaFold3 C550 Inference Platform

Submit, monitor, and download AlphaFold3 protein structure predictions on the C550 inference cluster.

Always distinguish three states in reports: (1) task submission accepted, (2) AF3 inference reached a terminal state, and (3) CIF coordinates were retrieved and analyzed. A queued or running task is not molecular evidence, and a completed task without CIF retrieval is execution-level evidence only.

Quick Start

# 1. Auto-generate input from a simple sequence
bash .codex/skills/alphafold3/scripts/alphafold3_submit.sh \
  --sequence "MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLVLRLRGG" \
  --name "My_Protein" \
  --output-dir ./outputs/alphafold3/my_run

# 0. Preflight control-plane and data-plane readiness before evidence runs
bash .codex/skills/alphafold3/scripts/alphafold3_submit.sh --preflight

# 2. Or use a pre-prepared JSON file
bash .codex/skills/alphafold3/scripts/alphafold3_submit.sh \
  --json-input ./my_input.json \
  --output-dir ./outputs/alphafold3/my_run

# 3. Or submit a PVC directory that already contains AF3 JSON files
bash .codex/skills/alphafold3/scripts/alphafold3_submit.sh \
  --input-dir /data/input/my_batch \
  --output-dir ./outputs/alphafold3/my_run

# 4. Or submit one JSON file that is already present on the PVC
bash .codex/skills/alphafold3/scripts/alphafold3_submit.sh \
  --remote-json /data/input/my_batch/my_input.json \
  --output-dir ./outputs/alphafold3/my_run

The script handles upload → submit → poll → download automatically for local JSON/sequence inputs. With --input-dir, it skips upload and submits the existing PVC directory directly through the HTTP control plane. With --remote-json, it submits one existing PVC JSON file through the HTTP control plane and avoids whole-directory failure when another JSON in the directory is invalid.

Input Format

Minimal working AlphaFold3 JSON:

{
  "name": "My_Protein",
  "dialect": "alphafold3",
  "version": 1,
  "modelSeeds": [1],
  "sequences": [
    {
      "protein": {
        "id": "A",
        "sequence": "MQIFVKTLTG...",
        "unpairedMsa": "",
        "pairedMsa": "",
        "templates": []
      }
    }
  ]
}

Critical: Every protein block must include unpairedMsa, pairedMsa (can be empty strings), and templates (can be empty array). Omitting them causes ValueError: missing unpaired MSA.

For multi-chain complexes, add multiple entries in sequences with distinct id values (e.g. "A", "B").

Endpoints

EndpointURL
Authhttp://10.12.111.135:10008/api/v1/auth/login
Taskshttp://10.12.111.135:10010/v1/scimodel/tasks
Userai4s-discovery
Headerx-original-model: alphafold3 (ALL requests)

Script Options

--sequence SEQ    Auto-generate AF3 JSON from a single protein sequence
--name NAME       Job name (required with --sequence, default: "Fold")
--json-input F    Upload and submit a pre-prepared JSON file
--input-dir DIR   Shared PVC path already containing JSON files
--remote-json F   Single shared PVC JSON file already present on the cluster
--json-path F     Alias for --remote-json
--output-dir DIR  Local directory for downloaded .cif results
--max-wait N      Max poll iterations, each 60s (default: 90 = 1.5h)
--model-dir DIR   Model weights dir on pod (default: /opt/weights)
--kubeconfig F    Optional kubeconfig path for kubectl upload/download
--preflight        Print redacted AF3 HTTP/kubectl readiness TSV and exit
--help            Show help

C550 API nuance: the server-side input_json field is path-like on this deployment; do not use it to send raw JSON content. Inline raw JSON is interpreted as a filename and can fail with Errno 36 File name too long. Use --remote-json /data/input/.../file.json for a single pre-staged PVC JSON file, --input-dir for a validated pre-staged PVC directory, or --json-input/--json to upload a local file through kubectl.

When capturing logs with tee, use set -o pipefail in the caller shell. Otherwise a failed upload/download can be hidden by the successful tee process:

set -o pipefail
bash .codex/skills/alphafold3/scripts/alphafold3_submit.sh \
  --json-input ./my_input.json \
  --output-dir ./outputs/alphafold3/my_run 2>&1 | tee ./outputs/alphafold3/my_run.log

Manual API (Advanced)

Authenticate

TOKEN=$(curl -s -X POST http://10.12.111.135:10008/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"ai4s-discovery","password":"'"$ALPHAFOLD3_PASSWORD"'"}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")

Submit

TASK_ID=$(curl -s -X POST http://10.12.111.135:10010/v1/scimodel/tasks \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-original-model: alphafold3" \
  -H "Content-Type: application/json" \
  -d '{"task_type":"fold","inputs":{"input_dir":"/data/input/my_batch","model_dir":"/opt/weights"}}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['task_id'])")

For a single pre-staged JSON file:

TASK_ID=$(curl -s -X POST http://10.12.111.135:10010/v1/scimodel/tasks \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-original-model: alphafold3" \
  -H "Content-Type: application/json" \
  -d '{"task_type":"fold","inputs":{"input_json":"/data/input/my_batch/my_input.json","model_dir":"/opt/weights"}}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['task_id'])")

Poll

curl -s "http://10.12.111.135:10010/v1/scimodel/tasks/$TASK_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "x-original-model: alphafold3"

Download

POD=$(kubectl -n studio-ams get pods -l app=alphafold3 -o jsonpath='{.items[0].metadata.name}')
kubectl -n studio-ams cp $POD:/data/scimodel/muxi_alphafold3_server/alphafold3/output/$TASK_ID.cif ./$TASK_ID.cif

Output

Each task produces a single .cif file (mmCIF / ModelCIF format) with full 3D coordinates, chain info, and confidence scores. When downloading through kubectl, prefer the outputs.output_path returned by GET /v1/scimodel/tasks/{task_id}; observed C550 paths can be either /output/{task_id}.cif or /data/scimodel/muxi_alphafold3_server/alphafold3/output/{task_id}.cif.

head -30 ./outputs/my_run/*.cif    # Quick preview

Compatible with PyMOL, ChimeraX, or Biopython MMCIFParser.

Troubleshooting

"missing unpaired MSA" error

Your JSON protein block is missing required fields. Always include:

"unpairedMsa": "",
"pairedMsa": "",
"templates": []

kubectl cp fails

Use the actual pod name (not deploy/...):

POD=$(kubectl -n studio-ams get pods -l app=alphafold3 -o jsonpath='{.items[0].metadata.name}')
kubectl -n studio-ams cp $POD:/path/to/file ./local/

404 on API

Both GET and POST requests must include x-original-model: alphafold3.

Token expired

Tokens last ~1h. The script auto-refreshes every 10 polls. For manual calls:

TOKEN=$(curl -s -X POST http://10.12.111.135:10008/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"ai4s-discovery","password":"'"$ALPHAFOLD3_PASSWORD"'"}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")

Important

  • All API requests need x-original-model: alphafold3 header.
  • Outputs at /data/scimodel/muxi_alphafold3_server/alphafold3/output/ on the pod.
  • Completed task metadata can contain an output path even when the CIF is not downloadable through HTTP; coordinate-level analysis still requires retrieving the .cif.
  • Token expires ~1h; auto-refreshed when using the script.
  • Space task submissions by ≥5s to avoid auth race conditions.
  • kubectl cp needs the actual pod name; use the label selector pattern.

Resources

  • scripts/alphafold3_submit.sh: End-to-end submit, poll, and download script with auto-input generation.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a CONTEXT.md, or recording or editing an ADR.

The English summary is being prepared. Showing the original description.

AGI4Sci/SciForge83Updated Sep 3, 2026

A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

The English summary is being prepared. Showing the original description.

AGI4Sci/SciForge83Updated Sep 3, 2026

Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

The English summary is being prepared. Showing the original description.

AGI4Sci/SciForge83Updated Sep 3, 2026

mineru

Free

Parse PDFs, Office files, images, and HTML into Markdown/structured outputs with MinerU. Use when SciForge or Codex needs document parsing/OCR for scientific papers, supplementary files, PDFs, scanned documents, tables, formulas, or URL/local-file parsing through MinerU standard or Agent lightweight APIs.

The English summary is being prepared. Showing the original description.

AGI4Sci/SciForge83Updated Sep 3, 2026

Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.

The English summary is being prepared. Showing the original description.

AGI4Sci/SciForge83Updated Sep 3, 2026

Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.

The English summary is being prepared. Showing the original description.

AGI4Sci/SciForge83Updated Sep 3, 2026

See all skills by AGI4Sci

Report a problem with this skill