p2predict 0.9.1__tar.gz → 0.9.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 (56) hide show
  1. {p2predict-0.9.1/src/p2predict.egg-info → p2predict-0.9.4}/PKG-INFO +60 -7
  2. {p2predict-0.9.1 → p2predict-0.9.4}/README.md +58 -5
  3. {p2predict-0.9.1 → p2predict-0.9.4}/pyproject.toml +2 -2
  4. {p2predict-0.9.1 → p2predict-0.9.4/src/p2predict.egg-info}/PKG-INFO +60 -7
  5. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict.egg-info/requires.txt +1 -1
  6. {p2predict-0.9.1 → p2predict-0.9.4}/LICENSE +0 -0
  7. {p2predict-0.9.1 → p2predict-0.9.4}/setup.cfg +0 -0
  8. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/__init__.py +0 -0
  9. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/__main__.py +0 -0
  10. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/cli/__init__.py +0 -0
  11. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/cli/predict.py +0 -0
  12. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/cli/train.py +0 -0
  13. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/cmdline_io.py +0 -0
  14. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/explain.py +0 -0
  15. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/feature_selection.py +0 -0
  16. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/hpo_training.py +0 -0
  17. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/input_checks.py +0 -0
  18. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/intervals.py +0 -0
  19. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/json_output.py +0 -0
  20. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/mcp/__init__.py +0 -0
  21. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/mcp/__main__.py +0 -0
  22. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/mcp/conversions.py +0 -0
  23. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/mcp/registry.py +0 -0
  24. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/mcp/server.py +0 -0
  25. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/model_evals.py +0 -0
  26. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/model_utils.py +0 -0
  27. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/outliers.py +0 -0
  28. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/plotting.py +0 -0
  29. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/prepare_data.py +0 -0
  30. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/preprocessing.py +0 -0
  31. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/quality.py +0 -0
  32. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/trained_model_io.py +0 -0
  33. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/training.py +0 -0
  34. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/ui_console.py +0 -0
  35. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict/whatif.py +0 -0
  36. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict.egg-info/SOURCES.txt +0 -0
  37. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict.egg-info/dependency_links.txt +0 -0
  38. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict.egg-info/entry_points.txt +0 -0
  39. {p2predict-0.9.1 → p2predict-0.9.4}/src/p2predict.egg-info/top_level.txt +0 -0
  40. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_benchmarks.py +0 -0
  41. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_cli.py +0 -0
  42. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_explain.py +0 -0
  43. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_feature_selection.py +0 -0
  44. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_feature_selection_leakage.py +0 -0
  45. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_input_checks.py +0 -0
  46. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_intervals.py +0 -0
  47. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_io_and_evals.py +0 -0
  48. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_json_output.py +0 -0
  49. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_mcp.py +0 -0
  50. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_outliers.py +0 -0
  51. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_plotting.py +0 -0
  52. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_prepare_data.py +0 -0
  53. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_preprocessing.py +0 -0
  54. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_quality.py +0 -0
  55. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_training.py +0 -0
  56. {p2predict-0.9.1 → p2predict-0.9.4}/tests/test_whatif.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p2predict
3
- Version: 0.9.1
3
+ Version: 0.9.4
4
4
  Summary: Parametric price benchmarking for engineering and procurement trade-offs. Agentic first, runs on your data, stays on your machine.
5
5
  Author: Ahmed Khalil Hafsi
6
6
  License-Expression: PolyForm-Noncommercial-1.0.0
@@ -26,7 +26,7 @@ Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
27
  Requires-Dist: click>=8.1
28
28
  Requires-Dist: joblib>=1.2
29
- Requires-Dist: matplotlib>=3.7
29
+ Requires-Dist: matplotlib>=3.9
30
30
  Requires-Dist: mpld3>=0.5
31
31
  Requires-Dist: numpy>=1.24
32
32
  Requires-Dist: pandas<3.0,>=2.0
@@ -46,7 +46,7 @@ Dynamic: license-file
46
46
 
47
47
  <div align="center">
48
48
 
49
- # P2Predict
49
+ <img src="./documentation/logo.svg" alt="P2Predict" width="240" />
50
50
 
51
51
  ### The right price is already in your data.
52
52
 
@@ -59,6 +59,14 @@ Dynamic: license-file
59
59
 
60
60
  ![P2Predict MCP Demo](./documentation/p2predict_mcp_demo.gif)
61
61
 
62
+ **Set up in one command:**
63
+
64
+ ```bash
65
+ pip install p2predict[mcp]
66
+ ```
67
+
68
+ Built for procurement and engineering teams in automotive, semiconductors, electronics, industrials, pharma, and chemicals.
69
+
62
70
  </div>
63
71
 
64
72
  ## The problem
@@ -151,7 +159,7 @@ Drop the whole RFQ on the agent. Every line gets a target and a range. The eight
151
159
 
152
160
  Most tools hand you a number and walk away. P2Predict hands you the number **and tells you how confident to be in it**, per part, in dollars. That honesty is the whole point: a confident-but-wrong benchmark loses you credibility the moment a supplier checks it.
153
161
 
154
- ![Honest confidence ranges, per part](./case-studies/battery-management-ics/assets/intervals_comparison.png)
162
+ ![Honest confidence ranges, per part](./documentation/charts/confidence-range.svg)
155
163
 
156
164
  Three real parts, three different confidence ranges. The model is tight on the part it knows well and openly uncertain on the ones it doesn't. A narrow range means negotiate hard. A wide one means get a quote first. Your category manager always knows which.
157
165
 
@@ -165,7 +173,7 @@ Point P2Predict at a category and it shows you the levers. These charts come str
165
173
 
166
174
  **Supplier choice is the biggest lever on the board.** Same single-cell chip, identical spec, sorted by who makes it:
167
175
 
168
- ![Supplier premium on an identical part](./case-studies/battery-management-ics/assets/manufacturer_premium.png)
176
+ ![Supplier premium on an identical part](./documentation/charts/supplier-premium.svg)
169
177
 
170
178
  The premium supplier is priced at roughly four times the value option for the same part. That is a number you take into a negotiation, backed by your own data.
171
179
 
@@ -175,10 +183,18 @@ The premium supplier is priced at roughly four times the value option for the sa
175
183
 
176
184
  Package size, supplier premium, multi-cell architecture: each one in dollars, each one adding up exactly to the predicted price. This is what lets your category manager say *"I know what I'm paying for, and here's the line I want to cut."*
177
185
 
186
+ **Complexity is priced, not assumed.** Every package pin on this same chip adds cost, monotonically, from $2.31 at 8 pins to $4.88 at 48 pins:
187
+
188
+ ![Package complexity priced by pin count](./documentation/charts/pin-count-curve.svg)
189
+
190
+ And on the 30 parts held back from training, entirely unseen by the model, predictions land within roughly 16% of the actual price half the time, and within 73% nine times in ten. That's the model showing its work on parts it never saw, not asking you to trust it blind.
191
+
178
192
  ## How it fits your stack
179
193
 
180
194
  **You don't use P2Predict; your agent does.** It speaks to **any AI agent** through a standard connector — Claude, GPT, or a local model — so your category managers never learn a new tool. They ask the assistant they already use, and it runs the analysis for them. This is agentic-first: there is no dashboard and no app, the interface is the agent you already have.
181
195
 
196
+ Under the hood, P2Predict is two layers. A **math layer** trains on your spend, predicts the price, attributes it spec by spec, and puts a calibrated range on every estimate — the defensible statistics. A **judgment layer** sits on top and steers the conversation: which analysis to run, when to stop and ask you for more data, and whether a result is solid enough to quote or needs a real RFQ first. It's what keeps a weaker agent from overstating a number it shouldn't.
197
+
182
198
  Everything runs **on your own machine**. Your purchasing data is your most sensitive commercial asset, so P2Predict never uploads it and no third party trains on it. Pair it with a local model to keep the whole loop offline, or with a cloud agent if you prefer; either way your raw spend stays put, with no data-residency conversation to have with legal.
183
199
 
184
200
  It complements should-cost tools, it does not replace them. Bottom-up should-costing builds a part up from material, labor, and machine time to estimate what it *should cost to make*. P2Predict does not do that and is not trying to. It answers the other question every category manager actually asks: *what has the market charged us for parts like this, and what should we expect to pay for the next one?*
@@ -193,11 +209,48 @@ Three worked case studies, each reproducible end to end on data anyone can downl
193
209
 
194
210
  Each one leads with results, shows where to trust them, and points to exactly where every number comes from.
195
211
 
212
+ ## FAQ
213
+
214
+ **Is it really free?**
215
+ Yes, for internal use. P2Predict is source-available under the PolyForm Noncommercial License. No seats, no trial period, no sales call. A commercial license is only needed if you deploy it for clients or embed it in a paid product.
216
+
217
+ **How reliable are the numbers?**
218
+ Every estimate comes with a range, not just a number, and the range is honest about how thin your data is: wide where history is sparse, tight where it's deep. On the public case studies, predictions land within roughly 16% of the actual price half the time, and within 73% nine times in ten. That's the model showing its work, not asking you to trust it blind.
219
+
220
+ **Does my data ever leave my machine?**
221
+ No. P2Predict trains and predicts entirely on your own machine. The only thing that leaves is whatever your AI agent normally sends to its own model. Pair it with a local model to keep that offline too.
222
+
223
+ **Which AI agents does it work with?**
224
+ Any agent that speaks MCP: Claude, GPT-based agents, or a model running locally. That's the core idea behind P2Predict: it's a capability for your agent to use, not a new tool for you to learn. No dashboard, no separate login. It just shows up wherever you already do your work with your agent.
225
+
226
+ **Is this a should-cost tool?**
227
+ No. Should-costing builds a part up from material, labor, and machine time. P2Predict benchmarks against what the market has actually charged for comparable parts.
228
+
229
+ **Why is this open source?**
230
+ Because a closed tool only ever does what its vendor decided to ship. Source-available means you, or your agent, can read every line, tune the code or the interfaces to your company's ecosystem, or wire it into your own stack and other tools without waiting on anyone's roadmap. That kind of ownership doesn't exist behind a closed API.
231
+
232
+ **Who built P2Predict?**
233
+ It started in 2023 as a project in my free time, weekends and sporadic evenings. See below for the background it draws on.
234
+
235
+ **Who do I talk to about rolling this out for my team?**
236
+ Nobody, really: it installs with one pip command and runs on your own data in a few minutes. Start with [INSTALL.md](INSTALL.md) and [TECHNICAL.md](TECHNICAL.md). If you'd still like a hand, want a commercial license, or want to share a dataset for a future case study, reach out at [ahmedhafsi.com/contact](https://ahmedhafsi.com/contact). Happy to help.
237
+
196
238
  ## Who built it
197
239
 
198
- P2Predict is built and maintained by **[Ahmed K. Hafsi](https://ahmedhafsi.com)**, Senior Manager of Negotiation Excellence at Infineon, where he leads negotiation strategy across automotive, semiconductor, consumer, and chemicals categories in Asia-Pacific. He built and led Dyson's global Negotiation Excellence capability and advised on negotiation and applied game theory at TWS Partners in Munich and London. He trained as an engineer at the Karlsruhe Institute of Technology and works across three continents in four languages.
240
+ P2Predict is built and maintained by **[Ahmed K. Hafsi](https://ahmedhafsi.com)**.
241
+
242
+ **Experience**
243
+
244
+ - **Senior Manager, Negotiation Excellence** — Infineon Technologies (2023–present). High-stakes deals across Asia, including foundry, OSAT, and strategic suppliers.
245
+ - **Senior Manager, Negotiation Excellence** — Dyson (2020–2023). Architected and led the global Negotiation Excellence capability: governance, KPIs, tooling, and renegotiation campaigns.
246
+ - **Senior Management Consultant, Negotiation & Game Theory** — TWS Partners, Munich & London (2014–2019). Advised industrial clients on negotiation strategy and applied game theory.
247
+
248
+ **Education & training**
249
+
250
+ - Karlsruhe Institute of Technology (KIT), Electrical Engineering & Information Technology (2008–2014).
251
+ - Harvard Law School, Program on Negotiation (2021). Negotiation Master Class: Advanced Strategies for Experienced Negotiators.
199
252
 
200
- P2Predict comes out of that work: the tools a procurement team actually needs to walk into a negotiation knowing its number and its leverage. More on his approach to negotiation, pricing, and game theory at **[ahmedhafsi.com](https://ahmedhafsi.com)**.
253
+ P2Predict comes out of that work: the tools a procurement team actually needs to walk into a negotiation knowing its number and its leverage. More at **[ahmedhafsi.com](https://ahmedhafsi.com)**.
201
254
 
202
255
  ## Try it / set it up
203
256
 
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
 
3
- # P2Predict
3
+ <img src="./documentation/logo.svg" alt="P2Predict" width="240" />
4
4
 
5
5
  ### The right price is already in your data.
6
6
 
@@ -13,6 +13,14 @@
13
13
 
14
14
  ![P2Predict MCP Demo](./documentation/p2predict_mcp_demo.gif)
15
15
 
16
+ **Set up in one command:**
17
+
18
+ ```bash
19
+ pip install p2predict[mcp]
20
+ ```
21
+
22
+ Built for procurement and engineering teams in automotive, semiconductors, electronics, industrials, pharma, and chemicals.
23
+
16
24
  </div>
17
25
 
18
26
  ## The problem
@@ -105,7 +113,7 @@ Drop the whole RFQ on the agent. Every line gets a target and a range. The eight
105
113
 
106
114
  Most tools hand you a number and walk away. P2Predict hands you the number **and tells you how confident to be in it**, per part, in dollars. That honesty is the whole point: a confident-but-wrong benchmark loses you credibility the moment a supplier checks it.
107
115
 
108
- ![Honest confidence ranges, per part](./case-studies/battery-management-ics/assets/intervals_comparison.png)
116
+ ![Honest confidence ranges, per part](./documentation/charts/confidence-range.svg)
109
117
 
110
118
  Three real parts, three different confidence ranges. The model is tight on the part it knows well and openly uncertain on the ones it doesn't. A narrow range means negotiate hard. A wide one means get a quote first. Your category manager always knows which.
111
119
 
@@ -119,7 +127,7 @@ Point P2Predict at a category and it shows you the levers. These charts come str
119
127
 
120
128
  **Supplier choice is the biggest lever on the board.** Same single-cell chip, identical spec, sorted by who makes it:
121
129
 
122
- ![Supplier premium on an identical part](./case-studies/battery-management-ics/assets/manufacturer_premium.png)
130
+ ![Supplier premium on an identical part](./documentation/charts/supplier-premium.svg)
123
131
 
124
132
  The premium supplier is priced at roughly four times the value option for the same part. That is a number you take into a negotiation, backed by your own data.
125
133
 
@@ -129,10 +137,18 @@ The premium supplier is priced at roughly four times the value option for the sa
129
137
 
130
138
  Package size, supplier premium, multi-cell architecture: each one in dollars, each one adding up exactly to the predicted price. This is what lets your category manager say *"I know what I'm paying for, and here's the line I want to cut."*
131
139
 
140
+ **Complexity is priced, not assumed.** Every package pin on this same chip adds cost, monotonically, from $2.31 at 8 pins to $4.88 at 48 pins:
141
+
142
+ ![Package complexity priced by pin count](./documentation/charts/pin-count-curve.svg)
143
+
144
+ And on the 30 parts held back from training, entirely unseen by the model, predictions land within roughly 16% of the actual price half the time, and within 73% nine times in ten. That's the model showing its work on parts it never saw, not asking you to trust it blind.
145
+
132
146
  ## How it fits your stack
133
147
 
134
148
  **You don't use P2Predict; your agent does.** It speaks to **any AI agent** through a standard connector — Claude, GPT, or a local model — so your category managers never learn a new tool. They ask the assistant they already use, and it runs the analysis for them. This is agentic-first: there is no dashboard and no app, the interface is the agent you already have.
135
149
 
150
+ Under the hood, P2Predict is two layers. A **math layer** trains on your spend, predicts the price, attributes it spec by spec, and puts a calibrated range on every estimate — the defensible statistics. A **judgment layer** sits on top and steers the conversation: which analysis to run, when to stop and ask you for more data, and whether a result is solid enough to quote or needs a real RFQ first. It's what keeps a weaker agent from overstating a number it shouldn't.
151
+
136
152
  Everything runs **on your own machine**. Your purchasing data is your most sensitive commercial asset, so P2Predict never uploads it and no third party trains on it. Pair it with a local model to keep the whole loop offline, or with a cloud agent if you prefer; either way your raw spend stays put, with no data-residency conversation to have with legal.
137
153
 
138
154
  It complements should-cost tools, it does not replace them. Bottom-up should-costing builds a part up from material, labor, and machine time to estimate what it *should cost to make*. P2Predict does not do that and is not trying to. It answers the other question every category manager actually asks: *what has the market charged us for parts like this, and what should we expect to pay for the next one?*
@@ -147,11 +163,48 @@ Three worked case studies, each reproducible end to end on data anyone can downl
147
163
 
148
164
  Each one leads with results, shows where to trust them, and points to exactly where every number comes from.
149
165
 
166
+ ## FAQ
167
+
168
+ **Is it really free?**
169
+ Yes, for internal use. P2Predict is source-available under the PolyForm Noncommercial License. No seats, no trial period, no sales call. A commercial license is only needed if you deploy it for clients or embed it in a paid product.
170
+
171
+ **How reliable are the numbers?**
172
+ Every estimate comes with a range, not just a number, and the range is honest about how thin your data is: wide where history is sparse, tight where it's deep. On the public case studies, predictions land within roughly 16% of the actual price half the time, and within 73% nine times in ten. That's the model showing its work, not asking you to trust it blind.
173
+
174
+ **Does my data ever leave my machine?**
175
+ No. P2Predict trains and predicts entirely on your own machine. The only thing that leaves is whatever your AI agent normally sends to its own model. Pair it with a local model to keep that offline too.
176
+
177
+ **Which AI agents does it work with?**
178
+ Any agent that speaks MCP: Claude, GPT-based agents, or a model running locally. That's the core idea behind P2Predict: it's a capability for your agent to use, not a new tool for you to learn. No dashboard, no separate login. It just shows up wherever you already do your work with your agent.
179
+
180
+ **Is this a should-cost tool?**
181
+ No. Should-costing builds a part up from material, labor, and machine time. P2Predict benchmarks against what the market has actually charged for comparable parts.
182
+
183
+ **Why is this open source?**
184
+ Because a closed tool only ever does what its vendor decided to ship. Source-available means you, or your agent, can read every line, tune the code or the interfaces to your company's ecosystem, or wire it into your own stack and other tools without waiting on anyone's roadmap. That kind of ownership doesn't exist behind a closed API.
185
+
186
+ **Who built P2Predict?**
187
+ It started in 2023 as a project in my free time, weekends and sporadic evenings. See below for the background it draws on.
188
+
189
+ **Who do I talk to about rolling this out for my team?**
190
+ Nobody, really: it installs with one pip command and runs on your own data in a few minutes. Start with [INSTALL.md](INSTALL.md) and [TECHNICAL.md](TECHNICAL.md). If you'd still like a hand, want a commercial license, or want to share a dataset for a future case study, reach out at [ahmedhafsi.com/contact](https://ahmedhafsi.com/contact). Happy to help.
191
+
150
192
  ## Who built it
151
193
 
152
- P2Predict is built and maintained by **[Ahmed K. Hafsi](https://ahmedhafsi.com)**, Senior Manager of Negotiation Excellence at Infineon, where he leads negotiation strategy across automotive, semiconductor, consumer, and chemicals categories in Asia-Pacific. He built and led Dyson's global Negotiation Excellence capability and advised on negotiation and applied game theory at TWS Partners in Munich and London. He trained as an engineer at the Karlsruhe Institute of Technology and works across three continents in four languages.
194
+ P2Predict is built and maintained by **[Ahmed K. Hafsi](https://ahmedhafsi.com)**.
195
+
196
+ **Experience**
197
+
198
+ - **Senior Manager, Negotiation Excellence** — Infineon Technologies (2023–present). High-stakes deals across Asia, including foundry, OSAT, and strategic suppliers.
199
+ - **Senior Manager, Negotiation Excellence** — Dyson (2020–2023). Architected and led the global Negotiation Excellence capability: governance, KPIs, tooling, and renegotiation campaigns.
200
+ - **Senior Management Consultant, Negotiation & Game Theory** — TWS Partners, Munich & London (2014–2019). Advised industrial clients on negotiation strategy and applied game theory.
201
+
202
+ **Education & training**
203
+
204
+ - Karlsruhe Institute of Technology (KIT), Electrical Engineering & Information Technology (2008–2014).
205
+ - Harvard Law School, Program on Negotiation (2021). Negotiation Master Class: Advanced Strategies for Experienced Negotiators.
153
206
 
154
- P2Predict comes out of that work: the tools a procurement team actually needs to walk into a negotiation knowing its number and its leverage. More on his approach to negotiation, pricing, and game theory at **[ahmedhafsi.com](https://ahmedhafsi.com)**.
207
+ P2Predict comes out of that work: the tools a procurement team actually needs to walk into a negotiation knowing its number and its leverage. More at **[ahmedhafsi.com](https://ahmedhafsi.com)**.
155
208
 
156
209
  ## Try it / set it up
157
210
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "p2predict"
7
- version = "0.9.1"
7
+ version = "0.9.4"
8
8
  description = "Parametric price benchmarking for engineering and procurement trade-offs. Agentic first, runs on your data, stays on your machine."
9
9
  readme = "README.md"
10
10
  license = "PolyForm-Noncommercial-1.0.0"
@@ -39,7 +39,7 @@ classifiers = [
39
39
  dependencies = [
40
40
  "click>=8.1",
41
41
  "joblib>=1.2",
42
- "matplotlib>=3.7",
42
+ "matplotlib>=3.9",
43
43
  "mpld3>=0.5",
44
44
  "numpy>=1.24",
45
45
  "pandas>=2.0,<3.0",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p2predict
3
- Version: 0.9.1
3
+ Version: 0.9.4
4
4
  Summary: Parametric price benchmarking for engineering and procurement trade-offs. Agentic first, runs on your data, stays on your machine.
5
5
  Author: Ahmed Khalil Hafsi
6
6
  License-Expression: PolyForm-Noncommercial-1.0.0
@@ -26,7 +26,7 @@ Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
27
  Requires-Dist: click>=8.1
28
28
  Requires-Dist: joblib>=1.2
29
- Requires-Dist: matplotlib>=3.7
29
+ Requires-Dist: matplotlib>=3.9
30
30
  Requires-Dist: mpld3>=0.5
31
31
  Requires-Dist: numpy>=1.24
32
32
  Requires-Dist: pandas<3.0,>=2.0
@@ -46,7 +46,7 @@ Dynamic: license-file
46
46
 
47
47
  <div align="center">
48
48
 
49
- # P2Predict
49
+ <img src="./documentation/logo.svg" alt="P2Predict" width="240" />
50
50
 
51
51
  ### The right price is already in your data.
52
52
 
@@ -59,6 +59,14 @@ Dynamic: license-file
59
59
 
60
60
  ![P2Predict MCP Demo](./documentation/p2predict_mcp_demo.gif)
61
61
 
62
+ **Set up in one command:**
63
+
64
+ ```bash
65
+ pip install p2predict[mcp]
66
+ ```
67
+
68
+ Built for procurement and engineering teams in automotive, semiconductors, electronics, industrials, pharma, and chemicals.
69
+
62
70
  </div>
63
71
 
64
72
  ## The problem
@@ -151,7 +159,7 @@ Drop the whole RFQ on the agent. Every line gets a target and a range. The eight
151
159
 
152
160
  Most tools hand you a number and walk away. P2Predict hands you the number **and tells you how confident to be in it**, per part, in dollars. That honesty is the whole point: a confident-but-wrong benchmark loses you credibility the moment a supplier checks it.
153
161
 
154
- ![Honest confidence ranges, per part](./case-studies/battery-management-ics/assets/intervals_comparison.png)
162
+ ![Honest confidence ranges, per part](./documentation/charts/confidence-range.svg)
155
163
 
156
164
  Three real parts, three different confidence ranges. The model is tight on the part it knows well and openly uncertain on the ones it doesn't. A narrow range means negotiate hard. A wide one means get a quote first. Your category manager always knows which.
157
165
 
@@ -165,7 +173,7 @@ Point P2Predict at a category and it shows you the levers. These charts come str
165
173
 
166
174
  **Supplier choice is the biggest lever on the board.** Same single-cell chip, identical spec, sorted by who makes it:
167
175
 
168
- ![Supplier premium on an identical part](./case-studies/battery-management-ics/assets/manufacturer_premium.png)
176
+ ![Supplier premium on an identical part](./documentation/charts/supplier-premium.svg)
169
177
 
170
178
  The premium supplier is priced at roughly four times the value option for the same part. That is a number you take into a negotiation, backed by your own data.
171
179
 
@@ -175,10 +183,18 @@ The premium supplier is priced at roughly four times the value option for the sa
175
183
 
176
184
  Package size, supplier premium, multi-cell architecture: each one in dollars, each one adding up exactly to the predicted price. This is what lets your category manager say *"I know what I'm paying for, and here's the line I want to cut."*
177
185
 
186
+ **Complexity is priced, not assumed.** Every package pin on this same chip adds cost, monotonically, from $2.31 at 8 pins to $4.88 at 48 pins:
187
+
188
+ ![Package complexity priced by pin count](./documentation/charts/pin-count-curve.svg)
189
+
190
+ And on the 30 parts held back from training, entirely unseen by the model, predictions land within roughly 16% of the actual price half the time, and within 73% nine times in ten. That's the model showing its work on parts it never saw, not asking you to trust it blind.
191
+
178
192
  ## How it fits your stack
179
193
 
180
194
  **You don't use P2Predict; your agent does.** It speaks to **any AI agent** through a standard connector — Claude, GPT, or a local model — so your category managers never learn a new tool. They ask the assistant they already use, and it runs the analysis for them. This is agentic-first: there is no dashboard and no app, the interface is the agent you already have.
181
195
 
196
+ Under the hood, P2Predict is two layers. A **math layer** trains on your spend, predicts the price, attributes it spec by spec, and puts a calibrated range on every estimate — the defensible statistics. A **judgment layer** sits on top and steers the conversation: which analysis to run, when to stop and ask you for more data, and whether a result is solid enough to quote or needs a real RFQ first. It's what keeps a weaker agent from overstating a number it shouldn't.
197
+
182
198
  Everything runs **on your own machine**. Your purchasing data is your most sensitive commercial asset, so P2Predict never uploads it and no third party trains on it. Pair it with a local model to keep the whole loop offline, or with a cloud agent if you prefer; either way your raw spend stays put, with no data-residency conversation to have with legal.
183
199
 
184
200
  It complements should-cost tools, it does not replace them. Bottom-up should-costing builds a part up from material, labor, and machine time to estimate what it *should cost to make*. P2Predict does not do that and is not trying to. It answers the other question every category manager actually asks: *what has the market charged us for parts like this, and what should we expect to pay for the next one?*
@@ -193,11 +209,48 @@ Three worked case studies, each reproducible end to end on data anyone can downl
193
209
 
194
210
  Each one leads with results, shows where to trust them, and points to exactly where every number comes from.
195
211
 
212
+ ## FAQ
213
+
214
+ **Is it really free?**
215
+ Yes, for internal use. P2Predict is source-available under the PolyForm Noncommercial License. No seats, no trial period, no sales call. A commercial license is only needed if you deploy it for clients or embed it in a paid product.
216
+
217
+ **How reliable are the numbers?**
218
+ Every estimate comes with a range, not just a number, and the range is honest about how thin your data is: wide where history is sparse, tight where it's deep. On the public case studies, predictions land within roughly 16% of the actual price half the time, and within 73% nine times in ten. That's the model showing its work, not asking you to trust it blind.
219
+
220
+ **Does my data ever leave my machine?**
221
+ No. P2Predict trains and predicts entirely on your own machine. The only thing that leaves is whatever your AI agent normally sends to its own model. Pair it with a local model to keep that offline too.
222
+
223
+ **Which AI agents does it work with?**
224
+ Any agent that speaks MCP: Claude, GPT-based agents, or a model running locally. That's the core idea behind P2Predict: it's a capability for your agent to use, not a new tool for you to learn. No dashboard, no separate login. It just shows up wherever you already do your work with your agent.
225
+
226
+ **Is this a should-cost tool?**
227
+ No. Should-costing builds a part up from material, labor, and machine time. P2Predict benchmarks against what the market has actually charged for comparable parts.
228
+
229
+ **Why is this open source?**
230
+ Because a closed tool only ever does what its vendor decided to ship. Source-available means you, or your agent, can read every line, tune the code or the interfaces to your company's ecosystem, or wire it into your own stack and other tools without waiting on anyone's roadmap. That kind of ownership doesn't exist behind a closed API.
231
+
232
+ **Who built P2Predict?**
233
+ It started in 2023 as a project in my free time, weekends and sporadic evenings. See below for the background it draws on.
234
+
235
+ **Who do I talk to about rolling this out for my team?**
236
+ Nobody, really: it installs with one pip command and runs on your own data in a few minutes. Start with [INSTALL.md](INSTALL.md) and [TECHNICAL.md](TECHNICAL.md). If you'd still like a hand, want a commercial license, or want to share a dataset for a future case study, reach out at [ahmedhafsi.com/contact](https://ahmedhafsi.com/contact). Happy to help.
237
+
196
238
  ## Who built it
197
239
 
198
- P2Predict is built and maintained by **[Ahmed K. Hafsi](https://ahmedhafsi.com)**, Senior Manager of Negotiation Excellence at Infineon, where he leads negotiation strategy across automotive, semiconductor, consumer, and chemicals categories in Asia-Pacific. He built and led Dyson's global Negotiation Excellence capability and advised on negotiation and applied game theory at TWS Partners in Munich and London. He trained as an engineer at the Karlsruhe Institute of Technology and works across three continents in four languages.
240
+ P2Predict is built and maintained by **[Ahmed K. Hafsi](https://ahmedhafsi.com)**.
241
+
242
+ **Experience**
243
+
244
+ - **Senior Manager, Negotiation Excellence** — Infineon Technologies (2023–present). High-stakes deals across Asia, including foundry, OSAT, and strategic suppliers.
245
+ - **Senior Manager, Negotiation Excellence** — Dyson (2020–2023). Architected and led the global Negotiation Excellence capability: governance, KPIs, tooling, and renegotiation campaigns.
246
+ - **Senior Management Consultant, Negotiation & Game Theory** — TWS Partners, Munich & London (2014–2019). Advised industrial clients on negotiation strategy and applied game theory.
247
+
248
+ **Education & training**
249
+
250
+ - Karlsruhe Institute of Technology (KIT), Electrical Engineering & Information Technology (2008–2014).
251
+ - Harvard Law School, Program on Negotiation (2021). Negotiation Master Class: Advanced Strategies for Experienced Negotiators.
199
252
 
200
- P2Predict comes out of that work: the tools a procurement team actually needs to walk into a negotiation knowing its number and its leverage. More on his approach to negotiation, pricing, and game theory at **[ahmedhafsi.com](https://ahmedhafsi.com)**.
253
+ P2Predict comes out of that work: the tools a procurement team actually needs to walk into a negotiation knowing its number and its leverage. More at **[ahmedhafsi.com](https://ahmedhafsi.com)**.
201
254
 
202
255
  ## Try it / set it up
203
256
 
@@ -1,6 +1,6 @@
1
1
  click>=8.1
2
2
  joblib>=1.2
3
- matplotlib>=3.7
3
+ matplotlib>=3.9
4
4
  mpld3>=0.5
5
5
  numpy>=1.24
6
6
  pandas<3.0,>=2.0
File without changes
File without changes
File without changes
File without changes