Formulation Studio — read a whole recipe before you pour - #183
Merged
Merged
Conversation
Plug in a formulation (ingredients + ppm) and get the blended note-profile, the overpowering-component flag, a documented-hazard screen, and — against a target — a gap analysis with food-safe add/cut suggestions. - /api/formulation aggregates each ingredient's predicted aroma weighted by odor impact (OAV where thresholds are loaded, else mass x volatility) into the profile the blend reads as, naming the driving ingredient per note. - Overpowering-component flag derived from the blend weights, so it works in both the quantitative (OAV) and directional (volatility) bases. - Target gap analysis: short/over notes, with GRAS-preferred named carriers to add or ease back. - Honest data-gates surfaced in the UI: directional today; calibrated intensity and suppression/synergy unlock with odor-threshold / panel data. Performance: memoize predict_aroma and _resolve; pin the RF heads to n_jobs=1 (single-sample predict was spending ~150 ms/call on joblib thread spawn, ~3.8s -> ~1.2s per aroma read); local name->SMILES index so library molecules resolve offline; background pre-warm of the demo molecules. Signed-off-by: Austin L. <86896075+rvnminers-A-and-N@users.noreply.github.com>
This was referenced Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "before you pour" bench read
A bench chemist works with formulations — many ingredients at ppm — not single molecules. The Formulation Studio plugs in the whole recipe and predicts what it will come out like, so runs get spent where they count.
What it does
Engine
POST /api/formulationcomposes the existing RF taste/aroma heads +analyze_balance(OAV) +check_mixture+palette_match.Performance
predict_aromaand_resolve.n_jobs=1— single-samplepredict_probawas spending ~150 ms/call spawning a joblib thread pool (~3.8 s → ~1.2 s per 24-head aroma read); speeds the whole app.master_enrichment.parquet+ the suggest CSV) so library molecules resolve offline; only unknown names hit PubChem.Verified live with Playwright (three starter formulas, profile bars, overpowering flag, gap analysis, hazard path) and regression-checked
/api/predict+/api/mixture.