chai-lab
Use Chai Lab / Chai-1 for molecular structure prediction, input preparation, MSA/template setup, restraints, glycans, and repo-specific troubleshooting.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- chai-lab
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use Chai Lab / Chai-1 for molecular structure prediction, input preparation, MSA/template setup, restraints, glycans, and repo-specific troubleshooting.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/repo-provenance.md2.8 KB
- 参考文档references/repo-routing-metadata.json327 B
- 参考文档references/troubleshooting.md3.4 KB
- 脚本scripts/check_chai_lab_environment.py4.6 KB
03 SKILL.md 正文
Chai Lab Repo Skill
Use this skill when a task mentions Chai Lab, Chai-1, chai_lab, chai-lab fold, molecular structure prediction, protein/ligand/DNA/RNA/glycan complexes, MSA/template setup, or Chai restraint files.
Start Here
- Check package availability with
scripts/check_chai_lab_environment.py --help, then run the checks that are safe for the target machine. - Read
references/troubleshooting.mdif install/import, CUDA, model download, network server, or output-directory failures are likely. - Read
references/repo-provenance.mdbefore refreshing this skill against a newer checkout. - Route to one focused sub-skill rather than trying to keep all Chai details in the root context.
Sub-Skill Routing
sub-skills/cli-inference/SKILL.md: run or templatechai-lab fold, callchai_lab.chai1.run_inference, inspectStructureCandidates, tune sample/recycle/device options, and debug inference runtime failures.sub-skills/input-data-formats/SKILL.md: author and validate Chai FASTA records for proteins, ligands, DNA, RNA, modified residues, glycan headers, entity names, and chain-name mode decisions.sub-skills/msa-templates/SKILL.md: prepare.aligned.pqtfiles, convert A3M to Chai MSA parquet, use ColabFold server flags, prepare template m8 inputs, and stage existing ColabFold outputs.sub-skills/restraints-glycans/SKILL.md: write and validate contact, pocket, covalent, and glycan restraint CSVs, including atom notation and chain-name consistency.
Common Public Setup
Chai Lab publishes the Python distribution chai_lab and import package chai_lab. Prefer a pinned public release when reproducibility matters:
pip install chai_lab==0.6.1
python - <<'PY'
import chai_lab
from chai_lab.chai1 import run_inference
print(chai_lab.__version__, run_inference)
PY
For unreleased changes, install from the public Git repository instead of mixing source files into a skill workflow:
pip install git+https://github.com/chaidiscovery/chai-lab.git
Chai-1 inference is intended for Linux, Python >=3.10, and a CUDA GPU with bfloat16 support. The package can be imported and many input validators can run without launching a fold, but practical folding should be treated as GPU-backed and potentially memory-intensive.
High-Level Workflows
- Basic CLI fold: validate the FASTA with
sub-skills/input-data-formats/scripts/validate_chai_fasta.py, choose a fresh output directory, then buildchai-lab fold input.fasta output_dirwith options fromsub-skills/cli-inference/SKILL.md. - Python inference: use
sub-skills/cli-inference/scripts/write_inference_template.pyto generate a safe script template, then add MSA/template/restraint options from sibling sub-skills. - MSA/template-backed fold: validate
.aligned.pqtfiles and template m8 inputs throughsub-skills/msa-templates/SKILL.mdbefore passing--msa-directory,--use-msa-server,--use-templates-server, or--template-hits-path. - Restrained fold: validate contact, pocket, covalent, and glycan CSVs through
sub-skills/restraints-glycans/SKILL.md, then pass the CSV asconstraint_pathor--constraint-path.
Shared Checks
Run the root helper for lightweight environment and backend visibility checks:
python scripts/check_chai_lab_environment.py --json
python scripts/check_chai_lab_environment.py --require-cuda --check-cli
This helper imports Chai Lab, checks the CLI, reports PyTorch/CUDA visibility when PyTorch is installed, and prints CHAI_DOWNLOADS_DIR status. It does not download model weights or run inference.
Important Boundaries
- Do not run full Chai inference as a cheap smoke test; use CLI
--help, parser validators, and tiny data-format checks first. - Do not tell future agents to open original repository examples, tests, or scripts. The useful details are distilled into this skill's references and bundled scripts.
- Keep local machine paths, private environment prefixes, cache paths, and artifact directories out of public instructions.
- Treat network-backed MSA/template generation and first-time model downloads as explicit side effects that may need user approval in restricted environments.
- When a repository checkout has changed, compare it with
references/repo-provenance.mdand refresh this skill instead of relying on stale API details.
Reference Map
references/troubleshooting.md: cross-cutting install/import, CUDA, download, output-directory, and network-service failure modes.references/repo-provenance.md: source snapshot and evidence paths used to create this skill.references/repo-routing-metadata.json: structured import metadata forrepo-skills-router.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).