@r1z4x/tezgah 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +738 -0
- package/LICENSE +21 -0
- package/MANIFEST +753 -0
- package/README.de.md +169 -0
- package/README.es.md +168 -0
- package/README.fr.md +166 -0
- package/README.md +161 -0
- package/README.tr.md +163 -0
- package/agents/tezgah-reviewer.md +70 -0
- package/bin/codegen +337 -0
- package/bin/consult +797 -0
- package/bin/tezgah-adhd +50 -0
- package/bin/tezgah-agents +45 -0
- package/bin/tezgah-capture +66 -0
- package/bin/tezgah-context +96 -0
- package/bin/tezgah-decisions +213 -0
- package/bin/tezgah-design +953 -0
- package/bin/tezgah-docs +1199 -0
- package/bin/tezgah-doctor +497 -0
- package/bin/tezgah-dsh +37 -0
- package/bin/tezgah-dsh.cmd +70 -0
- package/bin/tezgah-gate +75 -0
- package/bin/tezgah-import-ai-research +439 -0
- package/bin/tezgah-index +32 -0
- package/bin/tezgah-lessons +148 -0
- package/bin/tezgah-mcp +322 -0
- package/bin/tezgah-migrate +324 -0
- package/bin/tezgah-pony +50 -0
- package/bin/tezgah-research +772 -0
- package/bin/tezgah-rollback +93 -0
- package/bin/tezgah-route +124 -0
- package/bin/tezgah-setup +5798 -0
- package/bin/tezgah-status +383 -0
- package/bin/tezgah-task +607 -0
- package/bin/tezgah-taste +423 -0
- package/bin/tezgah-triage +485 -0
- package/bin/tezgah.js +36 -0
- package/commands/adhd.md +21 -0
- package/commands/ponytail.md +21 -0
- package/docs/README.md +112 -0
- package/docs/architecture.md +226 -0
- package/docs/citations-baseline.json +59 -0
- package/docs/clarity-baseline.json +116 -0
- package/docs/contract.md +416 -0
- package/docs/environment.md +141 -0
- package/docs/evidence.md +831 -0
- package/docs/feature-audit.md +139 -0
- package/docs/gate.md +407 -0
- package/docs/glossary.md +201 -0
- package/docs/hosts.md +400 -0
- package/docs/index.json +471 -0
- package/docs/judge.md +193 -0
- package/docs/layers.md +189 -0
- package/docs/models.md +160 -0
- package/docs/operations.md +666 -0
- package/docs/research.md +809 -0
- package/docs/results/paired-outcome-2026-10.jsonl +254 -0
- package/docs/results/paired-outcome-2026-10.md +204 -0
- package/docs/skills.md +236 -0
- package/docs/status-line.md +315 -0
- package/docs/testing.md +287 -0
- package/docs/vision.md +117 -0
- package/hooks/hooks.json +33 -0
- package/hooks/projects-auto-init.py +98 -0
- package/hooks/projects-posttooluse.py +149 -0
- package/hooks/projects-pretooluse.py +40 -0
- package/hooks/projects-stop.py +60 -0
- package/hooks/tezgah_agents.py +817 -0
- package/hooks/tezgah_apps.py +266 -0
- package/hooks/tezgah_attest.py +255 -0
- package/hooks/tezgah_clarity.py +171 -0
- package/hooks/tezgah_components.py +140 -0
- package/hooks/tezgah_context.py +2953 -0
- package/hooks/tezgah_embed.py +765 -0
- package/hooks/tezgah_gate.py +2736 -0
- package/hooks/tezgah_guard.py +177 -0
- package/hooks/tezgah_index.py +124 -0
- package/hooks/tezgah_integrity.py +5141 -0
- package/hooks/tezgah_judge.py +487 -0
- package/hooks/tezgah_lang.py +230 -0
- package/hooks/tezgah_lessons.py +210 -0
- package/hooks/tezgah_models.py +855 -0
- package/hooks/tezgah_paths.py +1132 -0
- package/hooks/tezgah_policy.py +1039 -0
- package/hooks/tezgah_rank.py +77 -0
- package/hooks/tezgah_replay.py +1109 -0
- package/hooks/tezgah_research.py +5176 -0
- package/hooks/tezgah_shapes.py +305 -0
- package/hooks/tezgah_skill_pick.py +227 -0
- package/hooks/tezgah_snapshot.py +490 -0
- package/hooks/tezgah_stopspec.py +320 -0
- package/hooks/tezgah_task.py +458 -0
- package/hooks/tezgah_taste.py +201 -0
- package/hooks/tezgah_untrusted.py +112 -0
- package/hooks/tezgah_update.py +430 -0
- package/hosts/codex/hook.py +268 -0
- package/hosts/codex/hooks.json +26 -0
- package/hosts/cursor/hook.py +461 -0
- package/hosts/cursor/hooks.json +44 -0
- package/hosts/dsh/hooks.json +21 -0
- package/hosts/dsh/statusline/lib/client.js +138 -0
- package/hosts/dsh/statusline/lib/index.js +104 -0
- package/hosts/dsh/statusline/package.json +28 -0
- package/hosts/omp/hook.py +277 -0
- package/hosts/omp/tezgah-hook.ts.in +701 -0
- package/hosts/opencode/plugins/tezgah.js +2742 -0
- package/hosts/opencode/tui/tezgah-tui.tsx +151 -0
- package/output-styles/tezgah.md +142 -0
- package/package.json +32 -0
- package/packaging/build.sh +342 -0
- package/packaging/install.ps1 +166 -0
- package/packaging/install.sh +56 -0
- package/packaging/upgrade.sh +142 -0
- package/skills/ai-research/0-autoresearch-skill/SKILL.md +411 -0
- package/skills/ai-research/0-autoresearch-skill/references/agent-continuity.md +95 -0
- package/skills/ai-research/0-autoresearch-skill/references/progress-reporting.md +166 -0
- package/skills/ai-research/0-autoresearch-skill/references/skill-routing.md +219 -0
- package/skills/ai-research/0-autoresearch-skill/templates/findings.md +44 -0
- package/skills/ai-research/0-autoresearch-skill/templates/research-log.md +41 -0
- package/skills/ai-research/01-model-architecture/litgpt/SKILL.md +469 -0
- package/skills/ai-research/01-model-architecture/litgpt/references/custom-models.md +569 -0
- package/skills/ai-research/01-model-architecture/litgpt/references/distributed-training.md +452 -0
- package/skills/ai-research/01-model-architecture/litgpt/references/supported-models.md +337 -0
- package/skills/ai-research/01-model-architecture/litgpt/references/training-recipes.md +620 -0
- package/skills/ai-research/01-model-architecture/mamba/SKILL.md +260 -0
- package/skills/ai-research/01-model-architecture/mamba/references/architecture-details.md +207 -0
- package/skills/ai-research/01-model-architecture/mamba/references/benchmarks.md +256 -0
- package/skills/ai-research/01-model-architecture/mamba/references/training-guide.md +389 -0
- package/skills/ai-research/01-model-architecture/nanogpt/SKILL.md +290 -0
- package/skills/ai-research/01-model-architecture/nanogpt/references/architecture.md +383 -0
- package/skills/ai-research/01-model-architecture/nanogpt/references/data.md +477 -0
- package/skills/ai-research/01-model-architecture/nanogpt/references/training.md +565 -0
- package/skills/ai-research/01-model-architecture/rwkv/SKILL.md +260 -0
- package/skills/ai-research/01-model-architecture/rwkv/references/architecture-details.md +345 -0
- package/skills/ai-research/01-model-architecture/rwkv/references/rwkv7.md +387 -0
- package/skills/ai-research/01-model-architecture/rwkv/references/state-management.md +370 -0
- package/skills/ai-research/01-model-architecture/torchtitan/SKILL.md +358 -0
- package/skills/ai-research/01-model-architecture/torchtitan/references/checkpoint.md +182 -0
- package/skills/ai-research/01-model-architecture/torchtitan/references/custom-models.md +259 -0
- package/skills/ai-research/01-model-architecture/torchtitan/references/float8.md +134 -0
- package/skills/ai-research/01-model-architecture/torchtitan/references/fsdp.md +127 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/SKILL.md +516 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/algorithms.md +654 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/integration.md +638 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/pipeline.md +724 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/training.md +566 -0
- package/skills/ai-research/02-tokenization/sentencepiece/SKILL.md +235 -0
- package/skills/ai-research/02-tokenization/sentencepiece/references/algorithms.md +201 -0
- package/skills/ai-research/02-tokenization/sentencepiece/references/training.md +305 -0
- package/skills/ai-research/03-fine-tuning/axolotl/SKILL.md +158 -0
- package/skills/ai-research/03-fine-tuning/axolotl/references/api.md +5549 -0
- package/skills/ai-research/03-fine-tuning/axolotl/references/dataset-formats.md +1030 -0
- package/skills/ai-research/03-fine-tuning/axolotl/references/index.md +16 -0
- package/skills/ai-research/03-fine-tuning/axolotl/references/other.md +3564 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/SKILL.md +80 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/_images.md +24 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/advanced.md +1056 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/getting_started.md +350 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/index.md +20 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/other.md +32 -0
- package/skills/ai-research/03-fine-tuning/peft/SKILL.md +431 -0
- package/skills/ai-research/03-fine-tuning/peft/references/advanced-usage.md +515 -0
- package/skills/ai-research/03-fine-tuning/peft/references/troubleshooting.md +481 -0
- package/skills/ai-research/03-fine-tuning/unsloth/SKILL.md +80 -0
- package/skills/ai-research/03-fine-tuning/unsloth/references/index.md +8 -0
- package/skills/ai-research/03-fine-tuning/unsloth/references/llms.md +83 -0
- package/skills/ai-research/04-mechanistic-interpretability/nnsight/SKILL.md +436 -0
- package/skills/ai-research/04-mechanistic-interpretability/nnsight/references/README.md +79 -0
- package/skills/ai-research/04-mechanistic-interpretability/nnsight/references/api.md +345 -0
- package/skills/ai-research/04-mechanistic-interpretability/nnsight/references/tutorials.md +301 -0
- package/skills/ai-research/04-mechanistic-interpretability/pyvene/SKILL.md +473 -0
- package/skills/ai-research/04-mechanistic-interpretability/pyvene/references/README.md +74 -0
- package/skills/ai-research/04-mechanistic-interpretability/pyvene/references/api.md +384 -0
- package/skills/ai-research/04-mechanistic-interpretability/pyvene/references/tutorials.md +377 -0
- package/skills/ai-research/04-mechanistic-interpretability/saelens/SKILL.md +386 -0
- package/skills/ai-research/04-mechanistic-interpretability/saelens/references/README.md +71 -0
- package/skills/ai-research/04-mechanistic-interpretability/saelens/references/api.md +334 -0
- package/skills/ai-research/04-mechanistic-interpretability/saelens/references/tutorials.md +319 -0
- package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/SKILL.md +346 -0
- package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/references/README.md +55 -0
- package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/references/api.md +363 -0
- package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/references/tutorials.md +340 -0
- package/skills/ai-research/05-data-processing/nemo-curator/SKILL.md +383 -0
- package/skills/ai-research/05-data-processing/nemo-curator/references/deduplication.md +88 -0
- package/skills/ai-research/05-data-processing/nemo-curator/references/filtering.md +103 -0
- package/skills/ai-research/05-data-processing/ray-data/SKILL.md +326 -0
- package/skills/ai-research/05-data-processing/ray-data/references/integration.md +83 -0
- package/skills/ai-research/05-data-processing/ray-data/references/transformations.md +84 -0
- package/skills/ai-research/06-post-training/grpo-rl-training/README.md +98 -0
- package/skills/ai-research/06-post-training/grpo-rl-training/SKILL.md +572 -0
- package/skills/ai-research/06-post-training/miles/SKILL.md +315 -0
- package/skills/ai-research/06-post-training/miles/references/api-reference.md +142 -0
- package/skills/ai-research/06-post-training/miles/references/troubleshooting.md +353 -0
- package/skills/ai-research/06-post-training/openrlhf/SKILL.md +249 -0
- package/skills/ai-research/06-post-training/openrlhf/references/algorithm-comparison.md +405 -0
- package/skills/ai-research/06-post-training/openrlhf/references/custom-rewards.md +531 -0
- package/skills/ai-research/06-post-training/openrlhf/references/hybrid-engine.md +288 -0
- package/skills/ai-research/06-post-training/openrlhf/references/multi-node-training.md +455 -0
- package/skills/ai-research/06-post-training/simpo/SKILL.md +219 -0
- package/skills/ai-research/06-post-training/simpo/references/datasets.md +479 -0
- package/skills/ai-research/06-post-training/simpo/references/hyperparameters.md +453 -0
- package/skills/ai-research/06-post-training/simpo/references/loss-functions.md +351 -0
- package/skills/ai-research/06-post-training/slime/SKILL.md +464 -0
- package/skills/ai-research/06-post-training/slime/references/api-reference.md +393 -0
- package/skills/ai-research/06-post-training/slime/references/troubleshooting.md +387 -0
- package/skills/ai-research/06-post-training/torchforge/SKILL.md +433 -0
- package/skills/ai-research/06-post-training/torchforge/references/api-reference.md +328 -0
- package/skills/ai-research/06-post-training/torchforge/references/troubleshooting.md +410 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/SKILL.md +455 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/references/dpo-variants.md +228 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/references/online-rl.md +83 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/references/reward-modeling.md +123 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/references/sft-training.md +169 -0
- package/skills/ai-research/06-post-training/verl/SKILL.md +391 -0
- package/skills/ai-research/06-post-training/verl/references/api-reference.md +302 -0
- package/skills/ai-research/06-post-training/verl/references/troubleshooting.md +392 -0
- package/skills/ai-research/07-safety-alignment/constitutional-ai/SKILL.md +290 -0
- package/skills/ai-research/07-safety-alignment/llamaguard/SKILL.md +337 -0
- package/skills/ai-research/07-safety-alignment/nemo-guardrails/SKILL.md +297 -0
- package/skills/ai-research/07-safety-alignment/prompt-guard/SKILL.md +312 -0
- package/skills/ai-research/08-distributed-training/accelerate/SKILL.md +332 -0
- package/skills/ai-research/08-distributed-training/accelerate/references/custom-plugins.md +454 -0
- package/skills/ai-research/08-distributed-training/accelerate/references/megatron-integration.md +490 -0
- package/skills/ai-research/08-distributed-training/accelerate/references/performance.md +526 -0
- package/skills/ai-research/08-distributed-training/deepspeed/SKILL.md +141 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/08.md +18 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/09.md +174 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/2020.md +379 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/2023.md +280 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/assets.md +180 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/index.md +36 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/mii.md +119 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/other.md +1192 -0
- package/skills/ai-research/08-distributed-training/megatron-core/SKILL.md +366 -0
- package/skills/ai-research/08-distributed-training/megatron-core/references/benchmarks.md +250 -0
- package/skills/ai-research/08-distributed-training/megatron-core/references/parallelism-guide.md +405 -0
- package/skills/ai-research/08-distributed-training/megatron-core/references/production-examples.md +474 -0
- package/skills/ai-research/08-distributed-training/megatron-core/references/training-recipes.md +548 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/SKILL.md +231 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_dcp_async_recipe.md +14 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_dcp_overview.md +19 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_dcp_recipe.md +18 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_ddp_notes.md +10 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_device_mesh_tutorial.md +22 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_examples_fsdp2.md +15 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_fsdp1_api.md +9 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_fsdp2_tutorial.md +45 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_fully_shard_api.md +49 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_tp_tutorial.md +22 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/ray_train_fsdp2_example.md +13 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/torchtitan_fsdp_notes.md +14 -0
- package/skills/ai-research/08-distributed-training/pytorch-lightning/SKILL.md +346 -0
- package/skills/ai-research/08-distributed-training/pytorch-lightning/references/callbacks.md +437 -0
- package/skills/ai-research/08-distributed-training/pytorch-lightning/references/distributed.md +491 -0
- package/skills/ai-research/08-distributed-training/pytorch-lightning/references/hyperparameter-tuning.md +557 -0
- package/skills/ai-research/08-distributed-training/ray-train/SKILL.md +406 -0
- package/skills/ai-research/08-distributed-training/ray-train/references/multi-node.md +629 -0
- package/skills/ai-research/09-infrastructure/lambda-labs/SKILL.md +545 -0
- package/skills/ai-research/09-infrastructure/lambda-labs/references/advanced-usage.md +612 -0
- package/skills/ai-research/09-infrastructure/lambda-labs/references/troubleshooting.md +531 -0
- package/skills/ai-research/09-infrastructure/modal/SKILL.md +341 -0
- package/skills/ai-research/09-infrastructure/modal/references/advanced-usage.md +504 -0
- package/skills/ai-research/09-infrastructure/modal/references/troubleshooting.md +495 -0
- package/skills/ai-research/09-infrastructure/skypilot/SKILL.md +509 -0
- package/skills/ai-research/09-infrastructure/skypilot/references/advanced-usage.md +492 -0
- package/skills/ai-research/09-infrastructure/skypilot/references/troubleshooting.md +571 -0
- package/skills/ai-research/10-optimization/awq/SKILL.md +310 -0
- package/skills/ai-research/10-optimization/awq/references/advanced-usage.md +325 -0
- package/skills/ai-research/10-optimization/awq/references/troubleshooting.md +345 -0
- package/skills/ai-research/10-optimization/bitsandbytes/SKILL.md +411 -0
- package/skills/ai-research/10-optimization/bitsandbytes/references/memory-optimization.md +522 -0
- package/skills/ai-research/10-optimization/bitsandbytes/references/qlora-training.md +522 -0
- package/skills/ai-research/10-optimization/bitsandbytes/references/quantization-formats.md +448 -0
- package/skills/ai-research/10-optimization/flash-attention/SKILL.md +367 -0
- package/skills/ai-research/10-optimization/flash-attention/references/benchmarks.md +216 -0
- package/skills/ai-research/10-optimization/flash-attention/references/transformers-integration.md +294 -0
- package/skills/ai-research/10-optimization/gguf/SKILL.md +427 -0
- package/skills/ai-research/10-optimization/gguf/references/advanced-usage.md +505 -0
- package/skills/ai-research/10-optimization/gguf/references/troubleshooting.md +443 -0
- package/skills/ai-research/10-optimization/gptq/SKILL.md +450 -0
- package/skills/ai-research/10-optimization/gptq/references/calibration.md +338 -0
- package/skills/ai-research/10-optimization/gptq/references/integration.md +130 -0
- package/skills/ai-research/10-optimization/gptq/references/troubleshooting.md +96 -0
- package/skills/ai-research/10-optimization/hqq/SKILL.md +445 -0
- package/skills/ai-research/10-optimization/hqq/references/advanced-usage.md +529 -0
- package/skills/ai-research/10-optimization/hqq/references/troubleshooting.md +504 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/SKILL.md +319 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/architecture.md +320 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/biomedical.md +498 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/domain-specific.md +626 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/experiment-loop.md +129 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/optimizers.md +330 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/scaling-and-selection.md +428 -0
- package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/SKILL.md +405 -0
- package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/references/benchmarks.md +394 -0
- package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/references/custom-tasks.md +425 -0
- package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/references/issues.md +395 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/SKILL.md +490 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/api-evaluation.md +491 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/benchmark-guide.md +489 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/custom-tasks.md +603 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/distributed-eval.md +520 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/SKILL.md +494 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/references/adapter-system.md +341 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/references/configuration.md +448 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/references/custom-benchmarks.md +316 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/references/execution-backends.md +362 -0
- package/skills/ai-research/12-inference-serving/llama-cpp/SKILL.md +258 -0
- package/skills/ai-research/12-inference-serving/llama-cpp/references/optimization.md +90 -0
- package/skills/ai-research/12-inference-serving/llama-cpp/references/quantization.md +214 -0
- package/skills/ai-research/12-inference-serving/llama-cpp/references/server.md +126 -0
- package/skills/ai-research/12-inference-serving/sglang/SKILL.md +442 -0
- package/skills/ai-research/12-inference-serving/sglang/references/deployment.md +491 -0
- package/skills/ai-research/12-inference-serving/sglang/references/radix-attention.md +414 -0
- package/skills/ai-research/12-inference-serving/sglang/references/structured-generation.md +542 -0
- package/skills/ai-research/12-inference-serving/tensorrt-llm/SKILL.md +187 -0
- package/skills/ai-research/12-inference-serving/tensorrt-llm/references/multi-gpu.md +299 -0
- package/skills/ai-research/12-inference-serving/tensorrt-llm/references/optimization.md +243 -0
- package/skills/ai-research/12-inference-serving/tensorrt-llm/references/serving.md +471 -0
- package/skills/ai-research/12-inference-serving/vllm/SKILL.md +364 -0
- package/skills/ai-research/12-inference-serving/vllm/references/optimization.md +227 -0
- package/skills/ai-research/12-inference-serving/vllm/references/quantization.md +285 -0
- package/skills/ai-research/12-inference-serving/vllm/references/server-deployment.md +256 -0
- package/skills/ai-research/12-inference-serving/vllm/references/troubleshooting.md +448 -0
- package/skills/ai-research/13-mlops/mlflow/SKILL.md +704 -0
- package/skills/ai-research/13-mlops/mlflow/references/deployment.md +745 -0
- package/skills/ai-research/13-mlops/mlflow/references/model-registry.md +771 -0
- package/skills/ai-research/13-mlops/mlflow/references/tracking.md +681 -0
- package/skills/ai-research/13-mlops/swanlab/SKILL.md +406 -0
- package/skills/ai-research/13-mlops/swanlab/references/integrations.md +305 -0
- package/skills/ai-research/13-mlops/swanlab/references/visualization.md +234 -0
- package/skills/ai-research/13-mlops/tensorboard/SKILL.md +629 -0
- package/skills/ai-research/13-mlops/tensorboard/references/integrations.md +639 -0
- package/skills/ai-research/13-mlops/tensorboard/references/profiling.md +546 -0
- package/skills/ai-research/13-mlops/tensorboard/references/visualization.md +621 -0
- package/skills/ai-research/13-mlops/weights-and-biases/SKILL.md +590 -0
- package/skills/ai-research/13-mlops/weights-and-biases/references/artifacts.md +585 -0
- package/skills/ai-research/13-mlops/weights-and-biases/references/integrations.md +701 -0
- package/skills/ai-research/13-mlops/weights-and-biases/references/sweeps.md +848 -0
- package/skills/ai-research/14-agents/a-evolve/SKILL.md +383 -0
- package/skills/ai-research/14-agents/a-evolve/references/README.md +831 -0
- package/skills/ai-research/14-agents/a-evolve/references/api.md +594 -0
- package/skills/ai-research/14-agents/a-evolve/references/architecture.md +417 -0
- package/skills/ai-research/14-agents/a-evolve/references/design-patterns.md +462 -0
- package/skills/ai-research/14-agents/a-evolve/references/examples.md +352 -0
- package/skills/ai-research/14-agents/a-evolve/references/issues.md +591 -0
- package/skills/ai-research/14-agents/a-evolve/references/releases.md +112 -0
- package/skills/ai-research/14-agents/a-evolve/references/tutorials.md +819 -0
- package/skills/ai-research/14-agents/autogpt/SKILL.md +403 -0
- package/skills/ai-research/14-agents/autogpt/references/advanced-usage.md +536 -0
- package/skills/ai-research/14-agents/autogpt/references/troubleshooting.md +421 -0
- package/skills/ai-research/14-agents/crewai/SKILL.md +498 -0
- package/skills/ai-research/14-agents/crewai/references/flows.md +439 -0
- package/skills/ai-research/14-agents/crewai/references/tools.md +430 -0
- package/skills/ai-research/14-agents/crewai/references/troubleshooting.md +481 -0
- package/skills/ai-research/14-agents/langchain/SKILL.md +480 -0
- package/skills/ai-research/14-agents/langchain/references/agents.md +500 -0
- package/skills/ai-research/14-agents/langchain/references/integration.md +563 -0
- package/skills/ai-research/14-agents/langchain/references/rag.md +601 -0
- package/skills/ai-research/14-agents/llamaindex/SKILL.md +569 -0
- package/skills/ai-research/14-agents/llamaindex/references/agents.md +84 -0
- package/skills/ai-research/14-agents/llamaindex/references/data_connectors.md +109 -0
- package/skills/ai-research/14-agents/llamaindex/references/query_engines.md +407 -0
- package/skills/ai-research/15-rag/chroma/SKILL.md +406 -0
- package/skills/ai-research/15-rag/chroma/references/integration.md +39 -0
- package/skills/ai-research/15-rag/faiss/SKILL.md +221 -0
- package/skills/ai-research/15-rag/faiss/references/index_types.md +281 -0
- package/skills/ai-research/15-rag/pinecone/SKILL.md +358 -0
- package/skills/ai-research/15-rag/pinecone/references/deployment.md +182 -0
- package/skills/ai-research/15-rag/qdrant/SKILL.md +493 -0
- package/skills/ai-research/15-rag/qdrant/references/advanced-usage.md +649 -0
- package/skills/ai-research/15-rag/qdrant/references/troubleshooting.md +632 -0
- package/skills/ai-research/15-rag/sentence-transformers/SKILL.md +255 -0
- package/skills/ai-research/15-rag/sentence-transformers/references/models.md +124 -0
- package/skills/ai-research/16-prompt-engineering/dspy/SKILL.md +590 -0
- package/skills/ai-research/16-prompt-engineering/dspy/references/examples.md +664 -0
- package/skills/ai-research/16-prompt-engineering/dspy/references/modules.md +476 -0
- package/skills/ai-research/16-prompt-engineering/dspy/references/optimizers.md +567 -0
- package/skills/ai-research/16-prompt-engineering/guidance/SKILL.md +572 -0
- package/skills/ai-research/16-prompt-engineering/guidance/references/backends.md +555 -0
- package/skills/ai-research/16-prompt-engineering/guidance/references/constraints.md +675 -0
- package/skills/ai-research/16-prompt-engineering/guidance/references/examples.md +768 -0
- package/skills/ai-research/16-prompt-engineering/instructor/SKILL.md +740 -0
- package/skills/ai-research/16-prompt-engineering/instructor/references/examples.md +108 -0
- package/skills/ai-research/16-prompt-engineering/instructor/references/providers.md +71 -0
- package/skills/ai-research/16-prompt-engineering/instructor/references/validation.md +607 -0
- package/skills/ai-research/16-prompt-engineering/outlines/SKILL.md +652 -0
- package/skills/ai-research/16-prompt-engineering/outlines/references/backends.md +616 -0
- package/skills/ai-research/16-prompt-engineering/outlines/references/examples.md +774 -0
- package/skills/ai-research/16-prompt-engineering/outlines/references/json_generation.md +653 -0
- package/skills/ai-research/17-observability/langsmith/SKILL.md +422 -0
- package/skills/ai-research/17-observability/langsmith/references/advanced-usage.md +549 -0
- package/skills/ai-research/17-observability/langsmith/references/troubleshooting.md +538 -0
- package/skills/ai-research/17-observability/phoenix/SKILL.md +475 -0
- package/skills/ai-research/17-observability/phoenix/references/advanced-usage.md +620 -0
- package/skills/ai-research/17-observability/phoenix/references/troubleshooting.md +539 -0
- package/skills/ai-research/18-multimodal/audiocraft/SKILL.md +564 -0
- package/skills/ai-research/18-multimodal/audiocraft/references/advanced-usage.md +667 -0
- package/skills/ai-research/18-multimodal/audiocraft/references/troubleshooting.md +505 -0
- package/skills/ai-research/18-multimodal/blip-2/SKILL.md +564 -0
- package/skills/ai-research/18-multimodal/blip-2/references/advanced-usage.md +681 -0
- package/skills/ai-research/18-multimodal/blip-2/references/troubleshooting.md +527 -0
- package/skills/ai-research/18-multimodal/clip/SKILL.md +253 -0
- package/skills/ai-research/18-multimodal/clip/references/applications.md +208 -0
- package/skills/ai-research/18-multimodal/cosmos-policy/SKILL.md +402 -0
- package/skills/ai-research/18-multimodal/cosmos-policy/references/libero-commands.md +175 -0
- package/skills/ai-research/18-multimodal/cosmos-policy/references/robocasa-commands.md +147 -0
- package/skills/ai-research/18-multimodal/llava/SKILL.md +304 -0
- package/skills/ai-research/18-multimodal/llava/references/training.md +198 -0
- package/skills/ai-research/18-multimodal/openpi/SKILL.md +480 -0
- package/skills/ai-research/18-multimodal/openpi/references/checkpoints-and-env-map.md +86 -0
- package/skills/ai-research/18-multimodal/openpi/references/config-recipes.md +50 -0
- package/skills/ai-research/18-multimodal/openpi/references/pytorch-gotchas.md +49 -0
- package/skills/ai-research/18-multimodal/openpi/references/remote-client-pattern.md +48 -0
- package/skills/ai-research/18-multimodal/openpi/references/training-debugging.md +46 -0
- package/skills/ai-research/18-multimodal/openvla-oft/SKILL.md +441 -0
- package/skills/ai-research/18-multimodal/openvla-oft/references/aloha-workflow.md +141 -0
- package/skills/ai-research/18-multimodal/openvla-oft/references/config-troubleshooting.md +97 -0
- package/skills/ai-research/18-multimodal/openvla-oft/references/libero-workflow.md +115 -0
- package/skills/ai-research/18-multimodal/openvla-oft/references/paper-and-checkpoints.md +84 -0
- package/skills/ai-research/18-multimodal/segment-anything/SKILL.md +500 -0
- package/skills/ai-research/18-multimodal/segment-anything/references/advanced-usage.md +590 -0
- package/skills/ai-research/18-multimodal/segment-anything/references/troubleshooting.md +485 -0
- package/skills/ai-research/18-multimodal/stable-diffusion/SKILL.md +519 -0
- package/skills/ai-research/18-multimodal/stable-diffusion/references/advanced-usage.md +717 -0
- package/skills/ai-research/18-multimodal/stable-diffusion/references/troubleshooting.md +556 -0
- package/skills/ai-research/18-multimodal/whisper/SKILL.md +317 -0
- package/skills/ai-research/18-multimodal/whisper/references/languages.md +190 -0
- package/skills/ai-research/19-emerging-techniques/knowledge-distillation/SKILL.md +458 -0
- package/skills/ai-research/19-emerging-techniques/knowledge-distillation/references/minillm.md +335 -0
- package/skills/ai-research/19-emerging-techniques/long-context/SKILL.md +536 -0
- package/skills/ai-research/19-emerging-techniques/long-context/references/extension_methods.md +469 -0
- package/skills/ai-research/19-emerging-techniques/long-context/references/fine_tuning.md +612 -0
- package/skills/ai-research/19-emerging-techniques/long-context/references/rope.md +403 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/SKILL.md +497 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/references/coefficient-tuning.md +415 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/references/evaluation.md +463 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/references/examples.md +429 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/references/methods.md +353 -0
- package/skills/ai-research/19-emerging-techniques/model-pruning/SKILL.md +495 -0
- package/skills/ai-research/19-emerging-techniques/model-pruning/references/wanda.md +348 -0
- package/skills/ai-research/19-emerging-techniques/moe-training/SKILL.md +526 -0
- package/skills/ai-research/19-emerging-techniques/moe-training/references/architectures.md +433 -0
- package/skills/ai-research/19-emerging-techniques/moe-training/references/inference.md +349 -0
- package/skills/ai-research/19-emerging-techniques/moe-training/references/training.md +426 -0
- package/skills/ai-research/19-emerging-techniques/speculative-decoding/SKILL.md +467 -0
- package/skills/ai-research/19-emerging-techniques/speculative-decoding/references/lookahead.md +310 -0
- package/skills/ai-research/19-emerging-techniques/speculative-decoding/references/medusa.md +351 -0
- package/skills/ai-research/20-ml-paper-writing/academic-plotting/SKILL.md +479 -0
- package/skills/ai-research/20-ml-paper-writing/academic-plotting/references/data-visualization.md +509 -0
- package/skills/ai-research/20-ml-paper-writing/academic-plotting/references/diagram-generation.md +395 -0
- package/skills/ai-research/20-ml-paper-writing/academic-plotting/references/style-guide.md +305 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/SKILL.md +982 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/checklists.md +348 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/citation-workflow.md +563 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/reviewer-guidelines.md +349 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/sources.md +165 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/writing-guide.md +477 -0
- package/skills/ai-research/20-ml-paper-writing/presenting-conference-talks/SKILL.md +298 -0
- package/skills/ai-research/20-ml-paper-writing/presenting-conference-talks/references/slide-templates.md +505 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/SKILL.md +270 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/checklist.md +279 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/reviewer-guidelines.md +116 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/section-blueprints.md +400 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/systems-conferences.md +261 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/writing-patterns.md +231 -0
- package/skills/ai-research/21-research-ideation/brainstorming-research-ideas/SKILL.md +384 -0
- package/skills/ai-research/21-research-ideation/creative-thinking-for-research/SKILL.md +366 -0
- package/skills/ai-research/22-agent-native-research-artifact/compiler/SKILL.md +245 -0
- package/skills/ai-research/22-agent-native-research-artifact/compiler/references/ara-schema.md +439 -0
- package/skills/ai-research/22-agent-native-research-artifact/compiler/references/exploration-tree-spec.md +125 -0
- package/skills/ai-research/22-agent-native-research-artifact/compiler/references/validation-checklist.md +149 -0
- package/skills/ai-research/22-agent-native-research-artifact/research-manager/SKILL.md +324 -0
- package/skills/ai-research/22-agent-native-research-artifact/research-manager/references/event-taxonomy.md +124 -0
- package/skills/ai-research/22-agent-native-research-artifact/research-manager/references/provenance-tags.md +190 -0
- package/skills/ai-research/22-agent-native-research-artifact/research-manager/references/session-protocol.md +162 -0
- package/skills/ai-research/22-agent-native-research-artifact/rigor-reviewer/SKILL.md +322 -0
- package/skills/ai-research/22-agent-native-research-artifact/rigor-reviewer/references/review-dimensions.md +182 -0
- package/skills/ai-research/SKILL.md +101 -0
- package/skills/ai-research/SOURCE +38 -0
- package/skills/ai-research/index/1-frame.md +18 -0
- package/skills/ai-research/index/2-data.md +21 -0
- package/skills/ai-research/index/3-train.md +48 -0
- package/skills/ai-research/index/4-measure.md +25 -0
- package/skills/ai-research/index/5-run.md +23 -0
- package/skills/ai-research/index/6-write.md +35 -0
- package/skills/ai-research/library.json +3456 -0
- package/skills/analyze-app/EVALS.md +82 -0
- package/skills/analyze-app/SKILL.md +188 -0
- package/skills/design-contract/EVALS.md +80 -0
- package/skills/design-contract/SKILL.md +171 -0
- package/skills/design-library/EVALS.md +85 -0
- package/skills/design-library/INDEX.md +59 -0
- package/skills/design-library/SKILL.md +58 -0
- package/skills/design-library/SOURCE +131 -0
- package/skills/design-library/adaptive-interfaces/skills/colour-independence/SKILL.md +90 -0
- package/skills/design-library/adaptive-interfaces/skills/flexible-typography/SKILL.md +83 -0
- package/skills/design-library/adaptive-interfaces/skills/information-density/SKILL.md +87 -0
- package/skills/design-library/adaptive-interfaces/skills/preference-audit/SKILL.md +70 -0
- package/skills/design-library/adaptive-interfaces/skills/responsive-accessibility/SKILL.md +86 -0
- package/skills/design-library/adaptive-interfaces/skills/responsive-review/SKILL.md +76 -0
- package/skills/design-library/adaptive-interfaces/skills/simplified-views/SKILL.md +97 -0
- package/skills/design-library/adaptive-interfaces/skills/specify/SKILL.md +63 -0
- package/skills/design-library/adaptive-interfaces/skills/user-preference-respect/SKILL.md +100 -0
- package/skills/design-library/cognitive-accessibility/skills/adaptive-personalisation/SKILL.md +61 -0
- package/skills/design-library/cognitive-accessibility/skills/assess-load/SKILL.md +48 -0
- package/skills/design-library/cognitive-accessibility/skills/cognitive-load-assessment/SKILL.md +60 -0
- package/skills/design-library/cognitive-accessibility/skills/contextual-help-design/SKILL.md +61 -0
- package/skills/design-library/cognitive-accessibility/skills/error-prevention-recovery/SKILL.md +71 -0
- package/skills/design-library/cognitive-accessibility/skills/focus-attention-design/SKILL.md +67 -0
- package/skills/design-library/cognitive-accessibility/skills/memory-load-reduction/SKILL.md +60 -0
- package/skills/design-library/cognitive-accessibility/skills/plain-language-design/SKILL.md +78 -0
- package/skills/design-library/cognitive-accessibility/skills/review/SKILL.md +56 -0
- package/skills/design-library/cognitive-accessibility/skills/simplify/SKILL.md +39 -0
- package/skills/design-library/cognitive-accessibility/skills/wayfinding-navigation/SKILL.md +64 -0
- package/skills/design-library/design-research/skills/behavioural-analytics/SKILL.md +33 -0
- package/skills/design-library/design-research/skills/qual-quant-triangulation/SKILL.md +33 -0
- package/skills/design-library/inclusive-interaction/skills/audit/SKILL.md +50 -0
- package/skills/design-library/inclusive-interaction/skills/design-flow/SKILL.md +58 -0
- package/skills/design-library/inclusive-interaction/skills/feedback-and-status/SKILL.md +76 -0
- package/skills/design-library/inclusive-interaction/skills/gesture-alternatives/SKILL.md +70 -0
- package/skills/design-library/inclusive-interaction/skills/keyboard-navigation/SKILL.md +99 -0
- package/skills/design-library/inclusive-interaction/skills/keyboard-review/SKILL.md +54 -0
- package/skills/design-library/inclusive-interaction/skills/motion-sensitivity/SKILL.md +79 -0
- package/skills/design-library/inclusive-interaction/skills/multi-modal-input/SKILL.md +70 -0
- package/skills/design-library/inclusive-interaction/skills/touch-target-design/SKILL.md +71 -0
- package/skills/design-library/inclusive-interaction/skills/voice-interaction/SKILL.md +68 -0
- package/skills/design-library/visual-critique/skills/critique-affordance/SKILL.md +45 -0
- package/skills/design-library/visual-critique/skills/critique-brand-consistency/SKILL.md +42 -0
- package/skills/design-library/visual-critique/skills/critique-color/SKILL.md +44 -0
- package/skills/design-library/visual-critique/skills/critique-composition/SKILL.md +46 -0
- package/skills/design-library/visual-critique/skills/critique-information-density/SKILL.md +45 -0
- package/skills/design-library/visual-critique/skills/critique-typography/SKILL.md +45 -0
- package/skills/design-library/visual-critique/skills/critique-visual-hierarchy/SKILL.md +40 -0
- package/skills/feature-audit/EVALS.md +83 -0
- package/skills/feature-audit/SKILL.md +326 -0
- package/skills/harness/EVALS.md +81 -0
- package/skills/harness/SKILL.md +88 -0
- package/skills/i-have-adhd/EVALS.md +80 -0
- package/skills/i-have-adhd/SKILL.md +183 -0
- package/skills/no-ai-slop/EVALS.md +89 -0
- package/skills/no-ai-slop/SKILL.md +209 -0
- package/skills/no-ai-slop/eval.md +52 -0
- package/skills/plan-add/EVALS.md +79 -0
- package/skills/plan-add/SKILL.md +179 -0
- package/skills/plan-add/render_table.py +72 -0
- package/skills/plan-status/EVALS.md +78 -0
- package/skills/plan-status/SKILL.md +52 -0
- package/skills/plan-sync/EVALS.md +80 -0
- package/skills/plan-sync/SKILL.md +69 -0
- package/skills/pm-frameworks/SKILL.md +33 -0
- package/skills/pm-frameworks/SOURCE +39 -0
- package/skills/pm-frameworks/intended-vs-implemented/SKILL.md +42 -0
- package/skills/pm-frameworks/opportunity-solution-tree/SKILL.md +64 -0
- package/skills/ponytail/EVALS.md +80 -0
- package/skills/ponytail/SKILL.md +124 -0
- package/skills/product-analysis/EVALS.md +103 -0
- package/skills/product-analysis/SKILL.md +361 -0
- package/skills/research/EVALS.md +104 -0
- package/skills/research/SKILL.md +570 -0
- package/skills/rl-env/SKILL.md +53 -0
- package/skills/rl-env/SOURCE +41 -0
- package/skills/rl-env/generate-nemo-gym-env/SKILL.md +169 -0
- package/skills/rl-env/generate-nemo-gym-env/references/architecture.md +114 -0
- package/skills/rl-env/generate-openenv-env/SKILL.md +183 -0
- package/skills/rl-env/generate-openenv-env/references/architecture.md +82 -0
- package/skills/rl-env/generate-ors-env/SKILL.md +209 -0
- package/skills/rl-env/generate-ors-env/references/architecture.md +113 -0
- package/skills/rl-env/generate-verifiers-env/SKILL.md +188 -0
- package/skills/rl-env/generate-verifiers-env/references/architecture.md +119 -0
- package/skills/rl-env/rl-env-from-description/SKILL.md +124 -0
- package/skills/rl-env/rl-env-from-description/references/interview.md +75 -0
- package/skills/rl-env/rl-env-from-description/references/nemo_gym.md +41 -0
- package/skills/rl-env/rl-env-from-description/references/openenv.md +35 -0
- package/skills/rl-env/rl-env-from-description/references/ors.md +50 -0
- package/skills/rl-env/rl-env-from-description/references/verifiers.md +39 -0
- package/skills/tezgah-contract/EVALS.md +78 -0
- package/skills/tezgah-contract/SKILL.md +792 -0
- package/statusline.py +129 -0
- package/workflows/graph-impact.js +153 -0
- package/workflows/graph-map.js +158 -0
- package/workflows/graph-review.js +170 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Source
|
|
2
|
+
|
|
3
|
+
Vendored from https://github.com/adithya-s-k/FineEnvs at
|
|
4
|
+
`26ab9c60915005b6f536968ac0928482bb18c0f8` (2026-10-01), Apache-2.0 licence (the
|
|
5
|
+
repository's root `LICENSE`). Every body below is byte-for-byte upstream,
|
|
6
|
+
frontmatter included, at its upstream path under `.claude/skills/`. Checkout for
|
|
7
|
+
a re-vendor: `git clone https://github.com/adithya-s-k/FineEnvs && git -C <clone>
|
|
8
|
+
checkout 26ab9c60915005b6f536968ac0928482bb18c0f8`.
|
|
9
|
+
|
|
10
|
+
## What is vendored
|
|
11
|
+
|
|
12
|
+
The five environment-authoring skills and every reference file they ship: 14
|
|
13
|
+
files - four framework ports and the orchestrator that drives them from a
|
|
14
|
+
description. The entry point `skills/rl-env/SKILL.md` is tezgah's own and is not
|
|
15
|
+
part of the manifest; neither is this file. Upstream's own install route
|
|
16
|
+
(`npx skills add adithya-s-k/FineEnvs`) is not used: it writes into a host's
|
|
17
|
+
skill directory, which is outside tezgah's router, its install report and this
|
|
18
|
+
manifest.
|
|
19
|
+
|
|
20
|
+
## Manifest
|
|
21
|
+
|
|
22
|
+
One row per vendored file: its path under `skills/rl-env/`, the path it came from
|
|
23
|
+
upstream, and the sha256 of the bytes as vendored - so a body that drifts from
|
|
24
|
+
what was vetted is visible.
|
|
25
|
+
|
|
26
|
+
| file | upstream path | sha256 |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| `generate-nemo-gym-env/SKILL.md` | `.claude/skills/generate-nemo-gym-env/SKILL.md` | `b051de706519973d23e1acb9211f7dee18a681b2b94f0fdc132c6cab0c035f3e` |
|
|
29
|
+
| `generate-nemo-gym-env/references/architecture.md` | `.claude/skills/generate-nemo-gym-env/references/architecture.md` | `2329797c0881697c56d8dfee62396fb858bcfac3c313840155b23acf6720a77c` |
|
|
30
|
+
| `generate-openenv-env/SKILL.md` | `.claude/skills/generate-openenv-env/SKILL.md` | `f8d7d65ec85ee228bf8ffe15df72492c5043541c853f287c5159d7b3eea383c9` |
|
|
31
|
+
| `generate-openenv-env/references/architecture.md` | `.claude/skills/generate-openenv-env/references/architecture.md` | `6ba32c5a1498c6660f79db3feeb0f49226344054bae7cdc1d84d8440147d5509` |
|
|
32
|
+
| `generate-ors-env/SKILL.md` | `.claude/skills/generate-ors-env/SKILL.md` | `68385ef145bdcff61d2878be6db1d6b9652581ba7a5a05369ce6a61a6332ace5` |
|
|
33
|
+
| `generate-ors-env/references/architecture.md` | `.claude/skills/generate-ors-env/references/architecture.md` | `ee87650a409a8ae375935a99daa9a5141d1fae514a1d05abcd87293759e708e4` |
|
|
34
|
+
| `generate-verifiers-env/SKILL.md` | `.claude/skills/generate-verifiers-env/SKILL.md` | `afd9c6d0521735acfed0f308a133e33a6b3d24534e79aabb659f8f20ccfc7a64` |
|
|
35
|
+
| `generate-verifiers-env/references/architecture.md` | `.claude/skills/generate-verifiers-env/references/architecture.md` | `babda38780715a82f9b481ef4469221c8752befb5f9bf1dc7d9093f2b05d634e` |
|
|
36
|
+
| `rl-env-from-description/SKILL.md` | `.claude/skills/rl-env-from-description/SKILL.md` | `fb2b92b92988655b4c4ddae5cfe07e58f18d4105fef4e21058925e48a680438b` |
|
|
37
|
+
| `rl-env-from-description/references/interview.md` | `.claude/skills/rl-env-from-description/references/interview.md` | `8284ef8b809d6bcbbd76c9bee63baf1e23aae80a4f089d7daed02ec6cc285e9a` |
|
|
38
|
+
| `rl-env-from-description/references/nemo_gym.md` | `.claude/skills/rl-env-from-description/references/nemo_gym.md` | `48e2b011ad13454e38245dcb791a98a6496c1ea53cc909895e2350d50a303e74` |
|
|
39
|
+
| `rl-env-from-description/references/openenv.md` | `.claude/skills/rl-env-from-description/references/openenv.md` | `4550337161bac2e08fbf5ca6a5b58ca55c422cc06169669a784a9eb974e35bd6` |
|
|
40
|
+
| `rl-env-from-description/references/ors.md` | `.claude/skills/rl-env-from-description/references/ors.md` | `f409b75446e510b3837d770cebb592ff7dca0130def913f40ca427854aae1710` |
|
|
41
|
+
| `rl-env-from-description/references/verifiers.md` | `.claude/skills/rl-env-from-description/references/verifiers.md` | `761d8ff1f776cc16e485141e00fd5c6da5b9264d601dfa1787bd97f3657dfb46` |
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: generate-nemo-gym-env
|
|
3
|
+
description: Builds a NeMo Gym (NVIDIA) variant of an RL environment. Use whenever someone asks to scaffold a NeMo Gym Resources Server, port an existing env to NeMo Gym, expose tools as `app.post()` endpoints with cookie-based sessions, add a post-episode `/verify` reward grader, or deploy a NeMo Gym env to HF Spaces. NeMo Gym is the right framework when the user wants HTTP+REST with cookie session handling, raw `requests`-driven rollouts (no SDK client), Ray-based orchestration, or NVIDIA NeMo / TRL training integration with a `responses_create_params` + `ground_truth` dataset format. Output is a runnable `<env_dir>/nemo_gym/` folder with `server.py`, `pyproject.toml`, `Dockerfile`, `configs/<env>.yaml`, and `rollout.py`. Use for prompts like "wrap my env in NeMo Gym", "make a NeMo resources server for X", or "add a post-episode grader to my env".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# generate-nemo-gym-env
|
|
7
|
+
|
|
8
|
+
Build the NeMo Gym variant of an env. NeMo Gym is NVIDIA's RL gym layer, optimized for Ray-based orchestration and post-episode grading. The Python package is `nemo_gym` (installed via `pip install git+https://github.com/NVIDIA-NeMo/Gym`).
|
|
9
|
+
|
|
10
|
+
## Concept
|
|
11
|
+
|
|
12
|
+
NeMo Gym is NVIDIA's RL gym layer for LLM agents. It's built on Ray and ships a FastAPI-based `SimpleResourcesServer` that exposes one `POST /<tool>` endpoint per tool, plus the standard `/seed_session` (cookie-based session bootstrap) and `/verify` (post-episode grader). Targets [docs.nvidia.com/nemo/gym/latest](https://docs.nvidia.com/nemo/gym/latest/).
|
|
13
|
+
|
|
14
|
+
When the user has a shared domain module (`<domain>.py`) and wants a NeMo Gym variant, wrap it. Don't duplicate logic.
|
|
15
|
+
|
|
16
|
+
## Archetypes
|
|
17
|
+
|
|
18
|
+
| Archetype | Hallmarks |
|
|
19
|
+
|---|---|
|
|
20
|
+
| **Pure-Python game** | Single tool endpoint; `/verify` does substring match against `ground_truth`. |
|
|
21
|
+
| **Stateful sandbox** | Per-session sandbox in `self.sessions`; lazy init on first tool call. |
|
|
22
|
+
| **Vision / computer-use** | One endpoint per action; `/verify` rewards trajectories that called `terminate(success)`. |
|
|
23
|
+
|
|
24
|
+
## Recommended file layout
|
|
25
|
+
|
|
26
|
+
The user picks the actual paths. The canonical shape:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
<env_dir>/nemo_gym/
|
|
30
|
+
├── pyproject.toml # nemo_gym (git+) + e2b-* + fastapi + uvicorn + requests
|
|
31
|
+
├── __init__.py
|
|
32
|
+
├── Dockerfile # Ray-aware multi-stage
|
|
33
|
+
├── configs/<env>.yaml # NeMo Gym config (entrypoint, domain, description)
|
|
34
|
+
├── server.py # SimpleResourcesServer subclass with tool endpoints
|
|
35
|
+
├── rollout.py # raw requests + cookie session
|
|
36
|
+
└── README.md
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Note: NeMo Gym requires **Python 3.12+**.
|
|
40
|
+
|
|
41
|
+
## Implementation order
|
|
42
|
+
|
|
43
|
+
### 1. Server class — `server.py`
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from nemo_gym.base_resources_server import (
|
|
47
|
+
BaseResourcesServerConfig,
|
|
48
|
+
BaseSeedSessionRequest, BaseSeedSessionResponse,
|
|
49
|
+
BaseVerifyRequest, BaseVerifyResponse,
|
|
50
|
+
SimpleResourcesServer,
|
|
51
|
+
)
|
|
52
|
+
from nemo_gym.server_utils import SESSION_ID_KEY
|
|
53
|
+
from fastapi import FastAPI, Request
|
|
54
|
+
from pydantic import BaseModel, Field
|
|
55
|
+
from typing import Any, Dict
|
|
56
|
+
|
|
57
|
+
class MyConfig(BaseResourcesServerConfig):
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
class GuessReq(BaseModel):
|
|
61
|
+
word: str
|
|
62
|
+
|
|
63
|
+
class ToolResponse(BaseModel):
|
|
64
|
+
output: str
|
|
65
|
+
|
|
66
|
+
class MyVerifyRequest(BaseVerifyRequest):
|
|
67
|
+
ground_truth: list = []
|
|
68
|
+
|
|
69
|
+
class MyResourcesServer(SimpleResourcesServer):
|
|
70
|
+
config: MyConfig
|
|
71
|
+
sessions: Dict[str, Dict[str, Any]] = Field(default_factory=dict)
|
|
72
|
+
|
|
73
|
+
def setup_webserver(self) -> FastAPI:
|
|
74
|
+
app = super().setup_webserver()
|
|
75
|
+
app.post("/guess")(self.guess)
|
|
76
|
+
return app
|
|
77
|
+
|
|
78
|
+
async def seed_session(self, body: BaseSeedSessionRequest) -> BaseSeedSessionResponse:
|
|
79
|
+
return BaseSeedSessionResponse()
|
|
80
|
+
|
|
81
|
+
def _sess(self, request: Request) -> Dict[str, Any]:
|
|
82
|
+
sid = request.session[SESSION_ID_KEY]
|
|
83
|
+
if sid not in self.sessions:
|
|
84
|
+
self.sessions[sid] = {"game": WordleGame(), "step": 0}
|
|
85
|
+
return self.sessions[sid]
|
|
86
|
+
|
|
87
|
+
async def guess(self, body: GuessReq, request: Request) -> ToolResponse:
|
|
88
|
+
sess = self._sess(request)
|
|
89
|
+
feedback = sess["game"].guess(body.word)
|
|
90
|
+
sess["step"] += 1
|
|
91
|
+
return ToolResponse(output=feedback)
|
|
92
|
+
|
|
93
|
+
async def verify(self, body: MyVerifyRequest) -> BaseVerifyResponse:
|
|
94
|
+
# Compute reward from the response trajectory + ground truth
|
|
95
|
+
expected = ""
|
|
96
|
+
if body.ground_truth and isinstance(body.ground_truth, list):
|
|
97
|
+
expected = body.ground_truth[0].get("expected_output", "")
|
|
98
|
+
reward = 0.0
|
|
99
|
+
for item in body.response.output:
|
|
100
|
+
if hasattr(item, "type") and item.type == "function_call_output":
|
|
101
|
+
if expected and expected in getattr(item, "output", ""):
|
|
102
|
+
reward = 1.0; break
|
|
103
|
+
return BaseVerifyResponse(**body.model_dump(), reward=reward)
|
|
104
|
+
|
|
105
|
+
if __name__ == "__main__":
|
|
106
|
+
MyResourcesServer.run_webserver()
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Key contracts:
|
|
110
|
+
- **One endpoint per tool.** Register them in `setup_webserver()`. Pydantic models on the request body become the JSON shape.
|
|
111
|
+
- **Sessions live in `self.sessions`** keyed by `request.session[SESSION_ID_KEY]`. Lazy-init on first call. NeMo Gym sets the session cookie on `POST /seed_session`.
|
|
112
|
+
- **`verify()` is the grader.** Read `body.ground_truth` (passed by the trainer) and `body.response.output` (the trajectory). Return `BaseVerifyResponse(**body.model_dump(), reward=...)`.
|
|
113
|
+
|
|
114
|
+
### 2. NeMo Gym config — `configs/<name>.yaml`
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
my_env_resources_server:
|
|
118
|
+
resources_servers:
|
|
119
|
+
my_env:
|
|
120
|
+
entrypoint: server.py
|
|
121
|
+
domain: agent
|
|
122
|
+
description: "What this env does"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
This is the file the NeMo Gym CLI looks for when launching via `ng_run "+config_paths=[configs/my_env.yaml]"`.
|
|
126
|
+
|
|
127
|
+
### 3. Rollout — `rollout.py`
|
|
128
|
+
|
|
129
|
+
NeMo Gym has **no Python client SDK**. The rollout speaks raw HTTP via `requests` with a `Session` for cookie persistence:
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
import requests
|
|
133
|
+
session = requests.Session()
|
|
134
|
+
session.post(f"{ENV_URL}/seed_session", json={}).raise_for_status()
|
|
135
|
+
r = session.post(f"{ENV_URL}/guess", json={"word": "crane"})
|
|
136
|
+
result = r.json()["output"]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Tool definitions for the LLM are **hardcoded** in `rollout.py` (no introspection endpoint). Mirror the request schemas from `server.py` exactly.
|
|
140
|
+
|
|
141
|
+
### 4. Dockerfile
|
|
142
|
+
|
|
143
|
+
Multi-stage build. NeMo Gym pulls Ray and a fairly heavy stack — the Docker image is ~1.5GB. The container exposes port 11000 by default. For HF Spaces deployment, override to port 7860 (one-port limit on Spaces).
|
|
144
|
+
|
|
145
|
+
## Validation gates
|
|
146
|
+
|
|
147
|
+
1. **Import** — `uv run python -c "import os; os.environ.setdefault('E2B_API_KEY','x'); from server import MyResourcesServer"` succeeds.
|
|
148
|
+
2. **Local server** — try `uv run python server.py`. **Note**: NeMo Gym's `run_webserver()` initializes a Ray cluster, which fails on shared SLURM / HF cluster nodes (`gcs_server` can't bind). On those machines, only Docker / HF Space deploy works.
|
|
149
|
+
3. **Endpoint smoke** — when running, `curl http://localhost:11000/seed_session -X POST` returns 200 and sets a session cookie.
|
|
150
|
+
4. **Rollout** — `MAX_TURNS=3 uv run python rollout.py` drives end-to-end against the deployed Space.
|
|
151
|
+
|
|
152
|
+
## Common gotchas
|
|
153
|
+
|
|
154
|
+
- **`No module named 'anyio'`** — `nemo_gym` doesn't pin its full transitive set on every install. Add `anyio>=4.0`, `attrs>=23.0`, `fastapi>=0.115`, `uvicorn`, `requests` to your `dependencies` explicitly.
|
|
155
|
+
- **`Address already in use` or `gcs_server` crash** — Ray init failed. Almost always a shared cluster issue. Document this and tell the user to deploy via Space.
|
|
156
|
+
- **Cookie not set on the rollout** — make sure to use `requests.Session()`, not raw `requests.post()`. The session cookie is the SID handle.
|
|
157
|
+
- **`/verify` returns reward 0 unexpectedly** — `ground_truth` is wrapped in a list. Check `body.ground_truth[0].get("expected_output")` not `body.ground_truth.get(...)`.
|
|
158
|
+
- **Hardcoded tool schemas drift** — when you change a server endpoint's Pydantic body, manually update the matching tool definition in `rollout.py`. There's no `list_tools()`.
|
|
159
|
+
|
|
160
|
+
## Reference
|
|
161
|
+
|
|
162
|
+
- `references/architecture.md` — Ray orchestration, dataset format with `responses_create_params`, deployment notes
|
|
163
|
+
|
|
164
|
+
## Official documentation
|
|
165
|
+
|
|
166
|
+
- [NVIDIA-NeMo/Gym](https://github.com/NVIDIA-NeMo/Gym) — source repo
|
|
167
|
+
- [NeMo Gym latest docs](https://docs.nvidia.com/nemo/gym/latest/)
|
|
168
|
+
- [Creating a Resource Server tutorial](https://docs.nvidia.com/nemo/gym/latest/tutorials/creating-resource-server.html)
|
|
169
|
+
- [Creating a Training Environment tutorial](https://docs.nvidia.com/nemo/gym/latest/environment-tutorials/creating-training-environment.html)
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# NeMo Gym architecture (deep)
|
|
2
|
+
|
|
3
|
+
## What NeMo Gym is
|
|
4
|
+
|
|
5
|
+
NVIDIA's RL gym layer for LLM agents. Built on Ray for orchestration. The Python package is `nemo_gym` (install via `pip install git+https://github.com/NVIDIA-NeMo/Gym`). It targets NVIDIA's NeMo training stack but works with TRL/GRPO via raw HTTP.
|
|
6
|
+
|
|
7
|
+
## Wire protocol
|
|
8
|
+
|
|
9
|
+
| Method | Path | Purpose |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `POST` | `/seed_session` | Initialize a session (sets cookie) |
|
|
12
|
+
| `POST` | `/<tool>` | Each tool registered in `setup_webserver()` |
|
|
13
|
+
| `POST` | `/verify` | Post-episode reward grading |
|
|
14
|
+
|
|
15
|
+
The session cookie (set on `/seed_session`, named via `SESSION_ID_KEY`) is the only way to associate subsequent tool calls with state. **There is no SDK client** — rollouts speak raw HTTP.
|
|
16
|
+
|
|
17
|
+
## `SimpleResourcesServer` lifecycle
|
|
18
|
+
|
|
19
|
+
1. **`MyResourcesServer.run_webserver()`** at `__main__` — boots Ray, starts FastAPI, registers tools.
|
|
20
|
+
2. **`setup_webserver(self)`** — must call `super().setup_webserver()` first to get the `FastAPI` instance with `/seed_session` and `/verify` already registered, then `app.post("/tool")(self.tool)` for each tool.
|
|
21
|
+
3. **`seed_session(self, body)`** — called once per session by `POST /seed_session`. Return `BaseSeedSessionResponse()`. Lazy-init resources here or in the first tool call (recommended).
|
|
22
|
+
4. **Tool methods** — async, take `(self, body, request)`, return a Pydantic response. Read session id via `request.session[SESSION_ID_KEY]`.
|
|
23
|
+
5. **`verify(self, body)`** — async, called once per episode by the trainer. Return `BaseVerifyResponse(**body.model_dump(), reward=...)`. **Always spread the body back** — drops fields silently if you don't.
|
|
24
|
+
|
|
25
|
+
## Session state pattern
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
sessions: Dict[str, Dict[str, Any]] = Field(default_factory=dict)
|
|
29
|
+
|
|
30
|
+
def _sess(self, request: Request) -> Dict[str, Any]:
|
|
31
|
+
sid = request.session[SESSION_ID_KEY]
|
|
32
|
+
if sid not in self.sessions:
|
|
33
|
+
self.sessions[sid] = {"game": MyGame(), "step": 0}
|
|
34
|
+
return self.sessions[sid]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Session entries persist for the server's lifetime by default. For long-running deployments, either prune on `verify` or add a TTL.
|
|
38
|
+
|
|
39
|
+
## Dataset format
|
|
40
|
+
|
|
41
|
+
NeMo Gym expects datasets with two key fields:
|
|
42
|
+
|
|
43
|
+
- **`responses_create_params`** — a JSON-stringified OpenAI-Responses-API config (model, tools, system prompt). The trainer feeds this to the model.
|
|
44
|
+
- **`ground_truth`** — a list of dicts (typically one) carrying expected outputs / answer keys. `verify()` reads from this.
|
|
45
|
+
|
|
46
|
+
Example row:
|
|
47
|
+
```python
|
|
48
|
+
{
|
|
49
|
+
"responses_create_params": json.dumps({
|
|
50
|
+
"model": "gpt-4o-mini",
|
|
51
|
+
"input": [{"role": "user", "content": "Solve 2+2"}],
|
|
52
|
+
"tools": [{"type": "function", "function": {"name": "guess", ...}}],
|
|
53
|
+
}),
|
|
54
|
+
"ground_truth": [{"expected_output": "4"}],
|
|
55
|
+
"metadata": json.dumps({"task_id": "math-001"}),
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Reward computation in `/verify`
|
|
60
|
+
|
|
61
|
+
`body.response.output` is a list of items emitted by the model:
|
|
62
|
+
|
|
63
|
+
| Item type | Field |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `function_call` | `name`, `arguments` (JSON string) |
|
|
66
|
+
| `function_call_output` | `output` (the env's response to that call) |
|
|
67
|
+
| `message` | `content` (list of `output_text` etc.) |
|
|
68
|
+
|
|
69
|
+
Typical patterns:
|
|
70
|
+
|
|
71
|
+
**Substring match** — pass if expected appears anywhere:
|
|
72
|
+
```python
|
|
73
|
+
expected = body.ground_truth[0].get("expected_output", "")
|
|
74
|
+
reward = 0.0
|
|
75
|
+
for item in body.response.output:
|
|
76
|
+
if hasattr(item, "type") and item.type == "function_call_output":
|
|
77
|
+
if expected.strip() in str(getattr(item, "output", "")).strip():
|
|
78
|
+
reward = 1.0; break
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Function-call match** — pass if a specific tool was called with success:
|
|
82
|
+
```python
|
|
83
|
+
for item in body.response.output:
|
|
84
|
+
if getattr(item, "type", "") == "function_call" and item.name == "terminate":
|
|
85
|
+
args = item.arguments or ""
|
|
86
|
+
if "success" in args:
|
|
87
|
+
reward = 1.0; break
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Production deployment
|
|
91
|
+
|
|
92
|
+
`Dockerfile` is multi-stage; the runtime image is ~1.5GB because of Ray. Healthcheck via `/seed_session`. For HF Spaces:
|
|
93
|
+
|
|
94
|
+
- Port 7860 (one-port limit on Spaces)
|
|
95
|
+
- Set `app_port: 7860` in README frontmatter
|
|
96
|
+
- HF Spaces handle Ray init reliably (unlike shared SLURM nodes)
|
|
97
|
+
|
|
98
|
+
## Why `run_webserver()` fails on shared cluster nodes
|
|
99
|
+
|
|
100
|
+
NeMo Gym's `run_webserver()` calls `ray.init()`, which spawns a `gcs_server` process bound to specific ports. On shared SLURM / HF cluster nodes those ports are already taken, and the bind fails. The error looks like:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
[gcs_server] Failed to bind on address ...
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
There's no fix from the env author's side — deploy via Docker / Space and connect over network.
|
|
107
|
+
|
|
108
|
+
## What can go wrong
|
|
109
|
+
|
|
110
|
+
- **Cookie isn't set on the client** — use `requests.Session()`, not naked `requests.post()`.
|
|
111
|
+
- **`gcs_server` crash** — Ray init failure on shared nodes; redirect to deployed Space.
|
|
112
|
+
- **`No module named 'anyio'` / `attrs`** — NeMo Gym's transitive deps drift. Pin them explicitly.
|
|
113
|
+
- **Reward always 0 in verify** — `ground_truth` is a `list`, not a dict. Use `body.ground_truth[0].get(...)`.
|
|
114
|
+
- **`request.session[SESSION_ID_KEY]` raises KeyError** — `/seed_session` wasn't called first; fail fast with a clear error.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: generate-openenv-env
|
|
3
|
+
description: Builds an OpenEnv (Hugging Face) variant of an RL environment. Use whenever someone asks to scaffold an OpenEnv server, port an existing env to OpenEnv, add MCP tools to an env, or deploy an OpenEnv to HF Spaces. OpenEnv is the right framework when the user wants HTTP+MCP, structured tool calls discovered via `list_tools()`, an optional Gradio UI, sandbox-backed sessions, or deployment as a Docker container / HF Space. Output is a runnable `<env_dir>/openenv/` folder with `server/app.py`, `server/<env>_environment.py`, `pyproject.toml`, `Dockerfile`, and `rollout.py`. Use for prompts like "wrap my game in OpenEnv", "make an MCP env for X", or "add the openenv variant".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# generate-openenv-env
|
|
7
|
+
|
|
8
|
+
Build the OpenEnv variant of an env. Targets OpenEnv >= 0.4.1 (the `openenv` package — formerly `openenv-core[core]`).
|
|
9
|
+
|
|
10
|
+
## Concept
|
|
11
|
+
|
|
12
|
+
OpenEnv is an HTTP server exposing tools via the **MCP** (Model Context Protocol) shape. The runtime is FastAPI; tools are FastMCP-decorated functions. Clients discover tools via `list_tools()` (under the hood: a list-tools action on `/step`) and call them via `call_tool(name, **args)`.
|
|
13
|
+
|
|
14
|
+
When the user has a shared domain module (`<domain>.py`) and wants an OpenEnv variant, **never duplicate domain logic into the framework folder** — wrap it.
|
|
15
|
+
|
|
16
|
+
## Archetypes (pick the one matching the task)
|
|
17
|
+
|
|
18
|
+
| Archetype | Hallmarks |
|
|
19
|
+
|---|---|
|
|
20
|
+
| **Pure-Python game** | Deterministic, single `@mcp.tool`, text-only observations. Reward computed externally from the trajectory. |
|
|
21
|
+
| **Stateful sandbox** | E2B / browser / DB, multiple tools mutating session state, MCPEnvironment per session. |
|
|
22
|
+
| **Vision / computer-use** | Screenshots returned as MCP image content blocks (`fastmcp.utilities.types.Image`), 19-tool action surface modelled on Anthropic's `computer_20251124`, optional custom Gradio UI mounted at `/web`. |
|
|
23
|
+
|
|
24
|
+
## Recommended file layout
|
|
25
|
+
|
|
26
|
+
The user picks the actual paths. The canonical shape:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
<env_dir>/openenv/
|
|
30
|
+
├── pyproject.toml # openenv + e2b-* + fastmcp + uvicorn + gradio
|
|
31
|
+
├── __init__.py
|
|
32
|
+
├── models.py # Pydantic State / typed action / observation models
|
|
33
|
+
├── Dockerfile # multi-stage from ghcr.io/huggingface/openenv-base
|
|
34
|
+
├── openenv.yaml # spec_version 1, name, runtime, app, port
|
|
35
|
+
├── server/
|
|
36
|
+
│ ├── __init__.py
|
|
37
|
+
│ ├── app.py # create_app(EnvCls, CallToolAction, CallToolObservation, env_name=...)
|
|
38
|
+
│ └── <env>_environment.py # MCPEnvironment subclass with @mcp.tool methods
|
|
39
|
+
├── rollout.py # MCPToolClient drives the server; auto-discovers tools
|
|
40
|
+
└── README.md # one-page; with HF frontmatter if deploying to Spaces
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Implementation order (one continuous pass)
|
|
44
|
+
|
|
45
|
+
### 1. Pydantic state model — `models.py`
|
|
46
|
+
|
|
47
|
+
Subclass `openenv.core.env_server.types.State`. Add per-episode fields you'll mutate (`step_count`, `last_output`, sandbox/session ids, anything you want to inspect later).
|
|
48
|
+
|
|
49
|
+
For visual envs, add `last_screenshot_b64`. Don't store huge blobs unless you need them in `state` — use `metadata` on observations instead.
|
|
50
|
+
|
|
51
|
+
### 2. The MCPEnvironment — `server/<name>_environment.py`
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
class MyEnv(MCPEnvironment):
|
|
55
|
+
SUPPORTS_CONCURRENT_SESSIONS = True # only if real session isolation
|
|
56
|
+
def __init__(self):
|
|
57
|
+
# ... env-side state init
|
|
58
|
+
mcp = FastMCP("my_env")
|
|
59
|
+
@mcp.tool
|
|
60
|
+
def my_tool(arg: int) -> str: ...
|
|
61
|
+
super().__init__(mcp)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Key contracts:
|
|
65
|
+
- **Dual-import pattern.** Inside `server/`, write `try: from ..models import X; except ImportError: from models import X`. Relative imports work inside the repo (`PYTHONPATH=src:envs`); flat imports work in Docker (`/app/env`). Same applies to sibling modules like `e2b_sandbox.py`.
|
|
66
|
+
- **Tool methods** are `@mcp.tool` decorated functions inside `__init__`. They close over `self` and read/write env state. Don't try to put `@mcp.tool` on instance methods — FastMCP introspects free functions.
|
|
67
|
+
- **For images**, use `fastmcp.utilities.types.Image`: `return Image(data=png_bytes, format="png")`. The model receives an MCP image content block. Returning a base64 string in text means the model is blind.
|
|
68
|
+
- **Lifecycle hooks**: `reset(seed=None, episode_id=None, **kwargs)` returns an `Observation`; `step(action, timeout_s=None, **kwargs)` is inherited from `MCPEnvironment` for tool dispatch — only override if you need pre/post hooks (e.g. step-counter increment, terminate signal handling).
|
|
69
|
+
|
|
70
|
+
### 3. The FastAPI app — `server/app.py`
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import os
|
|
74
|
+
from openenv.core.env_server.http_server import create_app
|
|
75
|
+
from openenv.core.env_server.mcp_types import CallToolAction, CallToolObservation
|
|
76
|
+
try:
|
|
77
|
+
from .my_environment import MyEnv
|
|
78
|
+
from .gradio_ui import my_ui_builder # only if you have a custom UI
|
|
79
|
+
except ImportError:
|
|
80
|
+
from server.my_environment import MyEnv
|
|
81
|
+
from server.gradio_ui import my_ui_builder
|
|
82
|
+
|
|
83
|
+
def _custom_gradio_builder(*args, **kwargs):
|
|
84
|
+
return my_ui_builder(env_factory=MyEnv)
|
|
85
|
+
|
|
86
|
+
os.environ["ENABLE_WEB_INTERFACE"] = "true"
|
|
87
|
+
app = create_app(
|
|
88
|
+
MyEnv, CallToolAction, CallToolObservation,
|
|
89
|
+
env_name="my_env",
|
|
90
|
+
max_concurrent_envs=int(os.getenv("MAX_CONCURRENT_ENVS", "4")),
|
|
91
|
+
gradio_builder=_custom_gradio_builder, # omit if no custom UI
|
|
92
|
+
)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Pass the **class** to `create_app`, not an instantiated env.
|
|
96
|
+
|
|
97
|
+
### 4. Custom Gradio UI (optional, computer-use-style envs benefit)
|
|
98
|
+
|
|
99
|
+
`server/gradio_ui.py` defines `my_ui_builder(env_factory)` that returns a `gr.Blocks`. Mounted at `/web` (set `base_path: /web` in the HF Space frontmatter). For computer-use envs, the canonical pattern includes an iframe panel showing the E2B stream URL alongside text controls — but any `gr.Blocks` layout works.
|
|
100
|
+
|
|
101
|
+
### 5. The rollout — `rollout.py`
|
|
102
|
+
|
|
103
|
+
Use `openenv.core.mcp_client.MCPToolClient`. **Discover** tools, don't hardcode:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from openenv.core.mcp_client import MCPToolClient
|
|
107
|
+
with MCPToolClient(base_url=ENV_URL).sync() as env:
|
|
108
|
+
env.reset()
|
|
109
|
+
tools = env.list_tools() # list of ToolSpec
|
|
110
|
+
# convert to OpenAI tool schemas, drive the LLM, call env.call_tool(name, **args)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Note: for **image-returning tools**, `env.call_tool` strips to `result.data` (which is `None` for image returns). Use `env.step(CallToolAction(tool_name="screenshot", arguments={}))` to get the full result dict, then read `obs.result["content"][0]["data"]` for the b64 image. Pattern:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
def _call(env, name, **kwargs):
|
|
117
|
+
out = env.step(CallToolAction(tool_name=name, arguments=kwargs))
|
|
118
|
+
return out.observation.result or {}
|
|
119
|
+
|
|
120
|
+
def _b64_screenshot(env):
|
|
121
|
+
res = _call(env, "screenshot")
|
|
122
|
+
for c in res.get("content", []) or []:
|
|
123
|
+
if c.get("type") == "image" and c.get("data"):
|
|
124
|
+
return c["data"]
|
|
125
|
+
raise RuntimeError(f"screenshot returned no image: {res}")
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
For multimodal models (Qwen3-VL, GPT-4o), feed the latest screenshot as an image block in the user message every turn.
|
|
129
|
+
|
|
130
|
+
### 6. The Dockerfile
|
|
131
|
+
|
|
132
|
+
Use a multi-stage build:
|
|
133
|
+
- `FROM ghcr.io/huggingface/openenv-base:latest` (the official base — already has FastAPI, MCP, Gradio).
|
|
134
|
+
- `uv sync` twice (no-install-project, then with project) for cache friendliness.
|
|
135
|
+
- Healthcheck via `/health`.
|
|
136
|
+
- Expose port 8000.
|
|
137
|
+
|
|
138
|
+
For HF Spaces, the canonical `app_port` is **8000** (not 7860 — OpenEnv's pattern uses 8000). Set `base_path: /web` in the README frontmatter so Gradio mounts under that prefix.
|
|
139
|
+
|
|
140
|
+
### 7. The HF Space README frontmatter
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
---
|
|
144
|
+
title: My Env Server
|
|
145
|
+
emoji: 🤖
|
|
146
|
+
colorFrom: blue
|
|
147
|
+
colorTo: purple
|
|
148
|
+
sdk: docker
|
|
149
|
+
pinned: false
|
|
150
|
+
app_port: 8000
|
|
151
|
+
base_path: /web
|
|
152
|
+
tags: [openenv, your-domain]
|
|
153
|
+
short_description: One-line summary
|
|
154
|
+
---
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Validation gates
|
|
158
|
+
|
|
159
|
+
Before declaring done, all four must pass:
|
|
160
|
+
|
|
161
|
+
1. **In-repo import** — `PYTHONPATH=envs uv run python -c "from envs.<name>.openenv.server.<name>_environment import <Cls>"`
|
|
162
|
+
2. **Local server** — `uv run uvicorn server.app:app --port 8000` then `curl /health` returns `{"status":"healthy"}` and `/list_environments` returns the env name.
|
|
163
|
+
3. **Tool discovery** — `MCPToolClient.list_tools()` returns the expected list.
|
|
164
|
+
4. **Rollout** — `MAX_TURNS=3 uv run python rollout.py` runs without errors.
|
|
165
|
+
|
|
166
|
+
## Common gotchas (from real-world OpenEnv work)
|
|
167
|
+
|
|
168
|
+
- **`KeyError: 'tools'` from POST /list_tools** — OpenEnv doesn't expose `/list_tools` directly; `MCPToolClient` uses `/step` with a list-tools action under the hood. Always discover via the client.
|
|
169
|
+
- **Screenshot returns `None`** — `env.call_tool("screenshot")` returns only the structured `data` field. Use `env.step(CallToolAction(...))` and read `obs.result["content"]`.
|
|
170
|
+
- **`address already in use`** — common during local-dev iteration. Just pick a different `--port`.
|
|
171
|
+
- **`ModuleNotFoundError` in Docker but works locally** — missing dual-import pattern in `server/app.py` or `server/<name>_environment.py`.
|
|
172
|
+
|
|
173
|
+
## Reference
|
|
174
|
+
|
|
175
|
+
- `references/architecture.md` — full architecture deep-dive (when needed)
|
|
176
|
+
|
|
177
|
+
## Official documentation
|
|
178
|
+
|
|
179
|
+
- [huggingface/OpenEnv](https://github.com/huggingface/OpenEnv) — source repo
|
|
180
|
+
- [OpenEnv docs](https://huggingface.co/docs/openenv) — environment-builder + Core API
|
|
181
|
+
- [Build your first environment](https://huggingface.co/docs/openenv/guides/first-environment)
|
|
182
|
+
- [HF org](https://huggingface.co/openenv) — example deployments
|
|
183
|
+
- Upstream ships a `generate-openenv-env` skill at `.claude/skills/generate-openenv-env/` in their repo — useful as a second opinion if behaviour is unclear.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# OpenEnv architecture (deep)
|
|
2
|
+
|
|
3
|
+
## Wire protocol
|
|
4
|
+
|
|
5
|
+
OpenEnv uses MCP over HTTP. The server exposes:
|
|
6
|
+
|
|
7
|
+
- `GET /health` → `{"status": "healthy"}`
|
|
8
|
+
- `GET /metadata` → env name + description
|
|
9
|
+
- `GET /openapi.json` → full OpenAPI schema
|
|
10
|
+
- `POST /reset` → start a new episode (body matches `reset()`'s kwargs)
|
|
11
|
+
- `POST /step` → execute an `Action` (`CallToolAction` for tool calls)
|
|
12
|
+
- `GET /state` → fetch the current `State` object
|
|
13
|
+
- `GET /web/...` → optional Gradio UI mount (when `ENABLE_WEB_INTERFACE=true`)
|
|
14
|
+
|
|
15
|
+
The MCP-specific surface lives behind `/step`: a `CallToolAction(tool_name="x", arguments={...})` returns a `CallToolObservation(result={"content": [...], "data": ..., "is_error": ...})`. Tool discovery is via a **list-tools action**, not a separate REST endpoint — `MCPToolClient.list_tools()` does this transparently.
|
|
16
|
+
|
|
17
|
+
## `MCPEnvironment` lifecycle
|
|
18
|
+
|
|
19
|
+
1. **`__init__`** — register tools on a `FastMCP` instance, then `super().__init__(mcp)`. Don't allocate per-episode state here; it'll outlive episodes.
|
|
20
|
+
2. **`reset(seed, episode_id, **kwargs)`** — called once per episode. Allocate the sandbox, store session ids in `self._state`, return an `Observation(done=False, reward=None, metadata={...})`.
|
|
21
|
+
3. **`step(action, timeout_s, **kwargs)`** — inherited; dispatches `CallToolAction` to the right `@mcp.tool` function. Override only if you need pre/post hooks (step counter, terminate detection).
|
|
22
|
+
4. **`step_async(...)`** — same but async. If you override `step`, override this too.
|
|
23
|
+
5. **`_step_impl(action, ...)`** — fallback for non-MCP `Action` types. Usually return an error observation.
|
|
24
|
+
6. **`state` property** — returns the current state for `/state` endpoint.
|
|
25
|
+
|
|
26
|
+
## Concurrent sessions
|
|
27
|
+
|
|
28
|
+
`SUPPORTS_CONCURRENT_SESSIONS = True` enables the framework to multiplex sessions inside one process. **Only set this if you actually isolate state per session-id** — otherwise sessions clobber each other.
|
|
29
|
+
|
|
30
|
+
For sandbox-per-episode envs: usually *don't* set this true. Run multiple replicas of the env instead (set `max_concurrent_envs` in `create_app`).
|
|
31
|
+
|
|
32
|
+
## Tool returns
|
|
33
|
+
|
|
34
|
+
FastMCP serializes tool returns by inspecting the type:
|
|
35
|
+
|
|
36
|
+
| Return type | Becomes | Model sees |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `str` | `TextContent(type="text", text=...)` | the string |
|
|
39
|
+
| `Image(data=bytes, format="png")` | `ImageContent(type="image", data=<base64>, mimeType="image/png")` | the actual pixels |
|
|
40
|
+
| `dict` | `TextContent` with JSON-serialized `text` | the JSON string |
|
|
41
|
+
| Pydantic model | structured `data` field | depends on client |
|
|
42
|
+
|
|
43
|
+
For computer-use / vision envs, **always** use `Image`. Returning base64 in a string makes the model effectively blind.
|
|
44
|
+
|
|
45
|
+
## Custom Gradio UI
|
|
46
|
+
|
|
47
|
+
Pass `gradio_builder=` to `create_app`. The signature is:
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
def builder(web_manager, action_fields, metadata, is_chat_env, title, quick_start_md) -> gr.Blocks: ...
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
You can ignore most args and just instantiate the env yourself inside the builder. For computer-use envs, the canonical pattern includes an iframe panel showing the E2B sandbox stream URL alongside text controls.
|
|
54
|
+
|
|
55
|
+
## Dual-import idiom
|
|
56
|
+
|
|
57
|
+
Inside `server/`, files use:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
try:
|
|
61
|
+
from .models import State # works in repo (PYTHONPATH=src:envs)
|
|
62
|
+
except ImportError:
|
|
63
|
+
from models import State # works in Docker (PYTHONPATH=/app/env)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Same applies inside `server/<env>_environment.py` for sibling modules. **Always include both.** OpenEnv's CLI builds Docker images that flatten the package layout; the relative import will fail there.
|
|
67
|
+
|
|
68
|
+
## Production deployment
|
|
69
|
+
|
|
70
|
+
`Dockerfile` uses `ghcr.io/huggingface/openenv-base:latest` as a multi-stage builder. The runtime image copies the venv and source. Healthcheck via `/health`. For HF Spaces:
|
|
71
|
+
|
|
72
|
+
- `app_port: 8000` in README frontmatter
|
|
73
|
+
- `base_path: /web` if you want the Gradio UI mounted
|
|
74
|
+
- `E2B_API_KEY` (and any other secrets) as Space secrets, not env vars
|
|
75
|
+
- `MAX_CONCURRENT_ENVS=2` typically — sandbox-per-episode is RAM-heavy
|
|
76
|
+
|
|
77
|
+
## What can go wrong
|
|
78
|
+
|
|
79
|
+
- `KeyError: 'tools'` from `POST /list_tools` — that endpoint doesn't exist. Use `MCPToolClient`.
|
|
80
|
+
- Screenshot returns `None` from `env.call_tool("screenshot")` — the convenience method strips to structured `data`. Use `env.step(CallToolAction(...))` and read `obs.result["content"]`.
|
|
81
|
+
- `from ..module import X` fails in Docker — missing dual-import.
|
|
82
|
+
- `ENABLE_WEB_INTERFACE=true` set but no `gradio_builder` passed — Gradio mounts a default UI; set `os.environ["ENABLE_WEB_INTERFACE"]` before `create_app` if you want the custom one.
|