weco 0.3.2__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. {weco-0.3.2 → weco-0.3.4}/.gitignore +3 -0
  2. {weco-0.3.2 → weco-0.3.4}/PKG-INFO +31 -95
  3. {weco-0.3.2 → weco-0.3.4}/README.md +30 -94
  4. weco-0.3.4/assets/example-optimization.gif +0 -0
  5. weco-0.3.4/examples/README.md +148 -0
  6. {weco-0.3.2 → weco-0.3.4}/examples/cuda/README.md +7 -6
  7. {weco-0.3.2 → weco-0.3.4}/examples/cuda/evaluate.py +2 -2
  8. weco-0.3.4/examples/cuda/requirements.txt +4 -0
  9. {weco-0.3.2/examples/hello-kernel-world → weco-0.3.4/examples/hello-world}/README.md +8 -7
  10. weco-0.3.4/examples/hello-world/colab_notebook_walkthrough.ipynb +277 -0
  11. {weco-0.3.2/examples/hello-kernel-world → weco-0.3.4/examples/hello-world}/evaluate.py +2 -2
  12. weco-0.3.4/examples/hello-world/requirements.txt +1 -0
  13. {weco-0.3.2 → weco-0.3.4}/examples/triton/README.md +7 -6
  14. {weco-0.3.2 → weco-0.3.4}/examples/triton/evaluate.py +2 -2
  15. weco-0.3.4/examples/triton/requirements.txt +3 -0
  16. {weco-0.3.2 → weco-0.3.4}/pyproject.toml +1 -1
  17. {weco-0.3.2 → weco-0.3.4}/weco/api.py +1 -2
  18. {weco-0.3.2 → weco-0.3.4}/weco/cli.py +14 -3
  19. {weco-0.3.2 → weco-0.3.4}/weco/optimizer.py +101 -50
  20. {weco-0.3.2 → weco-0.3.4}/weco/panels.py +26 -0
  21. {weco-0.3.2 → weco-0.3.4}/weco/utils.py +35 -0
  22. {weco-0.3.2 → weco-0.3.4}/weco.egg-info/PKG-INFO +31 -95
  23. {weco-0.3.2 → weco-0.3.4}/weco.egg-info/SOURCES.txt +9 -6
  24. weco-0.3.2/assets/example-optimization.gif +0 -0
  25. weco-0.3.2/examples/README.md +0 -111
  26. weco-0.3.2/examples/hello-kernel-world/colab_notebook_walkthrough.ipynb +0 -270
  27. {weco-0.3.2 → weco-0.3.4}/.github/workflows/lint.yml +0 -0
  28. {weco-0.3.2 → weco-0.3.4}/.github/workflows/release.yml +0 -0
  29. {weco-0.3.2 → weco-0.3.4}/LICENSE +0 -0
  30. {weco-0.3.2 → weco-0.3.4}/assets/weco.svg +0 -0
  31. {weco-0.3.2 → weco-0.3.4}/contributing.md +0 -0
  32. /weco-0.3.2/examples/cuda/optimize.py → /weco-0.3.4/examples/cuda/module.py +0 -0
  33. {weco-0.3.2 → weco-0.3.4}/examples/extract-line-plot/README.md +0 -0
  34. {weco-0.3.2 → weco-0.3.4}/examples/extract-line-plot/eval.py +0 -0
  35. {weco-0.3.2 → weco-0.3.4}/examples/extract-line-plot/guide.md +0 -0
  36. {weco-0.3.2 → weco-0.3.4}/examples/extract-line-plot/optimize.py +0 -0
  37. {weco-0.3.2 → weco-0.3.4}/examples/extract-line-plot/prepare_data.py +0 -0
  38. {weco-0.3.2 → weco-0.3.4}/examples/extract-line-plot/pyproject.toml +0 -0
  39. /weco-0.3.2/examples/hello-kernel-world/optimize.py → /weco-0.3.4/examples/hello-world/module.py +0 -0
  40. {weco-0.3.2 → weco-0.3.4}/examples/prompt/README.md +0 -0
  41. {weco-0.3.2 → weco-0.3.4}/examples/prompt/eval.py +0 -0
  42. {weco-0.3.2 → weco-0.3.4}/examples/prompt/optimize.py +0 -0
  43. {weco-0.3.2 → weco-0.3.4}/examples/prompt/prompt_guide.md +0 -0
  44. {weco-0.3.2 → weco-0.3.4}/examples/spaceship-titanic/README.md +0 -0
  45. {weco-0.3.2 → weco-0.3.4}/examples/spaceship-titanic/competition_description.md +0 -0
  46. {weco-0.3.2 → weco-0.3.4}/examples/spaceship-titanic/data/sample_submission.csv +0 -0
  47. {weco-0.3.2 → weco-0.3.4}/examples/spaceship-titanic/data/test.csv +0 -0
  48. {weco-0.3.2 → weco-0.3.4}/examples/spaceship-titanic/data/train.csv +0 -0
  49. {weco-0.3.2 → weco-0.3.4}/examples/spaceship-titanic/evaluate.py +0 -0
  50. {weco-0.3.2 → weco-0.3.4}/examples/spaceship-titanic/train.py +0 -0
  51. /weco-0.3.2/examples/triton/optimize.py → /weco-0.3.4/examples/triton/module.py +0 -0
  52. {weco-0.3.2 → weco-0.3.4}/setup.cfg +0 -0
  53. {weco-0.3.2 → weco-0.3.4}/weco/__init__.py +0 -0
  54. {weco-0.3.2 → weco-0.3.4}/weco/auth.py +0 -0
  55. {weco-0.3.2 → weco-0.3.4}/weco/chatbot.py +0 -0
  56. {weco-0.3.2 → weco-0.3.4}/weco/constants.py +0 -0
  57. {weco-0.3.2 → weco-0.3.4}/weco/credits.py +0 -0
  58. {weco-0.3.2 → weco-0.3.4}/weco.egg-info/dependency_links.txt +0 -0
  59. {weco-0.3.2 → weco-0.3.4}/weco.egg-info/entry_points.txt +0 -0
  60. {weco-0.3.2 → weco-0.3.4}/weco.egg-info/requires.txt +0 -0
  61. {weco-0.3.2 → weco-0.3.4}/weco.egg-info/top_level.txt +0 -0
@@ -89,3 +89,6 @@ repomix-output.*
89
89
  examples/extract-line-plot/predictions/
90
90
  examples/extract-line-plot/subset_line_*/
91
91
  examples/extract-line-plot/subset_line_*.zip
92
+
93
+ # Example: prompt
94
+ examples/prompt/.cache
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weco
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Documentation for `weco`, a CLI for using Weco AI's code optimizer.
5
5
  Author-email: Weco AI Team <contact@weco.ai>
6
6
  License:
@@ -230,7 +230,7 @@ Dynamic: license-file
230
230
 
231
231
  <div align="center">
232
232
  <img src="assets/weco.svg" alt="Weco Logo" width="120" height="120" style="margin-bottom: 20px;">
233
- <h1>Weco: The Platform for Self-Improving Code</h1>
233
+ <h1>Weco: The Code Optimization Agent</h1>
234
234
  </div>
235
235
 
236
236
  [![Python](https://img.shields.io/badge/Python-3.8.0+-blue)](https://www.python.org)
@@ -238,7 +238,7 @@ Dynamic: license-file
238
238
  [![docs](https://img.shields.io/website?url=https://docs.weco.ai/&label=docs)](https://docs.weco.ai/)
239
239
  [![PyPI Downloads](https://static.pepy.tech/badge/weco?color=4c1)](https://pepy.tech/projects/weco)
240
240
  [![arXiv on AIDE](https://img.shields.io/badge/arXiv-AIDE-b31b1b?logo=arxiv&logoColor=white)](https://arxiv.org/abs/2502.13138)
241
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg?labelColor=ffffff&color=F17E01)](https://colab.research.google.com/github/WecoAI/weco-cli/blob/main/examples/hello-kernel-world/colab_notebook_walkthrough.ipynb)
241
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg?labelColor=ffffff&color=F17E01)](https://colab.research.google.com/github/WecoAI/weco-cli/blob/main/examples/hello-world/colab_notebook_walkthrough.ipynb)
242
242
 
243
243
  `pip install weco`
244
244
 
@@ -262,77 +262,32 @@ Example applications include:
262
262
 
263
263
  The `weco` CLI leverages a tree search approach guided by LLMs to iteratively explore and refine your code. It automatically applies changes, runs your evaluation script, parses the results, and proposes further improvements based on the specified goal.
264
264
 
265
- ![image](https://github.com/user-attachments/assets/a6ed63fa-9c40-498e-aa98-a873e5786509)
266
265
 
267
- ---
268
-
269
- ## Setup
270
-
271
- 1. **Install the Package:**
272
-
273
- ```bash
274
- pip install weco
275
- ```
276
-
277
- 2. **Authenticate (Required):**
278
-
279
- `weco` now uses a **credit-based billing system** with centralized LLM access. You need to authenticate to use the service:
280
-
281
- - **Run the CLI**: `weco` will prompt you to authenticate via your web browser
282
- - **Free Credits**: New users receive **free credits** upon signup
283
- - **Centralized Keys**: All LLM provider API keys are managed by Weco (no BYOK required)
284
- - **Credit Top-ups**: Purchase additional credits through the dashboard at [dashboard.weco.ai](https://dashboard.weco.ai)
285
-
286
- ---
287
-
288
- ## Get Started
289
-
290
- ### Quick Start (Recommended for New Users)
291
-
292
- The easiest way to get started with Weco is to use the **interactive copilot**. Simply navigate to your project directory and run:
293
-
294
- ```bash
295
- weco
296
- ```
297
-
298
- Or specify a project path:
266
+ ## Install the Package
299
267
 
300
268
  ```bash
301
- weco /path/to/your/project
269
+ pip install weco
302
270
  ```
303
271
 
304
- This launches Weco's interactive copilot that will:
272
+ ## Getting Started
305
273
 
306
- 1. **Analyze your codebase** using AI to understand your project structure and identify optimization opportunities
307
- 2. **Suggest specific optimizations** tailored to your code (e.g., GPU kernel optimization, model improvements, prompt engineering)
308
- 3. **Generate evaluation scripts** automatically or help you configure existing ones
309
- 4. **Set up the complete optimization pipeline** with appropriate metrics and commands
310
- 5. **Run the optimization** or provide you with the exact command to execute
311
-
312
- <div style="background-color: #fff3cd; border: 1px solid #ffeeba; padding: 15px; border-radius: 4px; margin-bottom: 15px;">
313
- <strong>⚠️ Warning: Code Modification</strong><br>
314
- <code>weco</code> directly modifies the file specified by <code>--source</code> during the optimization process. It is <strong>strongly recommended</strong> to use version control (like Git) to track changes and revert if needed. Alternatively, ensure you have a backup of your original file before running the command. Upon completion, the file will contain the best-performing version of the code found during the run.
315
- </div>
316
-
317
- ### Manual Setup
274
+ ### Quickstart with an example project
318
275
 
319
276
  **Configure optimization parameters yourself** - If you need precise control over the optimization parameters, you can use the direct `weco run` command:
320
277
 
321
278
  **Example: Optimizing Simple PyTorch Operations**
322
279
 
323
280
  ```bash
324
- # Navigate to the example directory
325
- cd examples/hello-kernel-world
326
-
327
- # Install dependencies
328
- pip install torch
281
+ git clone https://github.com/WecoAI/weco-cli.git
282
+ cd weco-cli/examples/hello-world/
283
+ pip install -r requirements.txt
329
284
 
330
- # Run Weco with manual configuration
331
- weco run --source optimize.py \
332
- --eval-command "python evaluate.py --solution-path optimize.py --device cpu" \
285
+ # Run Weco with configuration
286
+ weco run --source module.py \
287
+ --eval-command "python evaluate.py --path module.py" \
333
288
  --metric speedup \
334
289
  --goal maximize \
335
- --steps 15 \
290
+ --steps 10 \
336
291
  --additional-instructions "Fuse operations in the forward method while ensuring the max float deviation remains small. Maintain the same format of the code."
337
292
  ```
338
293
 
@@ -362,34 +317,12 @@ For more advanced examples, including [Triton](/examples/triton/README.md), [CUD
362
317
  | Argument | Description | Default | Example |
363
318
  | :----------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------ |
364
319
  | `-n, --steps` | Number of optimization steps (LLM iterations) to run. | 100 | `-n 50` |
365
- | `-M, --model` | Model identifier for the LLM to use (e.g., `o4-mini`, `claude-sonnet-4-0`). | `o4-mini` | `-M o4-mini` |
320
+ | `-M, --model` | Model identifier for the LLM to use (e.g., `o4-mini`, `claude-sonnet-4-5`, `gpt-5`). | `o4-mini` | `-M o4-mini` |
366
321
  | `-i, --additional-instructions`| Natural language description of specific instructions **or** path to a file containing detailed instructions to guide the LLM. Supported file formats include - `.txt`, `.md`, and `.rst`. | `None` | `-i instructions.md` or `-i "Optimize the model for faster inference"`|
367
322
  | `-l, --log-dir` | Path to the directory to log intermediate steps and final optimization result. | `.runs/` | `-l ./logs/` |
368
323
  | `--eval-timeout` | Timeout in seconds for each step in evaluation. | No timeout (unlimited) | `--eval-timeout 3600` |
369
324
  | `--save-logs` | Save execution output from each optimization step to disk. Creates timestamped directories with raw output files and a JSONL index for tracking execution history. | `False` | `--save-logs` |
370
-
371
- ---
372
-
373
- ### Authentication & Dashboard
374
-
375
- The CLI requires a Weco account for authentication and billing.
376
-
377
- #### Credit-Based Authentication (Required)
378
- Weco now requires authentication for all operations. This enables our credit-based billing system and provides access to powerful optimizations:
379
-
380
- 1. **During onboarding**: When you run `weco` for the first time, you'll be prompted to log in
381
- 2. **Manual login**: Use `weco logout` to clear credentials, then run `weco` again to re-authenticate
382
- 3. **Device flow**: Weco will open your browser automatically and guide you through a secure OAuth-style authentication
383
-
384
- ![image (16)](https://github.com/user-attachments/assets/8a0a285b-4894-46fa-b6a2-4990017ca0c6)
385
-
386
- **Benefits:**
387
- - **No API Key Management**: All LLM provider keys are managed centrally
388
- - **Cost Transparency**: See exactly how many credits each optimization consumes
389
- - **Free Trial**: Free credits to get started with optimization projects
390
- - **Run History**: View all your optimization runs on the Weco dashboard
391
- - **Progress Tracking**: Monitor long-running optimizations remotely
392
- - **Budget Control**: Set spending limits and auto top-up preferences
325
+ | `--apply-change` | Automatically apply the best solution to the source file without prompting. | `False` | `--apply-change` |
393
326
 
394
327
  ---
395
328
 
@@ -399,8 +332,6 @@ Weco now requires authentication for all operations. This enables our credit-bas
399
332
 
400
333
  | Command | Description | When to Use |
401
334
  |---------|-------------|-------------|
402
- | `weco` | Launch interactive onboarding | **Recommended for beginners** - Analyzes your codebase and guides you through setup |
403
- | `weco /path/to/project` | Launch onboarding for specific project | When working with a project in a different directory |
404
335
  | `weco run [options]` | Direct optimization execution | **For advanced users** - When you know exactly what to optimize and how |
405
336
  | `weco resume <run-id>` | Resume an interrupted run | Continue from the last completed step |
406
337
  | `weco logout` | Clear authentication credentials | To switch accounts or troubleshoot authentication issues |
@@ -410,19 +341,23 @@ Weco now requires authentication for all operations. This enables our credit-bas
410
341
  You can specify which LLM model to use with the `-M` or `--model` flag:
411
342
 
412
343
  ```bash
413
- # Use with onboarding
414
- weco --model gpt-4o
415
-
416
- # Use with direct execution
417
- weco run --model claude-3.5-sonnet --source optimize.py [other options...]
344
+ weco run --model gpt-5 --source optimize.py [other options...]
418
345
  ```
419
346
 
420
- **Available models:**
421
- - `o4-mini`, `o3-mini`, `gpt-4o` (OpenAI models)
422
- - `claude-sonnet-4-0`, `claude-opus-4-0` (Anthropic models)
423
- - `gemini-2.5-pro`, `gemini-2.5-flash` (Google models)
347
+ **Available models (30 total):**
348
+
349
+ **OpenAI Models:**
350
+ - GPT-5 Series: `gpt-5.1`, `gpt-5.1-codex`, `gpt-5.1-codex-mini`, `gpt-5-codex`, `gpt-5-pro`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`
351
+ - O-Series Reasoning: `o3-pro`, `o3`, `o3-mini`, `o4-mini`, `o1-pro`, `o1`, `codex-mini-latest`
352
+ - GPT-4 Series: `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4o`, `gpt-4o-mini`
353
+
354
+ **Anthropic Claude (via Vertex AI):**
355
+ - `claude-opus-4-5`, `claude-opus-4-1`, `claude-opus-4`, `claude-sonnet-4-5`, `claude-sonnet-4`, `claude-haiku-4-5`
356
+
357
+ **Google Gemini:**
358
+ - `gemini-3-pro-preview`, `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`
424
359
 
425
- All models are available through Weco's centralized system. If no model is specified, Weco automatically selects the best model for your optimization task.
360
+ All models are available through Weco. If no model is specified, Weco automatically selects the best model for your optimization task.
426
361
 
427
362
  ---
428
363
 
@@ -441,6 +376,7 @@ Arguments for `weco resume`:
441
376
  | Argument | Description | Example |
442
377
  |----------|-------------|---------|
443
378
  | `run-id` | The UUID of the run to resume (shown at the start of each run) | `0002e071-1b67-411f-a514-36947f0c4b31` |
379
+ | `--apply-change` | Automatically apply the best solution to the source file without prompting | `--apply-change` |
444
380
 
445
381
  Notes:
446
382
  - Works only for interrupted runs (status: `error`, `terminated`, etc.).
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div align="center">
4
4
  <img src="assets/weco.svg" alt="Weco Logo" width="120" height="120" style="margin-bottom: 20px;">
5
- <h1>Weco: The Platform for Self-Improving Code</h1>
5
+ <h1>Weco: The Code Optimization Agent</h1>
6
6
  </div>
7
7
 
8
8
  [![Python](https://img.shields.io/badge/Python-3.8.0+-blue)](https://www.python.org)
@@ -10,7 +10,7 @@
10
10
  [![docs](https://img.shields.io/website?url=https://docs.weco.ai/&label=docs)](https://docs.weco.ai/)
11
11
  [![PyPI Downloads](https://static.pepy.tech/badge/weco?color=4c1)](https://pepy.tech/projects/weco)
12
12
  [![arXiv on AIDE](https://img.shields.io/badge/arXiv-AIDE-b31b1b?logo=arxiv&logoColor=white)](https://arxiv.org/abs/2502.13138)
13
- [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg?labelColor=ffffff&color=F17E01)](https://colab.research.google.com/github/WecoAI/weco-cli/blob/main/examples/hello-kernel-world/colab_notebook_walkthrough.ipynb)
13
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg?labelColor=ffffff&color=F17E01)](https://colab.research.google.com/github/WecoAI/weco-cli/blob/main/examples/hello-world/colab_notebook_walkthrough.ipynb)
14
14
 
15
15
  `pip install weco`
16
16
 
@@ -34,77 +34,32 @@ Example applications include:
34
34
 
35
35
  The `weco` CLI leverages a tree search approach guided by LLMs to iteratively explore and refine your code. It automatically applies changes, runs your evaluation script, parses the results, and proposes further improvements based on the specified goal.
36
36
 
37
- ![image](https://github.com/user-attachments/assets/a6ed63fa-9c40-498e-aa98-a873e5786509)
38
37
 
39
- ---
40
-
41
- ## Setup
42
-
43
- 1. **Install the Package:**
44
-
45
- ```bash
46
- pip install weco
47
- ```
48
-
49
- 2. **Authenticate (Required):**
50
-
51
- `weco` now uses a **credit-based billing system** with centralized LLM access. You need to authenticate to use the service:
52
-
53
- - **Run the CLI**: `weco` will prompt you to authenticate via your web browser
54
- - **Free Credits**: New users receive **free credits** upon signup
55
- - **Centralized Keys**: All LLM provider API keys are managed by Weco (no BYOK required)
56
- - **Credit Top-ups**: Purchase additional credits through the dashboard at [dashboard.weco.ai](https://dashboard.weco.ai)
57
-
58
- ---
59
-
60
- ## Get Started
61
-
62
- ### Quick Start (Recommended for New Users)
63
-
64
- The easiest way to get started with Weco is to use the **interactive copilot**. Simply navigate to your project directory and run:
65
-
66
- ```bash
67
- weco
68
- ```
69
-
70
- Or specify a project path:
38
+ ## Install the Package
71
39
 
72
40
  ```bash
73
- weco /path/to/your/project
41
+ pip install weco
74
42
  ```
75
43
 
76
- This launches Weco's interactive copilot that will:
44
+ ## Getting Started
77
45
 
78
- 1. **Analyze your codebase** using AI to understand your project structure and identify optimization opportunities
79
- 2. **Suggest specific optimizations** tailored to your code (e.g., GPU kernel optimization, model improvements, prompt engineering)
80
- 3. **Generate evaluation scripts** automatically or help you configure existing ones
81
- 4. **Set up the complete optimization pipeline** with appropriate metrics and commands
82
- 5. **Run the optimization** or provide you with the exact command to execute
83
-
84
- <div style="background-color: #fff3cd; border: 1px solid #ffeeba; padding: 15px; border-radius: 4px; margin-bottom: 15px;">
85
- <strong>⚠️ Warning: Code Modification</strong><br>
86
- <code>weco</code> directly modifies the file specified by <code>--source</code> during the optimization process. It is <strong>strongly recommended</strong> to use version control (like Git) to track changes and revert if needed. Alternatively, ensure you have a backup of your original file before running the command. Upon completion, the file will contain the best-performing version of the code found during the run.
87
- </div>
88
-
89
- ### Manual Setup
46
+ ### Quickstart with an example project
90
47
 
91
48
  **Configure optimization parameters yourself** - If you need precise control over the optimization parameters, you can use the direct `weco run` command:
92
49
 
93
50
  **Example: Optimizing Simple PyTorch Operations**
94
51
 
95
52
  ```bash
96
- # Navigate to the example directory
97
- cd examples/hello-kernel-world
98
-
99
- # Install dependencies
100
- pip install torch
53
+ git clone https://github.com/WecoAI/weco-cli.git
54
+ cd weco-cli/examples/hello-world/
55
+ pip install -r requirements.txt
101
56
 
102
- # Run Weco with manual configuration
103
- weco run --source optimize.py \
104
- --eval-command "python evaluate.py --solution-path optimize.py --device cpu" \
57
+ # Run Weco with configuration
58
+ weco run --source module.py \
59
+ --eval-command "python evaluate.py --path module.py" \
105
60
  --metric speedup \
106
61
  --goal maximize \
107
- --steps 15 \
62
+ --steps 10 \
108
63
  --additional-instructions "Fuse operations in the forward method while ensuring the max float deviation remains small. Maintain the same format of the code."
109
64
  ```
110
65
 
@@ -134,34 +89,12 @@ For more advanced examples, including [Triton](/examples/triton/README.md), [CUD
134
89
  | Argument | Description | Default | Example |
135
90
  | :----------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------ |
136
91
  | `-n, --steps` | Number of optimization steps (LLM iterations) to run. | 100 | `-n 50` |
137
- | `-M, --model` | Model identifier for the LLM to use (e.g., `o4-mini`, `claude-sonnet-4-0`). | `o4-mini` | `-M o4-mini` |
92
+ | `-M, --model` | Model identifier for the LLM to use (e.g., `o4-mini`, `claude-sonnet-4-5`, `gpt-5`). | `o4-mini` | `-M o4-mini` |
138
93
  | `-i, --additional-instructions`| Natural language description of specific instructions **or** path to a file containing detailed instructions to guide the LLM. Supported file formats include - `.txt`, `.md`, and `.rst`. | `None` | `-i instructions.md` or `-i "Optimize the model for faster inference"`|
139
94
  | `-l, --log-dir` | Path to the directory to log intermediate steps and final optimization result. | `.runs/` | `-l ./logs/` |
140
95
  | `--eval-timeout` | Timeout in seconds for each step in evaluation. | No timeout (unlimited) | `--eval-timeout 3600` |
141
96
  | `--save-logs` | Save execution output from each optimization step to disk. Creates timestamped directories with raw output files and a JSONL index for tracking execution history. | `False` | `--save-logs` |
142
-
143
- ---
144
-
145
- ### Authentication & Dashboard
146
-
147
- The CLI requires a Weco account for authentication and billing.
148
-
149
- #### Credit-Based Authentication (Required)
150
- Weco now requires authentication for all operations. This enables our credit-based billing system and provides access to powerful optimizations:
151
-
152
- 1. **During onboarding**: When you run `weco` for the first time, you'll be prompted to log in
153
- 2. **Manual login**: Use `weco logout` to clear credentials, then run `weco` again to re-authenticate
154
- 3. **Device flow**: Weco will open your browser automatically and guide you through a secure OAuth-style authentication
155
-
156
- ![image (16)](https://github.com/user-attachments/assets/8a0a285b-4894-46fa-b6a2-4990017ca0c6)
157
-
158
- **Benefits:**
159
- - **No API Key Management**: All LLM provider keys are managed centrally
160
- - **Cost Transparency**: See exactly how many credits each optimization consumes
161
- - **Free Trial**: Free credits to get started with optimization projects
162
- - **Run History**: View all your optimization runs on the Weco dashboard
163
- - **Progress Tracking**: Monitor long-running optimizations remotely
164
- - **Budget Control**: Set spending limits and auto top-up preferences
97
+ | `--apply-change` | Automatically apply the best solution to the source file without prompting. | `False` | `--apply-change` |
165
98
 
166
99
  ---
167
100
 
@@ -171,8 +104,6 @@ Weco now requires authentication for all operations. This enables our credit-bas
171
104
 
172
105
  | Command | Description | When to Use |
173
106
  |---------|-------------|-------------|
174
- | `weco` | Launch interactive onboarding | **Recommended for beginners** - Analyzes your codebase and guides you through setup |
175
- | `weco /path/to/project` | Launch onboarding for specific project | When working with a project in a different directory |
176
107
  | `weco run [options]` | Direct optimization execution | **For advanced users** - When you know exactly what to optimize and how |
177
108
  | `weco resume <run-id>` | Resume an interrupted run | Continue from the last completed step |
178
109
  | `weco logout` | Clear authentication credentials | To switch accounts or troubleshoot authentication issues |
@@ -182,19 +113,23 @@ Weco now requires authentication for all operations. This enables our credit-bas
182
113
  You can specify which LLM model to use with the `-M` or `--model` flag:
183
114
 
184
115
  ```bash
185
- # Use with onboarding
186
- weco --model gpt-4o
187
-
188
- # Use with direct execution
189
- weco run --model claude-3.5-sonnet --source optimize.py [other options...]
116
+ weco run --model gpt-5 --source optimize.py [other options...]
190
117
  ```
191
118
 
192
- **Available models:**
193
- - `o4-mini`, `o3-mini`, `gpt-4o` (OpenAI models)
194
- - `claude-sonnet-4-0`, `claude-opus-4-0` (Anthropic models)
195
- - `gemini-2.5-pro`, `gemini-2.5-flash` (Google models)
119
+ **Available models (30 total):**
120
+
121
+ **OpenAI Models:**
122
+ - GPT-5 Series: `gpt-5.1`, `gpt-5.1-codex`, `gpt-5.1-codex-mini`, `gpt-5-codex`, `gpt-5-pro`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`
123
+ - O-Series Reasoning: `o3-pro`, `o3`, `o3-mini`, `o4-mini`, `o1-pro`, `o1`, `codex-mini-latest`
124
+ - GPT-4 Series: `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4o`, `gpt-4o-mini`
125
+
126
+ **Anthropic Claude (via Vertex AI):**
127
+ - `claude-opus-4-5`, `claude-opus-4-1`, `claude-opus-4`, `claude-sonnet-4-5`, `claude-sonnet-4`, `claude-haiku-4-5`
128
+
129
+ **Google Gemini:**
130
+ - `gemini-3-pro-preview`, `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`
196
131
 
197
- All models are available through Weco's centralized system. If no model is specified, Weco automatically selects the best model for your optimization task.
132
+ All models are available through Weco. If no model is specified, Weco automatically selects the best model for your optimization task.
198
133
 
199
134
  ---
200
135
 
@@ -213,6 +148,7 @@ Arguments for `weco resume`:
213
148
  | Argument | Description | Example |
214
149
  |----------|-------------|---------|
215
150
  | `run-id` | The UUID of the run to resume (shown at the start of each run) | `0002e071-1b67-411f-a514-36947f0c4b31` |
151
+ | `--apply-change` | Automatically apply the best solution to the source file without prompting | `--apply-change` |
216
152
 
217
153
  Notes:
218
154
  - Works only for interrupted runs (status: `error`, `terminated`, etc.).
@@ -0,0 +1,148 @@
1
+ ## Weco Examples
2
+
3
+ Explore runnable examples that show how to use Weco to optimize ML models, prompts, and GPU kernels. Pick an example and get going in minutes.
4
+
5
+ ### Table of Contents
6
+
7
+ - [Weco Examples](#weco-examples)
8
+ - [Table of Contents](#table-of-contents)
9
+ - [Prerequisites](#prerequisites)
10
+ - [Examples at a glance](#examples-at-a-glance)
11
+ - [Quick starts](#quick-starts)
12
+ - [🧭 Hello World](#-hello-world)
13
+ - [⚡ Triton Optimization](#-triton-optimization)
14
+ - [🚀 CUDA Optimization](#-cuda-optimization)
15
+ - [🧠 Prompt Engineering](#-prompt-engineering)
16
+ - [📊 Extract Line Plot — Chart to CSV](#-extract-line-plot--chart-to-csv)
17
+ - [🛰️ Model Development — Spaceship Titanic](#️-model-development--spaceship-titanic)
18
+
19
+ ### Prerequisites
20
+
21
+ - **Install the CLI**
22
+ ```bash
23
+ pip install weco
24
+ ```
25
+
26
+ ### Examples at a glance
27
+
28
+ | Example | Focus | Dependencies | Docs |
29
+ | :-- | :-- | :-- | :-- |
30
+ | 🧭 Hello World | Learn the Weco workflow on a small PyTorch model | `torch` | [README](hello-world/README.md) • [Colab](hello-world/colab_notebook_walkthrough.ipynb) |
31
+ | ⚡ Triton Optimization | Speed up attention with Triton kernels | `numpy`, `torch`, `triton`, NVIDIA GPU | [README](triton/README.md) |
32
+ | 🚀 CUDA Optimization | Generate low-level CUDA kernels for max speed | `ninja`, `numpy`, `torch`, `triton`, NVIDIA GPU, CUDA Toolkit | [README](cuda/README.md) |
33
+ | 🧠 Prompt Engineering | Iteratively refine LLM prompts to improve accuracy | `openai`, `datasets`, OpenAI API key | [README](prompt/README.md) |
34
+ | 📊 Agentic Scaffolding | Optimize agentic scaffolding for chart-to-CSV extraction | `openai`, `huggingface_hub`, `uv`, OpenAI API key | [README](extract-line-plot/README.md) |
35
+ | 🛰️ Spaceship Titanic | Improve a Kaggle model training pipeline | `pandas`, `numpy`, `scikit-learn`, `torch`, `xgboost`, `lightgbm`, `catboost` | [README](spaceship-titanic/README.md) |
36
+
37
+ ---
38
+
39
+ ## Quick starts
40
+
41
+ Minimal commands to run each example. For full context and explanations, see the linked READMEs.
42
+
43
+ > **Tip**: Add `--apply-change` to any command below to automatically apply the best solution to your source file without prompting.
44
+
45
+ ### 🧭 Hello World
46
+
47
+ ```bash
48
+ cd examples/hello-world
49
+ pip install -r requirements.txt
50
+ weco run --source module.py \
51
+ --eval-command "python evaluate.py --path module.py" \
52
+ --metric speedup \
53
+ --goal maximize \
54
+ --steps 15 \
55
+ --additional-instructions "Fuse operations in the forward method while ensuring the max float deviation remains small. Maintain the same format of the code."
56
+ ```
57
+ - **Tip**: Use `--device cuda` (NVIDIA GPU) or `--device mps` (Apple Silicon).
58
+
59
+ ### ⚡ Triton Optimization
60
+
61
+ - **Requirements**: NVIDIA GPU
62
+
63
+ ```bash
64
+ cd examples/triton
65
+ pip install -r requirements.txt
66
+ weco run --source module.py \
67
+ --eval-command "python evaluate.py --path module.py" \
68
+ --metric speedup \
69
+ --goal maximize \
70
+ --steps 15 \
71
+ --model o4-mini \
72
+ --additional-instructions "Use a combination of triton and pytorch to optimize the forward pass while ensuring a small max float diff. Maintain the same code interface. Do not use any fallbacks. Assume any required dependencies are installed and data is already on the gpu." \
73
+ --eval-timeout 120
74
+ ```
75
+
76
+ ### 🚀 CUDA Optimization
77
+
78
+ - **Requirements**: NVIDIA GPU and CUDA Toolkit
79
+ - **Optional**: If compatible, install [flash attention](https://github.com/Dao-AILab/flash-attention?tab=readme-ov-file#installation-and-features) (`pip install flash-attn --no-build-isolation`)
80
+
81
+ ```bash
82
+ cd examples/cuda
83
+ pip install -r requirements.txt
84
+ weco run --source module.py \
85
+ --eval-command "python evaluate.py --path module.py" \
86
+ --metric speedup \
87
+ --goal maximize \
88
+ --steps 50 \
89
+ --model gpt-5 \
90
+ --additional-instructions "Write in-line CUDA using pytorch's load_inline() to optimize the code while ensuring a small max float diff. Maintain the same code interface. Do not use any fallbacks and never use the build_directory arg for load_inline(). Assume any required dependencies are installed and data is already on the gpu." \
91
+ --eval-timeout 600
92
+ ```
93
+
94
+ ### 🧠 Prompt Engineering
95
+
96
+ - **Requirements**: OpenAI API key (create [here](https://platform.openai.com/api-keys))
97
+ - **Install Dependencies**: `pip install openai datasets`
98
+ - **Run**:
99
+ ```bash
100
+ cd examples/prompt
101
+ export OPENAI_API_KEY="your_key_here"
102
+ weco run --source optimize.py \
103
+ --eval-command "python eval.py" \
104
+ --metric score \
105
+ --goal maximize \
106
+ --steps 20 \
107
+ --model o4-mini \
108
+ --additional-instructions "Improve the prompt to get better scores. Focus on clarity, specificity, and effective prompt engineering techniques."
109
+ ```
110
+
111
+ ### 📊 Extract Line Plot — Chart to CSV
112
+
113
+ - **Requirements**: OpenAI API key (create [here](https://platform.openai.com/api-keys))
114
+ - **Install Dependencies**: `pip install uv openai huggingface_hub`
115
+ - **Run**:
116
+ ```bash
117
+ cd examples/extract-line-plot
118
+ export OPENAI_API_KEY="your_key_here"
119
+ uv run --with huggingface_hub python prepare_data.py # prepare dataset
120
+ weco run --source optimize.py \
121
+ --eval-command 'uv run --with openai python eval.py --max-samples 100 --num-workers 50' \
122
+ --metric accuracy \
123
+ --goal maximize \
124
+ --steps 20 \
125
+ --model gpt-5
126
+ ```
127
+
128
+ ### 🛰️ Model Development — Spaceship Titanic
129
+
130
+ - **Install Dependencies**: `pip install pandas numpy scikit-learn torch xgboost lightgbm catboost`
131
+ - **Run**:
132
+ ```bash
133
+ cd examples/spaceship-titanic
134
+ weco run --source train.py \
135
+ --eval-command "python evaluate.py --data-dir ./data --seed 0" \
136
+ --metric accuracy \
137
+ --goal maximize \
138
+ --steps 10 \
139
+ --model o4-mini \
140
+ --additional-instructions "Improve feature engineering, model choice and hyper-parameters." \
141
+ --log-dir .runs/spaceship-titanic
142
+ ```
143
+
144
+ ---
145
+
146
+ If you're new to Weco, start with **Hello World**, then explore **Triton** and **CUDA** for kernel engineering, **Prompt Engineering** for optimzing an LLM's prompt, **Extract Line Plot** for optimzing agentic scaffolds, or try **Spaceship Titanic** for model development.
147
+
148
+
@@ -7,7 +7,8 @@ This approach aims for low-level optimization beyond standard PyTorch or even Tr
7
7
 
8
8
  Install the CLI and dependencies for the example:
9
9
  ```bash
10
- pip install weco ninja numpy torch triton
10
+ pip install weco
11
+ pip install -r requirements.txt
11
12
  ```
12
13
  > **Note:**
13
14
  > 1. This example requires a compatible NVIDIA GPU and the CUDA Toolkit installed on your system for compiling and running the generated CUDA code.
@@ -17,8 +18,8 @@ pip install weco ninja numpy torch triton
17
18
 
18
19
  Now run Weco to optimize your code:
19
20
  ```bash
20
- weco run --source optimize.py \
21
- --eval-command "python evaluate.py --solution-path optimize.py" \
21
+ weco run --source module.py \
22
+ --eval-command "python evaluate.py --path module.py" \
22
23
  --metric speedup \
23
24
  --goal maximize \
24
25
  --steps 50 \
@@ -29,8 +30,8 @@ weco run --source optimize.py \
29
30
 
30
31
  ### Explanation
31
32
 
32
- * `--source optimize.py`: The initial PyTorch self-attention code to be optimized with CUDA.
33
- * `--eval-command "python evaluate.py --solution-path optimize.py"`: Runs the evaluation script, which compiles (if necessary) and benchmarks the CUDA-enhanced code in `optimize.py` against a baseline, printing the `speedup`.
33
+ * `--source module.py`: The initial PyTorch self-attention code to be optimized with CUDA.
34
+ * `--eval-command "python evaluate.py --path module.py"`: Runs the evaluation script, which compiles (if necessary) and benchmarks the CUDA-enhanced code in `module.py` against a baseline, printing the `speedup`.
34
35
  * `--metric speedup`: The optimization target metric.
35
36
  * `--goal maximize`: Weco aims to increase the speedup.
36
37
  * `--steps 50`: The number of optimization iterations.
@@ -38,7 +39,7 @@ weco run --source optimize.py \
38
39
  * `--additional-instructions "..."`: Provides guidance to the LLM on the optimization approach.
39
40
  * `--eval-timeout 600`: Stop runnning the evaluation script if it does not complete in 600 seconds.
40
41
 
41
- Weco will iteratively modify `optimize.py`, generating and integrating CUDA C++ code, guided by the evaluation results and the additional instructions provided.
42
+ Weco will iteratively modify `module.py`, generating and integrating CUDA C++ code, guided by the evaluation results and the additional instructions provided.
42
43
 
43
44
  ## Next Steps
44
45
 
@@ -77,7 +77,7 @@ if __name__ == "__main__":
77
77
  import argparse
78
78
 
79
79
  parser = argparse.ArgumentParser()
80
- parser.add_argument("--solution-path", type=str, required=True)
80
+ parser.add_argument("--path", type=str, required=True)
81
81
  args = parser.parse_args()
82
82
 
83
83
  # setup local cache for PyTorch extensions
@@ -107,7 +107,7 @@ if __name__ == "__main__":
107
107
  # load solution module
108
108
  try:
109
109
  torch.manual_seed(0)
110
- solution_module = load_module_from_path(args.solution_path, add_to_sys_modules=False)
110
+ solution_module = load_module_from_path(args.path, add_to_sys_modules=False)
111
111
  solution_model = solution_module.Model(
112
112
  n_embd=n_embd, n_head=n_head, attn_pdrop=attn_pdrop, resid_pdrop=resid_pdrop, max_seqlen=max_seqlen
113
113
  ).to("cuda")
@@ -0,0 +1,4 @@
1
+ ninja
2
+ numpy
3
+ torch
4
+ triton