Weco LogoWeco Docs

Overview

Weco is an autoresearch engine that iteratively rewrites your code to improve a metric you define.

Weco is an autoresearch engine for code. You point it at your codebase, give it a way to measure success, and it iteratively rewrites that code - running your evaluation after every change - until it finds the best-performing version.

What it does

Weco uses LLMs and tree search (our AIDE algorithm) to optimize code against a metric you define:

  1. You give it code to optimize and an evaluation script that prints a number (for example, speedup: 2.5).
  2. Weco proposes a change, runs your evaluation, and reads the metric from the output.
  3. It keeps changes that improve the metric and builds on them, exploring a tree of variants over many steps.
  4. When it finishes, your file holds the best version it found.

It works with any language and on any hardware - the only requirement is that you can express "better" as a number.

When to use it

Weco is a good fit when:

  • You have a measurable goal - speed, accuracy, latency, memory, cost, throughput, or a quality score.
  • The problem rewards trial and error - there are many ways to write the code and the best one isn't obvious up front.
  • You can write (or already have) an evaluation script that runs the code and prints the metric.

Common uses include optimizing GPU kernels (CUDA, Triton), tuning ML models, engineering prompts, and speeding up or shrinking general-purpose code.

It's not the right tool when there's no way to measure success as a number, or when a single deterministic edit would do. Weco's value comes from iterating against a metric.

Get started

The fastest way to start is to let your AI coding assistant install and set up Weco for you. Visit our Quickstart to get optimizing.

If you'd rather drive the CLI yourself, see the Manual Installation instructions and Optimize with the CLI.

On this page