Laguna S 2.1: Local Agentic Coding Performance
Prompt Engineeringgo watch the original →
the gist
Laguna S 2.1 is an 118B MoE coding model (8B active parameters) that achieves 70% on Terminal Bench 2.1 using FP8 reinforcement learning and speculative decoding to run efficiently on local hardware.
Model Architecture and Training
Laguna S 2.1 is a Mixture-of-Experts (MoE) model with 118 billion total parameters and 8 billion active parameters per token. It features a 1 million-token context window and was trained using reinforcement learning (RL) in FP8 precision on approximately 4,000 NVIDIA H200 GPUs in under nine weeks. The training process focused on recovering the reasoning steps behind code rather than just the final output.
Mitigating Reward Hacking
To prevent the model from optimizing for scores rather than task completion, the developers implemented three specific safeguards:
- Used an external LLM judge to evaluate full agent trajectories, calibrated against human-labeled runs.
- Applied prompt amendments to explicitly define forbidden behaviors.
- Implemented network-blocked sandboxes to prevent the agent from fetching external solutions during evaluation.
Local Execution and Performance
The model is distributed in NVFP4 quantization, requiring approximately 70 GB of VRAM, which fits within the 128 GB unified memory of the NVIDIA DGX Spark. To overcome memory-bound generation speeds, the model utilizes speculative decoding with a small, five-layer draft model (based on D-Flash) to verify output in blocks rather than token-by-token. This approach increases generation speed from 12-15 tokens per second to approximately 84 tokens per second on the DGX Spark.