pufferlib
Skill này làm gì
PufferLib giúp huấn luyện trí tuệ nhân tạo (AI) chơi trò chơi hoặc thực hiện tác vụ. Nó quản lý các phiên bản phần mềm khác nhau để đảm bảo mọi thứ hoạt động đúng.
Khi nào nên dùng
- ✓Khi huấn luyện AI cho một trò chơi mới.
- ✓Khi điều chỉnh AI để làm việc với các phiên bản môi trường khác nhau.
- ✓Khi xem xét tiến trình huấn luyện của AI một cách an toàn.
Liên kết skill
https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/pufferlib/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm thế nào để huấn luyện AI chơi một trò chơi bằng PufferLib phiên bản 3.0.0?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
PufferLib quản lý phiên bản phần mềm và đảm bảo môi trường huấn luyện và chính sách AI tương thích với nhau. Nó cung cấp công cụ để kiểm tra và xác nhận các môi trường này trước khi huấn luyện.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
…
Câu hỏi thường gặp
“Profiles” trong PufferLib là gì?
Profiles giống như “thiết lập” xác định phiên bản PufferLib và các tính năng bạn đang dùng. Có profile cho phiên bản mới nhất, phiên bản đã phát hành và một phiên bản cũ hơn.
“Version-aware guidance” nghĩa là gì?
Nghĩa là PufferLib giúp bạn chọn và dùng đúng phiên bản phần mềm cho nhu cầu của mình, tránh các vấn đề tương thích.
Dùng môi trường chưa được kiểm duyệt có an toàn không?
Không. PufferLib khuyến nghị mạnh mẽ chỉ dùng các môi trường, gói phần mềm hoặc tệp đã được kiểm duyệt và xác minh để đảm bảo an toàn và hoạt động đúng.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 51k
- Vị trí xếp hạng
- #3535
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
13c-metabolic-flux
51kƯớc tính thông lượng chuyển hóa bằng dữ liệu theo dõi đồng vị carbon-13. Hữu ích để phân tích chuyển hóa tế bào và các con đường sinh hóa.
adaptyv
51kThiết kế thí nghiệm đặc trưng protein bằng Adaptyv API. Hỗ trợ ước tính chi phí, gửi trình tự và theo dõi kết quả phòng thí nghiệm.
aeon
51kThực hiện các tác vụ học máy trên dữ liệu chuỗi thời gian. Hữu ích để phân loại, dự báo, phát hiện bất thường và tìm mẫu trong dữ liệu tuần tự.
alphagenome
51kTra cứu các tác động di truyền đã được tính trước cho biến thể gen. Cung cấp điểm số và giải thích để hiểu ảnh hưởng của biến thể lên bộ gen.
Skill tương tự
pytorch-patterns
280kGiúp agent của bạn dùng PyTorch cho các mô hình học máy. Áp dụng thực hành tốt nhất để huấn luyện mô hình hiệu quả và đảm bảo kết quả có thể lặp lại.
evm-token-decimals
280kGiúp agent tránh lỗi về số thập phân khi làm việc với các mạng blockchain khác nhau. Đảm bảo giá trị token chính xác trong giao dịch và phép tính.
ito-inference
280kGiúp agent kiểm tra xem các mô hình AI đã sẵn sàng để dùng chưa. Kết nối yêu cầu tài nguyên tính toán với dịch vụ mô hình đã sẵn sàng.