Skip to content

What is Weaver?

Weaver is a training API designed for researchers and developers working with large language models. As an ecosystem-oriented product, it seamlessly integrates with various agent frameworks (such as NexAU) and RL training frameworks (such as NexRL), enabling flexible fine-tuning of agentic models. Weaver lets you focus on what matters – you data, algorithms and agents – while handling the complexity of distributed training infrastructure.

Weaver is inspired by Thinking Machine Labs' Tinker.

Key Concepts

You write a simple training loop that runs on your machine, specifying your data and loss function. Weaver figures out how to make the training work efficiently on distributed GPUs, executing the exact computation you specified. To change the model you're working with, you only need to change a single string in your code.

Weaver gives you full control over the training loop and algorithmic details. It's not a magic black box – it's a clean abstraction that shields you from distributed training complexity while preserving your control.

Division of Responsibilities

You Focus OnYou WriteWeaver Handles
Your training data and environmentsSimple Python script that runs locallyDistributed training across GPUs
Your training logic: loss functions, training loops, evaluationsAPI calls: forward_backward(), optim_step(), sample()Infrastructure reliability and failure recovery

Current Features

What Weaver currently supports:

  • Model Support: Fine-tune open-weight models like Qwen3-8B
  • LoRA Training: Implements low-rank adaptation (LoRA) fine-tuning for efficient training
  • Weight Management: Download trained model weights for use with any inference provider
  • Flexible Loss Functions: Built-in support for cross_entropy and importance_sampling losses

Core Functionality

Weaver's main functionality is contained in a few key functions:

  • forward_backward(): Feed in your data and loss function to compute and accumulate gradients
  • optim_step(): Update your model using accumulated gradients
  • sample(): Generate outputs from your trained model
  • save_weights_for_sampler(): Save model weights for inference
  • compute_logprobs(): Compute log probabilities for sequences
  • save_state(): Save training state (model weights, optimizer state, etc.) for checkpointing
  • load_state(): Load a previously saved training state to resume training

Why Weaver?

Simplicity: Clean, intuitive APIs focused on your training logic, not infrastructure.

Flexibility: Full control over training loops, loss functions, and algorithmic details.

Efficiency: Optimized distributed training without the complexity of manual configuration.

Next Steps

Weaver API Documentation