What is Weaver?
Weaver is a training API and managed training service for large language models. You write a local Python training loop that defines data, losses, sampling, and evaluation logic; Weaver runs the forward pass, backward pass, optimizer step, weight export, and sampling service on remote GPU infrastructure.
It is designed for researchers and engineering teams iterating on SFT, RLHF, agentic training, or custom training algorithms. You keep control over the training loop without operating distributed training, inference weight sync, checkpoint storage, and job scheduling yourself.
Weaver is inspired by Thinking Machines Lab's Tinker and integrates deeply with the Nex-AGI agent ecosystem, including NexRL and NexAU.
Core Idea
Large-model training usually requires data pipelines, distributed parallelism, memory planning, recovery, weight export, and inference serving. Weaver exposes those pieces through a small set of APIs:
- Submit tokenized training data and loss inputs.
- Run
forward()orforward_backward()on managed trainers. - Call
optim_step()at the pace your algorithm requires. - Export weights and create a
SamplingClientfor evaluation or rollout. - Save and restore checkpoints when experiments need to resume.
Changing models is usually a matter of changing the base_model string. Long-context variants can be selected with suffixes such as Qwen/Qwen3-8B:262144.
Responsibilities
| You focus on | You write | Weaver handles |
|---|---|---|
| Training data, environments, and evaluation | Local Python training scripts | Remote GPU training and scheduling |
| Losses, sampling strategy, training loop | Datum, loss inputs, optimizer parameters | Model loading, distributed execution, weight sync |
| SFT/RL/Agent algorithm details | forward_backward(), optim_step(), sample() calls | Queues, recovery, checkpoint storage |
Current Capabilities
- Training modes: LoRA by default, with full fine-tuning via
training_mode="full_ft". - Configurable LoRA: rank, seed, attention, MLP, and unembedding controls.
- Core training APIs:
forward(),forward_backward(),optim_step(), andforward_backward_custom(). - Sampling and evaluation: export sampler weights, create sampling sessions, and compute prompt logprobs.
- Checkpoint management:
save_state(),load_state(),load_state_with_optimizer(),list_checkpoints(), and TTL management. - RL and Agent integration: use NexRL for rollout, trajectory pools, policy updates, and NexAU tool-using agents.
When to Use Weaver
Fast SFT experiments: run data processing, cross-entropy training, sampling checks, and weight saves with minimal setup.
Reinforcement learning: control rollout, rewards, advantages, and optimizer cadence locally while Weaver handles the training backend.
Agentic model training: send NexAU agent trajectories through NexRL and Weaver to train models that use tools and solve multi-step tasks.
Custom algorithm research: use forward() for logprobs or forward_backward_custom() to propagate gradients from a local PyTorch loss back to Weaver.
Next Steps
- Installation: install the SDK and run your first training script.
- Training and Sampling: learn clients, data format, training loops, and sampling APIs.
- Loss Functions: explore built-in SFT/RL losses and custom loss paths.
- Saving and Loading: manage sampler exports and durable checkpoints.
- Model Lineup: choose models for SFT, RL, or agent training.