Weco LogoWeco Docs

Hello, World!

Get started with Weco in 5 minutes. Install the CLI, run your first code optimization, and see AI-driven improvements in real time.

Here is the quickest way to get started with Weco. This tutorial speeds up a simple PyTorch module to demonstrate core features.

Open In Colab

Before you begin: Make sure you have a terminal and Python 3.9 or newer installed.

Run your first optimization

Install Weco CLI

curl -fsSL https://weco.ai/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://weco.ai/install.ps1 | iex"
irm https://weco.ai/install.ps1 | iex
pip install weco
git clone https://github.com/wecoai/weco-cli.git
cd weco-cli
pip install -e .

Download the example project

git clone https://github.com/WecoAI/weco-cli.git
cd weco-cli/examples/hello-world/

Create a virtual environment and install the dependencies:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt

Run the optimization

🎉 Weco is now available as a skill for AI coding assistants! A skill is a set of instructions that teaches your assistant how to use Weco. It knows how to set up optimizations, run them, and interpret the results. Just describe what you want in plain language and your assistant handles the rest.

Set up the Weco skill

weco setup claude-code

This installs the Weco skill into Claude Code. Once installed, Claude can invoke Weco whenever you ask it to optimize something - no need to remember CLI flags or configuration.

Open the project

claude

Prompt your assistant

Just tell Claude what you want to improve:

Use the Weco skill to make the forward pass faster.

Claude will guide you through the optimization process and run the Weco CLI for you.

What to expect

Your assistant will:

  1. Inspect the example project and understand the code
  2. Configure and run the Weco optimization on module.py
  3. Monitor the iterations as they progress
  4. Explain what changed and how much faster the code got

🎉 Weco is now available as a skill for AI coding assistants! A skill is a set of instructions that teaches your assistant how to use Weco. It knows how to set up optimizations, run them, and interpret the results. Just describe what you want in plain language and your assistant handles the rest.

Set up the Weco skill

weco setup cursor

This installs the Weco skill plus an always-on Cursor rule. Once installed, Cursor can invoke Weco whenever you ask it to optimize something - no need to remember CLI flags or configuration.

Open the project

cursor .

Prompt your assistant

Just tell Cursor what you want to improve:

Use the Weco skill to make the forward pass faster.

Cursor will guide you through the optimization process and run the Weco CLI for you.

What to expect

Your assistant will:

  1. Inspect the example project and understand the code
  2. Configure and run the Weco optimization on module.py
  3. Monitor the iterations as they progress
  4. Explain what changed and how much faster the code got

Run the optimization directly from the terminal with weco run:

weco run --source module.py \
    --eval-command "python evaluate.py --path module.py" \
    --metric speedup \
    --goal maximize \
    --steps 10 \
    --additional-instructions "Fuse operations in the forward method while ensuring the max float deviation remains small. Maintain the same format of the code."
weco run --source module.py ^
    --eval-command "python evaluate.py --path module.py" ^
    --metric speedup ^
    --goal maximize ^
    --steps 10 ^
    --additional-instructions "Fuse operations in the forward method while ensuring the max float deviation remains small. Maintain the same format of the code."
weco run --source module.py `
    --eval-command "python evaluate.py --path module.py" `
    --metric speedup `
    --goal maximize `
    --steps 10 `
    --additional-instructions "Fuse operations in the forward method while ensuring the max float deviation remains small. Maintain the same format of the code."

This kicks off 10 iterations. At each step, Weco generates an improved version of module.py, runs evaluate.py to measure speedup, and uses the result to guide its next change. When it finishes, module.py contains the fastest correct version discovered.

Weco Optimization Example

Monitor your optimization

Every optimization is tracked in the Weco dashboard, where you can watch progress in real time, compare iterations, and share results with your team.

Here's what the Hello, World! run looks like — view the run in the dashboard:

Hello world dashboard

🎯 Next Step: Optimize Your Own Code

Great job! You've successfully run Weco on an example project. Now it's time to apply it to your own code.

In the next guide, you'll learn:

  • ✅ How to create evaluation scripts for your code
  • ✅ Step-by-step instructions to optimize your own projects
  • ✅ Best practices for getting the best results from Weco

On this page