AI product Open source

OPAL

OPAL (OPtimizer with an Agent in the Loop) is a PyTorch optimizer wrapper developed by Xingjian Bai and contributors. It turns a fixed optimizer into two editable programs: an updater that converts gradients into parameter updates, and an analysis program that reports training statistics. A coding agent, Claude Code by default, periodically reads the goal, losses, gradients, and analysis reports, then can rewrite learning rates and schedules, momentum, preconditioning, clipping, parameter-group update rules, and related optimizer logic while training continues. New programs are trialed for 20 steps and can be reverted on errors when a parameter-and-state snapshot is available; until a change is made, the wrapped run is bit-for-bit equivalent to the original optimizer run. OPAL supports CPU, single-GPU, and single-node DDP PyTorch training, with integrations for selected Hugging Face Trainer and Accelerate workflows, but does not support multi-node training, FSDP, or DeepSpeed. Agent runs require Claude Code and an authenticated account, while the keep backend provides an agent-free dry run. The project is distributed under the MIT license.

View repository Mentioned in 1 video ↓

What OPAL is used for

1 use taken from transcripts — each links to the moment in the video.

  • A system that allows a coding agent to rewrite a PyTorch optimizer while the model is training, adjusting update rules or learning rates based on training statistics.

Videos mentioning OPAL

1 in the library.