pufferlib

pufferlib is a skill for Claude Code, Codex from LeonChaoX/qinyan-academic-skills. It costs 78 tokens per session (3,008 once invoked), scanned A, a copy of pufferlib, MIT.

A reinforcement-learning framework for training software agents through repeated interaction with an environment and rewards. It focuses on running many environments in parallel and supports single-agent and multi-agent setups.

In plain words
What is it for?
Use it to train PPO agents, create custom environments, connect Gymnasium or PettingZoo environments, and develop multi-agent or game-playing systems.
Why use it?
It helps reduce the time spent simulating environments and collecting training experience for reinforcement-learning experiments.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to train PPO agents, create custom environments, connect Gymnasium or PettingZoo environments, and develop multi-agent or game-playing systems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/leonchaox/qinyan-academic-skills/pufferlib
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LeonChaoX/qinyan-academic-skills --skill pufferlib
Clone the repo
git clone --depth 1 https://github.com/LeonChaoX/qinyan-academic-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pufferlib

README.md
[![agentmods](https://agentmods.dev/badge/skills/leonchaox/qinyan-academic-skills/pufferlib/github.svg)](https://agentmods.dev/skills/leonchaox/qinyan-academic-skills/pufferlib)
Your own site
<a href="https://agentmods.dev/skills/leonchaox/qinyan-academic-skills/pufferlib"><img src="https://agentmods.dev/badge/skills/leonchaox/qinyan-academic-skills/pufferlib/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pufferlib

Your own site · 80×15
<a href="https://agentmods.dev/skills/leonchaox/qinyan-academic-skills/pufferlib"><img src="https://agentmods.dev/badge/skills/leonchaox/qinyan-academic-skills/pufferlib.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,008 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 91% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.03008
Opus 5 $0.00039 $0.01504
Sonnet 5 $0.00016 $0.00602
Haiku 4.5 $0.00008 $0.00301

Measured 8d ago against content hash 6d5821d2eef9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

pufferlib scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/env_template.py, scripts/train_template.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

91% identical to pufferlib — 6 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/09-机器学习与人工智能/pufferlib/SKILL.md · 435 lines

How it starts

The opening of the file, as written. The whole thing — 435 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PufferLib - High-Performance Reinforcement Learning

Overview

PufferLib is a high-performance reinforcement learning library designed for fast parallel environment simulation and training. It achieves training at millions of steps per second through optimized vectorization, native multi-agent support, and efficient PPO implementation (PuffeRL). The library provides the Ocean suite of 20+ environments and seamless integration with Gymnasium, PettingZoo, and specialized RL frameworks.

When to Use This Skill

Use this skill when:

  • Training RL agents with PPO on any environment (single or multi-agent)
  • Creating custom environments using the PufferEnv API
  • Optimizing performance for parallel environment simulation (vectorization)
  • Integrating existing environments from Gymnasium, PettingZoo, Atari, Procgen, etc.
  • Developing policies with CNN, LSTM, or custom architectures
  • Scaling RL to millions of steps per second for faster experimentation
  • Multi-agent RL with native multi-agent environment support

Core Capabilities

1. High-Performance Training (PuffeRL)

PuffeRL is PufferLib's optimized PPO+LSTM training algorithm achieving 1M-4M steps/second.

Quick start training:

# CLI training
puffer train procgen-coinrun --train.device cuda --train.learning-rate 3e-4

# Distributed training
torchrun --nproc_per_node=4 train.py

Python training loop:

import pufferlib
from pufferlib import PuffeRL

# Create vectorized environment
env = pufferlib.make('procgen-coinrun', num_envs=256)

# Create trainer
trainer = PuffeRL(
    env=env,
    policy=my_policy,
    device='cuda',
    learning_rate=3e-4,
    batch_size=32768
)

# Training loop
for iteration in range(num_iterations):
    trainer.evaluate()  # Collect rollouts
    trainer.train()     # Train on batch
    trainer.mean_and_log()  # Log results

For comprehensive training guidance, read references/training.md for:

  • Complete training workflow and CLI options
  • Hyperparameter tuning with Protein
  • Distributed multi-GPU/multi-node training
  • Logger integration (Weights & Biases, Neptune)
  • Checkpointing and resume training
  • Performance optimization tips
  • Curriculum learning patterns

Read the full file on GitHub · 435 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 435 lines · 78 tokens per session scan A 6d5821d2eef9

Subscribe to this mod's changes

pufferlib is a skill published in the GitHub repository LeonChaoX/qinyan-academic-skills (880 stars, last pushed 1mo ago), licensed MIT. It adds 78 tokens to every session and 3,008 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to pufferlib, differing in 6 lines, and is treated as a copy.

Related

Other skills, from other repositories

add-ollama-tool

Add Ollama MCP server so the container agent can call local models and optionally manage the Ollama model library.

nanocoai/nanoclaw · 28 tokens

develop-web-game

Use when Codex is building or iterating on a web game (HTML/JS) and needs a reliable development + testing loop: implement small changes, run a Playwright-based test script with short input bursts and intentional pauses, inspect screenshots/text, and review console errors with rendergametotext.

netease-youdao/LobsterAI · 64 tokens

deepseek-helper

A guide for using the DeepSeek API, a service that lets programs send requests to DeepSeek language models. It covers model choice, example requests, prompt improvements, cost estimates, and common API errors.

dongsheng123132/u-claw · 25 tokens

pufferlib

Version-aware guidance for PufferLib reinforcement-learning environments, vectorization, policies, PuffeRL training, evaluation, and safe checkpoint review. Use when adapting Gymnasium/PettingZoo environments to published PufferLib 3.0.0 or working with the redesigned native 4.0 source line.

K-Dense-AI/scientific-agent-skills · 65 tokens

sovereign-economics-engine

Unified business model evaluator, client filter, pricing engine, and distribution architect. Absorbs 31 business + 8 marketing + 13 content + 2 acquisition protocols.

winstonkoh87/Athena-Public · 43 tokens

model-scaffold

Generate a reproducible, runnable PyTorch training repo for a medical-imaging task — segmentation, classification, detection, image-to-image synthesis, self-supervised pretraining, or fine-tuning a pretrained backbone (transfer learning) — the missing middle link between choosing an architecture and validating a…

Aperivue/medsci-skills · 191 tokens