You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/extract-line-plot/README.md
+26-6Lines changed: 26 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
## Extract Line Plot (Chart → CSV) with a VLM
1
+
## Extract Line Plot (Chart → CSV): Accuracy/Cost Optimization for Agentic Workflow
2
2
3
-
This example is about optimizing an AI feature that turns image of chart into a table in csv format.
3
+
This example demonstrates optimizing an AI feature that turns chart images into CSV tables, showcasing how to use Weco to improve accuracy or reduce cost of a VLM-based extraction workflow.
If the final accuracy falls at or below `0.45`, the reported cost is replaced with a large penalty so Weco keeps searching for higher-accuracy solutions.
58
+
You can tighten or relax this constraint with `--cost-accuracy-threshold`, e.g. `--cost-accuracy-threshold 0.50`.
59
+
50
60
### 3) Optimize the baseline with Weco
51
61
52
62
Run Weco to iteratively improve `optimize.py` using 100 examples and many workers:
- Run the evaluation command with `--cost-metric` once to confirm accuracy meets your threshold and note the baseline cost.
84
+
- Adjust `--cost-accuracy-threshold` if you want to tighten or relax the constraint before launching optimization.
85
+
- Kick off Weco with `--metric cost --goal minimize --additional-instructions guide.md` so the optimizer respects the constraint while acting on the extra tips.
86
+
66
87
### Tips
67
88
68
89
- Ensure your OpenAI key has access to a vision-capable model (default: `gpt-4o-mini` in the eval; change via `--model`).
69
90
- Adjust `--num-workers` to balance throughput and rate limits.
70
91
- You can tweak baseline behavior in `optimize.py` (prompt, temperature) — Weco will explore modifications automatically during optimization.
71
-
72
-
92
+
- Include `--additional-instructions guide.md` whenever you run Weco so those cost-conscious hints influence the generated proposals.
0 commit comments