pufferlib
できること
PufferLibは、ゲームやタスクを行うように人工知能(AI)を訓練するのに役立ちます。正しく動作するように、さまざまなソフトウェアのバージョンを管理します。
使う場面
- ✓新しいゲームのためにAIを訓練するとき。
- ✓異なる環境のバージョンに合わせてAIを適応させるとき。
- ✓AIの訓練の進捗を安全に確認するとき。
スキルのリンク
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pufferlib/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“PufferLBのバージョン3.0.0を使って、ゲームをプレイするAIを訓練するにはどうすればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
PufferLibはソフトウェアのバージョンを管理し、訓練環境とAIのポリシーが互換性を持つようにします。訓練を始める前に、これらの環境をテストし、検証するためのツールも提供します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
PufferLib
Choose the version before choosing an API. Reviewed 2026-10-01:
| Profile | Status | Main use |
|---|---|---|
Native source 5.0 |
Current default branch and live documentation | C/CUDA environments, native trainer; CPU evaluation only |
pufferlib==3.0.0 |
Latest PyPI release, published 2025-06-23; sdist only | Python/Gymnasium/PettingZoo adaptation and Torch PuffeRL |
Pinned source 4.0 |
Historical snapshot | C Ocean interface with an optional Torch fallback |
For 5.0, read references/native-5.md. The reviewed
revision is 6ffa5b10dbbbe4d1e8288367c7d9d3acd3bad4a2. Its CLI is
./puffer train after building an environment, not puffer train ENV_NAME.
There is no 5.0 Python emulation/vector API or --slowly fallback.
The bundled plan schema deliberately supports only 3.0 and pinned 4.0; it does
not launch training. All native/PufferLib training examples are source-reviewed,
illustrative, and not executed in this review. Bundled synthetic checks are
executed CPU tests, not evidence of PufferLib installation or learning quality.
The PyPI sdist was hash-verified and its Python sources inspected; the moving
3.0 branch differs, including its load_policy and logger contracts.
Safe defaults
- Start with bundled synthetic, CPU-only, network-free tools.
- Do not import an arbitrary environment by dotted path. Bundled tools accept only allowlisted built-ins and slug identifiers.
- Do not install or execute an unreviewed environment package, native extension, ROM, map, checkpoint, or pickle file.
- Verify official source, immutable revision, licenses, checksums or attestations, and build hooks. Sandbox native builds and first execution.
- Cap steps, environments, agents, workers, threads, buffers, memory, disk, render size, and wall time.
- Keep training and evaluation environments/seeds separate.
- Default logging to local/none. External logging requires explicit opt-in, disclosure acknowledgment, and separate artifact-upload approval.
- Never pass W&B or Neptune credentials via CLI, INI, JSON, tags, run names, or logger configuration. Never print them.
- Never dump all environment variables or recursively search for
.env. - Hash checkpoint bytes before trusted, sandboxed loading; metadata inspection is not proof of safety.
First local checks
All bundled CLIs are dependency-free and emit strict JSON:
python3 scripts/env_template.py --help
python3 scripts/env_contract_validator.py
python3 scripts/benchmark_vectorization.py --backend serial
python3 scripts/train_template.py
python3 scripts/validate_plan.py
python3 scripts/repro_plan.py
Defaults are synthetic, deterministic, bounded, local, CPU-only, no-network, and dry-run where training would otherwise occur.
Installation and provenance
Published 3.0.0
PyPI supplies only pufferlib-3.0.0.tar.gz:
sha256: 7df3a3e3f5f894d78d2a1f5374097890aec01473183e748abefe4f3faa10eaa9
Requires-Python: >=3.9
After source/build review, create a pinned uv project:
uv venv --python 3.11
uv add --exact --no-sync "pufferlib==3.0.0"
uv lock
uv sync --frozen
These installation commands are illustrative and were not executed.
Commit pyproject.toml and uv.lock; verify the archive digest and every
resolved dependency. The source build can compile native code and fetch build
assets, so resolve/build in a sandbox without credentials or sensitive mounts.
The archive declares NumPy <2, Gymnasium <=0.29.1, and PettingZoo <=1.24.1;
latest Gymnasium/NumPy are not valid substitutes for this profile. Its setup
supports Linux/macOS and rejects other systems. Python classifiers alone do
not establish a successful native build. The uploaded metadata does not pin Torch or CUDA; do not claim a supported CUDA
matrix that PyPI does not declare.
Pinned 4.0 source
The reviewed branch head on 2026-07-23 was:
25647630e1b15330bb3153a5a0d3ff8d234c3acf
Pin the commit, not branch 4.0:
uv add --no-sync \
"pufferlib @ git+https://github.com/PufferAI/PufferLib.git@25647630e1b15330bb3153a5a0d3ff8d234c3acf"
uv lock
The reviewed 4.0 package declares Python >=3.10 and Torch >=2.9. The reviewed
PufferTank snapshot uses Ubuntu 24.04, Python 3.12, and an NVIDIA CUDA
13.0.2/cuDNN development image with the cu130 Torch index, but does not pin
the exact Torch wheel or all system packages. Treat it as a reference, not a
…
よくある質問
PufferLibの「プロファイル」とは何ですか?
どのバージョンのPufferLibとどの機能を使うかを定義する「設定」のようなものです。最新版、公開版、古いバージョンそれぞれのプロファイルがあります。
「バージョンを意識したガイダンス」とはどういう意味ですか?
PufferLibが、目的に合った正しいソフトウェアバージョンを選んで使えるように支援することを意味します。これにより、互換性の問題を防ぎます。
レビューされていない環境を使うのは安全ですか?
いいえ。PufferLibは、安全性と正しい動作を確保するために、レビューと検証が済んだ環境、パッケージ、ファイルのみを使うことを強く推奨しています。
詳細
作者による元の説明
Version-aware guidance for PufferLib reinforcement-learning environments, vectorization, policies, PuffeRL training, evaluation, and safe checkpoint review. Covers the native 5.0 build and environment API, published 3.0.0 Gymnasium/PettingZoo adaptation, and a pinned historical 4.0 profile.
人気
- GitHubのスター
- 51k
- ランキング
- #3535
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
13c-metabolic-flux
51k炭素13同位体トレーシングのデータを使って代謝フラックスを推定します。細胞の代謝や生化学経路の分析に役立ちます。
adaptyv
51kAdaptyv APIを使ってタンパク質の特性評価実験を設計します。コストの見積もり、配列の提出、ラボの結果の監視を支援します。
aeon
51k時系列データに対して機械学習のタスクを実行します。逐次データの分類、予測、異常検知、パターンの発見に役立ちます。
alphagenome
51k遺伝的変異に対して、事前に計算されたゲノム上の効果を検索します。スコアと説明を提供し、変異がゲノムに与える影響を理解するのに役立ちます。