weco 0.3.2__tar.gz → 0.3.3__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.3}/.gitignore +3 -0
  2. {weco-0.3.2 → weco-0.3.3}/PKG-INFO +29 -95
  3. {weco-0.3.2 → weco-0.3.3}/README.md +28 -94
  4. weco-0.3.3/assets/example-optimization.gif +0 -0
  5. weco-0.3.3/examples/README.md +146 -0
  6. {weco-0.3.2 → weco-0.3.3}/examples/cuda/README.md +7 -6
  7. {weco-0.3.2 → weco-0.3.3}/examples/cuda/evaluate.py +2 -2
  8. weco-0.3.3/examples/cuda/requirements.txt +4 -0
  9. {weco-0.3.2/examples/hello-kernel-world → weco-0.3.3/examples/hello-world}/README.md +8 -7
  10. weco-0.3.3/examples/hello-world/colab_notebook_walkthrough.ipynb +277 -0
  11. {weco-0.3.2/examples/hello-kernel-world → weco-0.3.3/examples/hello-world}/evaluate.py +2 -2
  12. weco-0.3.3/examples/hello-world/requirements.txt +1 -0
  13. {weco-0.3.2 → weco-0.3.3}/examples/triton/README.md +7 -6
  14. {weco-0.3.2 → weco-0.3.3}/examples/triton/evaluate.py +2 -2
  15. weco-0.3.3/examples/triton/requirements.txt +3 -0
  16. {weco-0.3.2 → weco-0.3.3}/pyproject.toml +1 -1
  17. {weco-0.3.2 → weco-0.3.3}/weco/api.py +1 -2
  18. {weco-0.3.2 → weco-0.3.3}/weco/cli.py +2 -2
  19. {weco-0.3.2 → weco-0.3.3}/weco/optimizer.py +2 -19
  20. {weco-0.3.2 → weco-0.3.3}/weco.egg-info/PKG-INFO +29 -95
  21. {weco-0.3.2 → weco-0.3.3}/weco.egg-info/SOURCES.txt +9 -6
  22. weco-0.3.2/assets/example-optimization.gif +0 -0
  23. weco-0.3.2/examples/README.md +0 -111
  24. weco-0.3.2/examples/hello-kernel-world/colab_notebook_walkthrough.ipynb +0 -270
  25. {weco-0.3.2 → weco-0.3.3}/.github/workflows/lint.yml +0 -0
  26. {weco-0.3.2 → weco-0.3.3}/.github/workflows/release.yml +0 -0
  27. {weco-0.3.2 → weco-0.3.3}/LICENSE +0 -0
  28. {weco-0.3.2 → weco-0.3.3}/assets/weco.svg +0 -0
  29. {weco-0.3.2 → weco-0.3.3}/contributing.md +0 -0
  30. /weco-0.3.2/examples/cuda/optimize.py → /weco-0.3.3/examples/cuda/module.py +0 -0
  31. {weco-0.3.2 → weco-0.3.3}/examples/extract-line-plot/README.md +0 -0
  32. {weco-0.3.2 → weco-0.3.3}/examples/extract-line-plot/eval.py +0 -0
  33. {weco-0.3.2 → weco-0.3.3}/examples/extract-line-plot/guide.md +0 -0
  34. {weco-0.3.2 → weco-0.3.3}/examples/extract-line-plot/optimize.py +0 -0
  35. {weco-0.3.2 → weco-0.3.3}/examples/extract-line-plot/prepare_data.py +0 -0
  36. {weco-0.3.2 → weco-0.3.3}/examples/extract-line-plot/pyproject.toml +0 -0
  37. /weco-0.3.2/examples/hello-kernel-world/optimize.py → /weco-0.3.3/examples/hello-world/module.py +0 -0
  38. {weco-0.3.2 → weco-0.3.3}/examples/prompt/README.md +0 -0
  39. {weco-0.3.2 → weco-0.3.3}/examples/prompt/eval.py +0 -0
  40. {weco-0.3.2 → weco-0.3.3}/examples/prompt/optimize.py +0 -0
  41. {weco-0.3.2 → weco-0.3.3}/examples/prompt/prompt_guide.md +0 -0
  42. {weco-0.3.2 → weco-0.3.3}/examples/spaceship-titanic/README.md +0 -0
  43. {weco-0.3.2 → weco-0.3.3}/examples/spaceship-titanic/competition_description.md +0 -0
  44. {weco-0.3.2 → weco-0.3.3}/examples/spaceship-titanic/data/sample_submission.csv +0 -0
  45. {weco-0.3.2 → weco-0.3.3}/examples/spaceship-titanic/data/test.csv +0 -0
  46. {weco-0.3.2 → weco-0.3.3}/examples/spaceship-titanic/data/train.csv +0 -0
  47. {weco-0.3.2 → weco-0.3.3}/examples/spaceship-titanic/evaluate.py +0 -0
  48. {weco-0.3.2 → weco-0.3.3}/examples/spaceship-titanic/train.py +0 -0
  49. /weco-0.3.2/examples/triton/optimize.py → /weco-0.3.3/examples/triton/module.py +0 -0
  50. {weco-0.3.2 → weco-0.3.3}/setup.cfg +0 -0
  51. {weco-0.3.2 → weco-0.3.3}/weco/__init__.py +0 -0
  52. {weco-0.3.2 → weco-0.3.3}/weco/auth.py +0 -0
  53. {weco-0.3.2 → weco-0.3.3}/weco/chatbot.py +0 -0
  54. {weco-0.3.2 → weco-0.3.3}/weco/constants.py +0 -0
  55. {weco-0.3.2 → weco-0.3.3}/weco/credits.py +0 -0
  56. {weco-0.3.2 → weco-0.3.3}/weco/panels.py +0 -0
  57. {weco-0.3.2 → weco-0.3.3}/weco/utils.py +0 -0
  58. {weco-0.3.2 → weco-0.3.3}/weco.egg-info/dependency_links.txt +0 -0
  59. {weco-0.3.2 → weco-0.3.3}/weco.egg-info/entry_points.txt +0 -0
  60. {weco-0.3.2 → weco-0.3.3}/weco.egg-info/requires.txt +0 -0
  61. {weco-0.3.2 → weco-0.3.3}/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.3
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,7 +317,7 @@ 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` |
@@ -370,37 +325,12 @@ For more advanced examples, including [Triton](/examples/triton/README.md), [CUD
370
325
 
371
326
  ---
372
327
 
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
393
-
394
- ---
395
-
396
328
  ## Command Reference
397
329
 
398
330
  ### Basic Usage Patterns
399
331
 
400
332
  | Command | Description | When to Use |
401
333
  |---------|-------------|-------------|
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
334
  | `weco run [options]` | Direct optimization execution | **For advanced users** - When you know exactly what to optimize and how |
405
335
  | `weco resume <run-id>` | Resume an interrupted run | Continue from the last completed step |
406
336
  | `weco logout` | Clear authentication credentials | To switch accounts or troubleshoot authentication issues |
@@ -410,19 +340,23 @@ Weco now requires authentication for all operations. This enables our credit-bas
410
340
  You can specify which LLM model to use with the `-M` or `--model` flag:
411
341
 
412
342
  ```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...]
343
+ weco run --model gpt-5 --source optimize.py [other options...]
418
344
  ```
419
345
 
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)
346
+ **Available models (30 total):**
347
+
348
+ **OpenAI Models:**
349
+ - 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`
350
+ - O-Series Reasoning: `o3-pro`, `o3`, `o3-mini`, `o4-mini`, `o1-pro`, `o1`, `codex-mini-latest`
351
+ - GPT-4 Series: `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4o`, `gpt-4o-mini`
352
+
353
+ **Anthropic Claude (via Vertex AI):**
354
+ - `claude-opus-4-5`, `claude-opus-4-1`, `claude-opus-4`, `claude-sonnet-4-5`, `claude-sonnet-4`, `claude-haiku-4-5`
355
+
356
+ **Google Gemini:**
357
+ - `gemini-3-pro-preview`, `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`
424
358
 
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.
359
+ All models are available through Weco. If no model is specified, Weco automatically selects the best model for your optimization task.
426
360
 
427
361
  ---
428
362
 
@@ -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,7 +89,7 @@ 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` |
@@ -142,37 +97,12 @@ For more advanced examples, including [Triton](/examples/triton/README.md), [CUD
142
97
 
143
98
  ---
144
99
 
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
165
-
166
- ---
167
-
168
100
  ## Command Reference
169
101
 
170
102
  ### Basic Usage Patterns
171
103
 
172
104
  | Command | Description | When to Use |
173
105
  |---------|-------------|-------------|
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
106
  | `weco run [options]` | Direct optimization execution | **For advanced users** - When you know exactly what to optimize and how |
177
107
  | `weco resume <run-id>` | Resume an interrupted run | Continue from the last completed step |
178
108
  | `weco logout` | Clear authentication credentials | To switch accounts or troubleshoot authentication issues |
@@ -182,19 +112,23 @@ Weco now requires authentication for all operations. This enables our credit-bas
182
112
  You can specify which LLM model to use with the `-M` or `--model` flag:
183
113
 
184
114
  ```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...]
115
+ weco run --model gpt-5 --source optimize.py [other options...]
190
116
  ```
191
117
 
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)
118
+ **Available models (30 total):**
119
+
120
+ **OpenAI Models:**
121
+ - 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`
122
+ - O-Series Reasoning: `o3-pro`, `o3`, `o3-mini`, `o4-mini`, `o1-pro`, `o1`, `codex-mini-latest`
123
+ - GPT-4 Series: `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-4o`, `gpt-4o-mini`
124
+
125
+ **Anthropic Claude (via Vertex AI):**
126
+ - `claude-opus-4-5`, `claude-opus-4-1`, `claude-opus-4`, `claude-sonnet-4-5`, `claude-sonnet-4`, `claude-haiku-4-5`
127
+
128
+ **Google Gemini:**
129
+ - `gemini-3-pro-preview`, `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`
196
130
 
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.
131
+ All models are available through Weco. If no model is specified, Weco automatically selects the best model for your optimization task.
198
132
 
199
133
  ---
200
134
 
@@ -0,0 +1,146 @@
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
+ ### 🧭 Hello World
44
+
45
+ ```bash
46
+ cd examples/hello-world
47
+ pip install -r requirements.txt
48
+ weco run --source module.py \
49
+ --eval-command "python evaluate.py --path module.py" \
50
+ --metric speedup \
51
+ --goal maximize \
52
+ --steps 15 \
53
+ --additional-instructions "Fuse operations in the forward method while ensuring the max float deviation remains small. Maintain the same format of the code."
54
+ ```
55
+ - **Tip**: Use `--device cuda` (NVIDIA GPU) or `--device mps` (Apple Silicon).
56
+
57
+ ### ⚡ Triton Optimization
58
+
59
+ - **Requirements**: NVIDIA GPU
60
+
61
+ ```bash
62
+ cd examples/triton
63
+ pip install -r requirements.txt
64
+ weco run --source module.py \
65
+ --eval-command "python evaluate.py --path module.py" \
66
+ --metric speedup \
67
+ --goal maximize \
68
+ --steps 15 \
69
+ --model o4-mini \
70
+ --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." \
71
+ --eval-timeout 120
72
+ ```
73
+
74
+ ### 🚀 CUDA Optimization
75
+
76
+ - **Requirements**: NVIDIA GPU and CUDA Toolkit
77
+ - **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`)
78
+
79
+ ```bash
80
+ cd examples/cuda
81
+ pip install -r requirements.txt
82
+ weco run --source module.py \
83
+ --eval-command "python evaluate.py --path module.py" \
84
+ --metric speedup \
85
+ --goal maximize \
86
+ --steps 50 \
87
+ --model gpt-5 \
88
+ --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." \
89
+ --eval-timeout 600
90
+ ```
91
+
92
+ ### 🧠 Prompt Engineering
93
+
94
+ - **Requirements**: OpenAI API key (create [here](https://platform.openai.com/api-keys))
95
+ - **Install Dependencies**: `pip install openai datasets`
96
+ - **Run**:
97
+ ```bash
98
+ cd examples/prompt
99
+ export OPENAI_API_KEY="your_key_here"
100
+ weco run --source optimize.py \
101
+ --eval-command "python eval.py" \
102
+ --metric score \
103
+ --goal maximize \
104
+ --steps 20 \
105
+ --model o4-mini \
106
+ --additional-instructions "Improve the prompt to get better scores. Focus on clarity, specificity, and effective prompt engineering techniques."
107
+ ```
108
+
109
+ ### 📊 Extract Line Plot — Chart to CSV
110
+
111
+ - **Requirements**: OpenAI API key (create [here](https://platform.openai.com/api-keys))
112
+ - **Install Dependencies**: `pip install uv openai huggingface_hub`
113
+ - **Run**:
114
+ ```bash
115
+ cd examples/extract-line-plot
116
+ export OPENAI_API_KEY="your_key_here"
117
+ uv run --with huggingface_hub python prepare_data.py # prepare dataset
118
+ weco run --source optimize.py \
119
+ --eval-command 'uv run --with openai python eval.py --max-samples 100 --num-workers 50' \
120
+ --metric accuracy \
121
+ --goal maximize \
122
+ --steps 20 \
123
+ --model gpt-5
124
+ ```
125
+
126
+ ### 🛰️ Model Development — Spaceship Titanic
127
+
128
+ - **Install Dependencies**: `pip install pandas numpy scikit-learn torch xgboost lightgbm catboost`
129
+ - **Run**:
130
+ ```bash
131
+ cd examples/spaceship-titanic
132
+ weco run --source train.py \
133
+ --eval-command "python evaluate.py --data-dir ./data --seed 0" \
134
+ --metric accuracy \
135
+ --goal maximize \
136
+ --steps 10 \
137
+ --model o4-mini \
138
+ --additional-instructions "Improve feature engineering, model choice and hyper-parameters." \
139
+ --log-dir .runs/spaceship-titanic
140
+ ```
141
+
142
+ ---
143
+
144
+ 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.
145
+
146
+
@@ -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
@@ -1,4 +1,4 @@
1
- # Hello Kernel World
1
+ # Hello World
2
2
 
3
3
  This example demonstrates the basics of using Weco to optimize a simple PyTorch model. The model performs a series of basic operations: matrix multiplication, division, summation, and scaling. It's designed as an introductory tutorial to help you understand how Weco works before moving on to more advanced optimization tasks.
4
4
 
@@ -6,15 +6,16 @@ This example demonstrates the basics of using Weco to optimize a simple PyTorch
6
6
 
7
7
  Install the CLI and dependencies for the example:
8
8
  ```bash
9
- pip install weco torch
9
+ pip install weco
10
+ pip install -r requirements.txt
10
11
  ```
11
12
 
12
13
  ## Run Weco
13
14
 
14
15
  Now run Weco to optimize your code:
15
16
  ```bash
16
- weco run --source optimize.py \
17
- --eval-command "python evaluate.py --solution-path optimize.py --device cpu" \
17
+ weco run --source module.py \
18
+ --eval-command "python evaluate.py --path module.py --device cpu" \
18
19
  --metric speedup \
19
20
  --goal maximize \
20
21
  --steps 15 \
@@ -25,14 +26,14 @@ weco run --source optimize.py \
25
26
 
26
27
  ### Explanation
27
28
 
28
- * `--source optimize.py`: The simple PyTorch model to be optimized.
29
- * `--eval-command "python evaluate.py --solution-path optimize.py --device cpu"`: Runs the evaluation script, which benchmarks the optimized code against a baseline and prints the `speedup`.
29
+ * `--source module.py`: The simple PyTorch model to be optimized.
30
+ * `--eval-command "python evaluate.py --path module.py --device cpu"`: Runs the evaluation script, which benchmarks the optimized code against a baseline and prints the `speedup`.
30
31
  * `--metric speedup`: The optimization target metric.
31
32
  * `--goal maximize`: To increase the speedup.
32
33
  * `--steps 15`: The number of optimization iterations.
33
34
  * `--additional-instructions "..."`: Provides specific guidance to focus on operation fusion while maintaining correctness.
34
35
 
35
- Weco will iteratively modify `optimize.py`, attempting to fuse and optimize the operations in the forward method, guided by the performance feedback from the evaluation script.
36
+ Weco will iteratively modify `module.py`, attempting to fuse and optimize the operations in the forward method, guided by the performance feedback from the evaluation script.
36
37
 
37
38
  ## Interactive Tutorial
38
39
  ****