# Laguna XS for Rust Refactoring

> Source: <https://www.dotnetperls.com/2026_9_8_laguna-xs-for-rust-refactoring>
> Published: 2026-09-08 07:00:00+00:00

Trying to find a decent solution for **local AI coding** has been difficult for me. My GPU is only 12 GB, although it is Nvidia. So I am relegated to smaller models or Mixture-of-Experts models. I have had some pretty bad experiences with performance and crazy file editing problems.

After taking a little AI break, I decided to use **Laguna XS 2.1** and **refactor** (simplify) a **Rust function**. I had written this function by hand and I wanted to clean it up. I had over-optimized it, and it turns out a different optimization makes this function less important for performance than I had initially assumed.

With OpenCode and Laguna XS 2.1:

• I renamed a function, changed how it tracks results, and changed how it iterates over possible matches.

• The harness and LLM worked well with minimal errors, and my task was successfully completed.

With small local models like Laguna XS 2.1, the trick is to treat them as a **typing assistant**. You have to tell the model what to do—what arguments to add and remove. It only works for minimal steps at once. So it is mostly like a typing accelerator—not a fully automatic vibe coding machine.
