quantology-modelmaker 0.1.0__tar.gz → 0.2.0__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.
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/MANIFEST.in +1 -0
- {quantology_modelmaker-0.1.0/quantology_modelmaker.egg-info → quantology_modelmaker-0.2.0}/PKG-INFO +127 -17
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/README.md +114 -16
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/App.tsx +244 -17
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/BlockNode.tsx +159 -3
- quantology_modelmaker-0.2.0/frontend/src/BuildPanel.tsx +589 -0
- quantology_modelmaker-0.2.0/frontend/src/BuildReport.tsx +209 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/CodeEditor.tsx +10 -3
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/DataModal.tsx +86 -2
- quantology_modelmaker-0.2.0/frontend/src/EnvVarField.tsx +89 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/FileBrowser.tsx +36 -7
- quantology_modelmaker-0.2.0/frontend/src/GhostNode.tsx +63 -0
- quantology_modelmaker-0.2.0/frontend/src/GitPanel.tsx +161 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/Inspector.tsx +89 -6
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/Palette.tsx +3 -1
- quantology_modelmaker-0.2.0/frontend/src/ParamsForm.tsx +491 -0
- quantology_modelmaker-0.2.0/frontend/src/PortDataView.tsx +320 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/SettingsPanel.tsx +73 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/Toolbar.tsx +66 -8
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/api.ts +64 -0
- quantology_modelmaker-0.2.0/frontend/src/roles.ts +42 -0
- quantology_modelmaker-0.2.0/frontend/src/types.ts +369 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/vite.config.ts +3 -1
- quantology_modelmaker-0.2.0/modelmaker/agent/__init__.py +1 -0
- quantology_modelmaker-0.2.0/modelmaker/agent/build.py +435 -0
- quantology_modelmaker-0.2.0/modelmaker/agent/catalogue.py +145 -0
- quantology_modelmaker-0.2.0/modelmaker/agent/controller.py +566 -0
- quantology_modelmaker-0.2.0/modelmaker/agent/layout.py +71 -0
- quantology_modelmaker-0.2.0/modelmaker/agent/loop.py +629 -0
- quantology_modelmaker-0.2.0/modelmaker/agent/mcp_server.py +90 -0
- quantology_modelmaker-0.2.0/modelmaker/agent/prompts.py +211 -0
- quantology_modelmaker-0.2.0/modelmaker/agent/tools.py +837 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/api.py +682 -76
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/blocks/base.py +18 -1
- quantology_modelmaker-0.2.0/modelmaker/blocks/binning.py +498 -0
- quantology_modelmaker-0.2.0/modelmaker/blocks/data_quality.py +304 -0
- quantology_modelmaker-0.2.0/modelmaker/blocks/feature_analysis.py +318 -0
- quantology_modelmaker-0.2.0/modelmaker/blocks/library.py +715 -0
- quantology_modelmaker-0.2.0/modelmaker/blocks/modelling.py +1203 -0
- quantology_modelmaker-0.2.0/modelmaker/blocks/stat_tests.py +509 -0
- quantology_modelmaker-0.2.0/modelmaker/blocks/stochastic.py +932 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/compiler.py +101 -25
- quantology_modelmaker-0.2.0/modelmaker/demo_data.py +431 -0
- quantology_modelmaker-0.2.0/modelmaker/gitops.py +102 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/graph.py +62 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/llm/base.py +28 -5
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/llm/claude_cli_provider.py +16 -3
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/llm/prompts.py +69 -1
- quantology_modelmaker-0.2.0/modelmaker/llm/redact.py +45 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/llm/settings.py +19 -1
- quantology_modelmaker-0.2.0/modelmaker/llm/stub_provider.py +55 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/project.py +71 -3
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/run_worker.py +73 -6
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/runner.py +317 -109
- quantology_modelmaker-0.2.0/modelmaker/runslot.py +86 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/session.py +225 -12
- quantology_modelmaker-0.2.0/modelmaker/stochastic/__init__.py +12 -0
- quantology_modelmaker-0.2.0/modelmaker/stochastic/accumulate.py +174 -0
- quantology_modelmaker-0.2.0/modelmaker/stochastic/credit.py +107 -0
- quantology_modelmaker-0.2.0/modelmaker/stochastic/dependency.py +118 -0
- quantology_modelmaker-0.2.0/modelmaker/stochastic/distributions.py +202 -0
- quantology_modelmaker-0.2.0/modelmaker/stochastic/proxy.py +137 -0
- quantology_modelmaker-0.2.0/modelmaker/stochastic/seed.py +28 -0
- quantology_modelmaker-0.2.0/modelmaker/stochastic/var_covar.py +206 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/tui/app.py +40 -4
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/tui/canvas.py +21 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/tui/client.py +1 -1
- quantology_modelmaker-0.2.0/modelmaker/tui/paramspecs.py +235 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/util.py +1 -1
- quantology_modelmaker-0.2.0/modelmaker/worker_pool.py +200 -0
- quantology_modelmaker-0.2.0/projects/demo_pd_model/model.json +428 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/pyproject.toml +28 -5
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0/quantology_modelmaker.egg-info}/PKG-INFO +127 -17
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/quantology_modelmaker.egg-info/SOURCES.txt +54 -1
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/quantology_modelmaker.egg-info/entry_points.txt +1 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/quantology_modelmaker.egg-info/requires.txt +14 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/setup.py +26 -5
- quantology_modelmaker-0.2.0/tests/test_agent_api.py +267 -0
- quantology_modelmaker-0.2.0/tests/test_agent_build.py +611 -0
- quantology_modelmaker-0.2.0/tests/test_agent_foundations.py +254 -0
- quantology_modelmaker-0.2.0/tests/test_agent_loops.py +404 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_api.py +375 -5
- quantology_modelmaker-0.2.0/tests/test_binning.py +204 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_compiler.py +61 -14
- quantology_modelmaker-0.2.0/tests/test_data_quality.py +155 -0
- quantology_modelmaker-0.2.0/tests/test_demo_data.py +163 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_demo_project.py +1 -1
- quantology_modelmaker-0.2.0/tests/test_env_vars.py +91 -0
- quantology_modelmaker-0.2.0/tests/test_feature_analysis.py +41 -0
- quantology_modelmaker-0.2.0/tests/test_gitops.py +62 -0
- quantology_modelmaker-0.2.0/tests/test_input_blocks.py +242 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_llm.py +103 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_master_scale.py +56 -1
- quantology_modelmaker-0.2.0/tests/test_modelling.py +198 -0
- quantology_modelmaker-0.2.0/tests/test_prep_blocks.py +127 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_project.py +54 -2
- quantology_modelmaker-0.2.0/tests/test_risk_parameter_blocks.py +302 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_runner.py +24 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_session.py +135 -0
- quantology_modelmaker-0.2.0/tests/test_stat_tests.py +53 -0
- quantology_modelmaker-0.2.0/tests/test_stochastic_blocks.py +213 -0
- quantology_modelmaker-0.2.0/tests/test_stochastic_core.py +334 -0
- quantology_modelmaker-0.2.0/tests/test_stochastic_credit.py +231 -0
- quantology_modelmaker-0.2.0/tests/test_stochastic_fan_out.py +209 -0
- quantology_modelmaker-0.2.0/tests/test_stochastic_runner.py +95 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_tui_app.py +91 -51
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_tui_charts.py +2 -2
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_tui_client.py +2 -2
- quantology_modelmaker-0.2.0/tests/test_validation_blocks.py +98 -0
- quantology_modelmaker-0.1.0/frontend/src/ParamsForm.tsx +0 -272
- quantology_modelmaker-0.1.0/frontend/src/PortDataView.tsx +0 -95
- quantology_modelmaker-0.1.0/frontend/src/roles.ts +0 -17
- quantology_modelmaker-0.1.0/frontend/src/types.ts +0 -166
- quantology_modelmaker-0.1.0/modelmaker/blocks/library.py +0 -327
- quantology_modelmaker-0.1.0/modelmaker/blocks/modelling.py +0 -312
- quantology_modelmaker-0.1.0/modelmaker/blocks/stat_tests.py +0 -133
- quantology_modelmaker-0.1.0/modelmaker/llm/stub_provider.py +0 -29
- quantology_modelmaker-0.1.0/modelmaker/tui/paramspecs.py +0 -128
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/LICENSE +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/NOTICE +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/.gitignore +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/.npmrc +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/.oxlintrc.json +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/README.md +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/index.html +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/package-lock.json +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/package.json +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/public/brand-quantology/favicon.svg +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/public/brand-quantology/icon-mark-light.svg +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/public/icons.svg +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/DataWireEdge.tsx +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/LaneBand.tsx +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/LaneLabels.tsx +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/PortInspector.tsx +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/assets/hero.png +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/assets/react.svg +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/assets/vite.svg +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/index.css +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/src/main.tsx +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/tsconfig.app.json +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/tsconfig.json +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/frontend/tsconfig.node.json +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/__init__.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/blocks/__init__.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/cache.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/llm/__init__.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/llm/anthropic_provider.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/llm/gemini_provider.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/llm/lmstudio_provider.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/llm/openai_provider.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/metadata_transforms.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/packet.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/tui/__init__.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/tui/charts.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/tui/inspector.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/tui/preview.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/modelmaker/tui/screens.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/quantology_modelmaker.egg-info/dependency_links.txt +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/quantology_modelmaker.egg-info/top_level.txt +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/run.bat +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/setup.cfg +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_graph.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_library.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_packet.py +0 -0
- {quantology_modelmaker-0.1.0 → quantology_modelmaker-0.2.0}/tests/test_runner_streaming.py +0 -0
{quantology_modelmaker-0.1.0/quantology_modelmaker.egg-info → quantology_modelmaker-0.2.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quantology-modelmaker
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Visual pipeline builder for financial model development
|
|
5
5
|
Author-email: Maurits Malkus <10948172+mmalkus@users.noreply.github.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -26,16 +26,28 @@ Requires-Dist: uvicorn>=0.29.0
|
|
|
26
26
|
Requires-Dist: matplotlib>=3.8.0
|
|
27
27
|
Requires-Dist: scikit-learn>=1.4.0
|
|
28
28
|
Requires-Dist: scipy>=1.11.0
|
|
29
|
+
Requires-Dist: numpy>=1.26.0
|
|
29
30
|
Requires-Dist: python-dotenv>=1.0.0
|
|
31
|
+
Requires-Dist: mcp<2,>=1.0.0
|
|
30
32
|
Provides-Extra: dev
|
|
31
33
|
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-xdist>=3.5.0; extra == "dev"
|
|
32
35
|
Requires-Dist: httpx>=0.27.0; extra == "dev"
|
|
36
|
+
Requires-Dist: fastexcel>=0.10.0; extra == "dev"
|
|
37
|
+
Requires-Dist: xlsxwriter>=3.0.0; extra == "dev"
|
|
38
|
+
Requires-Dist: connectorx>=0.3.3; extra == "dev"
|
|
39
|
+
Requires-Dist: pyarrow>=16.0.0; extra == "dev"
|
|
33
40
|
Provides-Extra: anthropic
|
|
34
41
|
Requires-Dist: anthropic>=0.70.0; extra == "anthropic"
|
|
35
42
|
Provides-Extra: tui
|
|
36
43
|
Requires-Dist: textual>=0.80.0; extra == "tui"
|
|
37
44
|
Requires-Dist: httpx>=0.27.0; extra == "tui"
|
|
38
45
|
Requires-Dist: plotext<6,>=5.2.0; extra == "tui"
|
|
46
|
+
Provides-Extra: excel
|
|
47
|
+
Requires-Dist: fastexcel>=0.10.0; extra == "excel"
|
|
48
|
+
Provides-Extra: db
|
|
49
|
+
Requires-Dist: connectorx>=0.3.3; extra == "db"
|
|
50
|
+
Requires-Dist: pyarrow>=16.0.0; extra == "db"
|
|
39
51
|
Dynamic: license-file
|
|
40
52
|
|
|
41
53
|
# Model-Maker
|
|
@@ -91,19 +103,51 @@ it. It creates a `.venv` next to itself if missing, installs/upgrades
|
|
|
91
103
|
`quantology-modelmaker` into it, and starts `modelmaker-api` at
|
|
92
104
|
`http://127.0.0.1:8001`. Safe to re-run any time to pick up updates.
|
|
93
105
|
|
|
106
|
+
## Projects
|
|
107
|
+
|
|
108
|
+
A project is a folder, not a file: **Save**/**Load** browse for a folder
|
|
109
|
+
rather than a filename, and a folder is a project once it holds a
|
|
110
|
+
`model.json` (everything else in it -- `files/`, a `.gitignore`, custom
|
|
111
|
+
block code sidecars -- is the project's own working area, versioned
|
|
112
|
+
alongside it). Saving for the first time scaffolds that folder (see
|
|
113
|
+
[The demo project](#the-demo-project) for an example) and git-inits it, so
|
|
114
|
+
it's ready to commit and push right away from the **Git** panel.
|
|
115
|
+
|
|
94
116
|
## The demo project
|
|
95
117
|
|
|
96
|
-
[`projects/demo_pd_model
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
then **Run all** — it reads the CSV source itself since it's never been read
|
|
101
|
-
before, then runs the rest of the pipeline.
|
|
118
|
+
[`projects/demo_pd_model/`](projects/demo_pd_model) is a complete, runnable
|
|
119
|
+
PD pipeline: load demo data → clean → weight-of-evidence → train/test
|
|
120
|
+
split → logistic regression → Gini, KS and PSI. Open it with **Load** (it's
|
|
121
|
+
what the folder dialog opens on), then **Run all**.
|
|
102
122
|
|
|
103
123
|
It's the quickest way to see what a finished graph looks like, and the test
|
|
104
|
-
suite runs it end to end so it can't rot.
|
|
105
|
-
|
|
106
|
-
|
|
124
|
+
suite runs it end to end so it can't rot.
|
|
125
|
+
|
|
126
|
+
Its data comes from the **Demo credit data (PD/LGD/CCF)** input block,
|
|
127
|
+
which generates a synthetic retail book of term loans and credit cards in
|
|
128
|
+
memory: no file to find, and it works the same from a repo clone or a
|
|
129
|
+
`pip install`. It is built to support all three credit-risk parameters: a
|
|
130
|
+
12-month default flag for **PD**, EAD / discounted recoveries / workout
|
|
131
|
+
costs on every default for **LGD** (`compute_lgd`), and limit plus balance
|
|
132
|
+
at reference and at default on defaulted cards for **CCF**
|
|
133
|
+
(`compute_ccf`). Set **n_rows** for the number of records (default 5,000)
|
|
134
|
+
and **seed** to get different data; the same seed always gives the same
|
|
135
|
+
rows. The generator is [`modelmaker/demo_data.py`](modelmaker/demo_data.py),
|
|
136
|
+
whose docstring describes every column. To get the data as a CSV instead:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
python -m modelmaker.demo_data credit_risk_data.csv --rows 10000
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
After a `pip install`, copy the demo projects somewhere writable (projects
|
|
143
|
+
save back into their own folder) with:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
modelmaker-demo # creates ./modelmaker-demo/projects/
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
then run `modelmaker-api` (or `modelmaker-tui`) from inside that folder.
|
|
150
|
+
`modelmaker-tui --demo` does both steps in one go.
|
|
107
151
|
|
|
108
152
|
## Working in the tool
|
|
109
153
|
|
|
@@ -123,11 +167,16 @@ A few things worth knowing beyond the canvas itself.
|
|
|
123
167
|
their own undo. Undo restores the graph, not what you've run: reverting a
|
|
124
168
|
param lands back on a cache key that's already computed, so results you
|
|
125
169
|
already have aren't thrown away.
|
|
126
|
-
- **Unsaved work** —
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
170
|
+
- **Unsaved work** — once a project has a folder to save into, a dirty edit
|
|
171
|
+
autosaves back to it a couple of seconds after you stop typing/dragging (a
|
|
172
|
+
`•` on the Save button marks the brief window before that happens; the bar
|
|
173
|
+
says "autosaved HH:MM:SS" once it has). Every edit is also snapshotted to
|
|
174
|
+
`.modelmaker-cache/recovery.json` regardless -- crash recovery doesn't wait
|
|
175
|
+
on the debounce, and it's what covers a project that's never been saved at
|
|
176
|
+
all yet. After a crash or a closed browser, the app offers to restore it on
|
|
177
|
+
next start. Autosave only ever writes to your project's own `model.json`;
|
|
178
|
+
it never stages or commits anything -- git stays entirely manual, via the
|
|
179
|
+
Git panel.
|
|
131
180
|
- **Editing during a run** — a run is pinned to the graph as it stood when
|
|
132
181
|
it started, so you can keep editing (or undo, or toggle sample mode) while
|
|
133
182
|
a long sweep executes. The run finishes against its own version; anything
|
|
@@ -150,7 +199,8 @@ can be saved to a `.txt`/`.html` file alongside the block's own PNG.
|
|
|
150
199
|
|
|
151
200
|
```bash
|
|
152
201
|
modelmaker-tui # spawns its own modelmaker-api, zero setup
|
|
153
|
-
modelmaker-tui projects/demo_pd_model
|
|
202
|
+
modelmaker-tui projects/demo_pd_model # ...and loads a project (a folder) on startup
|
|
203
|
+
modelmaker-tui --demo # ...or sets up ./modelmaker-demo and opens the demo there
|
|
154
204
|
modelmaker-tui --host 127.0.0.1 --port 8001 # attach to an already-running modelmaker-api instead
|
|
155
205
|
```
|
|
156
206
|
|
|
@@ -227,6 +277,64 @@ export MODELMAKER_LLM_MODEL=gpt-5.1
|
|
|
227
277
|
modelmaker-api
|
|
228
278
|
```
|
|
229
279
|
|
|
280
|
+
## Build with AI
|
|
281
|
+
|
|
282
|
+
Beyond drafting one block at a time, an AI can plan and build a whole model
|
|
283
|
+
graph for you (design: [agent-builder-proposal.md](agent-builder-proposal.md)):
|
|
284
|
+
|
|
285
|
+
1. **Prepare the data yourself.** Add your input block(s), run them, and tag
|
|
286
|
+
column roles in the port inspector: at least `target`, plus `excluded`
|
|
287
|
+
for anything that must never become a feature (leaky or post-outcome
|
|
288
|
+
columns). The AI never picks files or touches credentials.
|
|
289
|
+
2. **Select** those blocks (shift-click for several), click **Build with AI**
|
|
290
|
+
and describe the goal.
|
|
291
|
+
3. **Preflight** checks the selected blocks and everything upstream of them.
|
|
292
|
+
Blocks that aren't up to date get a warning, with **Run upstream** to fix
|
|
293
|
+
them or **Proceed anyway**.
|
|
294
|
+
4. **Review the plan.** It appears as ghost blocks on the canvas and as a
|
|
295
|
+
list in the panel. Nothing changes until you approve. Send feedback to
|
|
296
|
+
have it re-plan.
|
|
297
|
+
5. **Watch it build.** It adds blocks, runs each one, reads their summary
|
|
298
|
+
statistics, fixes failures, and asks you when it's stuck. The canvas is
|
|
299
|
+
read-only for you meanwhile. A large dataset is built on a sample, then
|
|
300
|
+
the whole graph runs once on the full data.
|
|
301
|
+
6. **Read the report** with **Open full report** in the panel. Every
|
|
302
|
+
build keeps its own report, listed under **Build reports**. AI-built
|
|
303
|
+
blocks carry an **AI** badge; click it to see the provenance record
|
|
304
|
+
(build, LLMs, time, whether a person has edited the block since) and
|
|
305
|
+
open the report of each build that made or changed it. **One Undo
|
|
306
|
+
reverts the whole build**, its report included.
|
|
307
|
+
|
|
308
|
+
Guardrails are enforced by the tools, not just the prompt:
|
|
309
|
+
- **No rows.** The AI only ever sees column names, dtypes, roles and
|
|
310
|
+
summary statistics. The min/max of text and id columns are withheld too,
|
|
311
|
+
for every AI feature.
|
|
312
|
+
- **Your blocks stay yours.** It can read and wire *from* your blocks, but
|
|
313
|
+
it only changes blocks it created, plus changes to existing blocks that
|
|
314
|
+
the plan listed and you approved.
|
|
315
|
+
- **Excluded means excluded.** Columns tagged `excluded` are refused as
|
|
316
|
+
features.
|
|
317
|
+
- **Limits.** Tool calls, custom blocks, repeated failures and wall time
|
|
318
|
+
are all capped.
|
|
319
|
+
|
|
320
|
+
Builds run on `claude_cli` (your existing Claude login, via a small MCP
|
|
321
|
+
bridge), `anthropic`, `openai` (or any OpenAI-compatible endpoint that
|
|
322
|
+
supports tool calling, via its base URL), `gemini`, or `lmstudio`. They use
|
|
323
|
+
the same keys, models and base URLs as in the LLM provider settings above.
|
|
324
|
+
**Settings → AI builder** picks a separate plan LLM and build LLM, and each
|
|
325
|
+
build can override them.
|
|
326
|
+
|
|
327
|
+
`lmstudio` covers any local OpenAI-compatible server: LM Studio, or
|
|
328
|
+
llama.cpp's `llama-server` (start it with `--jinja`, which tool calling
|
|
329
|
+
needs), Ollama's `/v1`, or vLLM. The model is auto-detected when unset.
|
|
330
|
+
Local models get a compact prompt, where the block catalogue is block names
|
|
331
|
+
per category and details are fetched on demand. They also get length caps
|
|
332
|
+
on tool results, and older results are dropped when the conversation nears
|
|
333
|
+
the context window. The window size is read from the server (llama.cpp
|
|
334
|
+
reports it) or set with `MODELMAKER_LLM_CONTEXT_TOKENS`. Expect a local
|
|
335
|
+
build to take a while; `MODELMAKER_LLM_TIMEOUT_SECONDS` (default 900 for
|
|
336
|
+
local models) caps a single request.
|
|
337
|
+
|
|
230
338
|
## Project structure
|
|
231
339
|
|
|
232
340
|
```
|
|
@@ -234,14 +342,16 @@ modelmaker/
|
|
|
234
342
|
api.py FastAPI app and HTTP routes
|
|
235
343
|
blocks/ Block registry (standard library, modelling, stat tests)
|
|
236
344
|
llm/ Pluggable LLM providers for AI-assisted drafting
|
|
345
|
+
agent/ AI model builder: tools, guards, build lifecycle, loops, MCP bridge
|
|
237
346
|
graph.py Graph/block/wire data model
|
|
238
347
|
session.py Mutable project session wrapping the graph + runner
|
|
239
348
|
runner.py Block execution + caching engine
|
|
240
349
|
compiler.py Compiles a graph to a single Python script
|
|
350
|
+
demo_data.py Fixed-seed generator for the PD/LGD/CCF demo dataset
|
|
241
351
|
packet.py DataFramePacket: the typed value flowing over wires
|
|
242
352
|
project.py Load/save project files (JSON + block source files)
|
|
243
353
|
static/ Built frontend bundle (generated, gitignored)
|
|
244
354
|
frontend/ React + Vite UI
|
|
245
355
|
tests/ Pytest suite for the backend
|
|
246
|
-
sample_data/ Example CSVs
|
|
356
|
+
sample_data/ Example CSVs (tests also write a generated credit_risk_data.csv here, gitignored)
|
|
247
357
|
```
|
|
@@ -51,19 +51,51 @@ it. It creates a `.venv` next to itself if missing, installs/upgrades
|
|
|
51
51
|
`quantology-modelmaker` into it, and starts `modelmaker-api` at
|
|
52
52
|
`http://127.0.0.1:8001`. Safe to re-run any time to pick up updates.
|
|
53
53
|
|
|
54
|
+
## Projects
|
|
55
|
+
|
|
56
|
+
A project is a folder, not a file: **Save**/**Load** browse for a folder
|
|
57
|
+
rather than a filename, and a folder is a project once it holds a
|
|
58
|
+
`model.json` (everything else in it -- `files/`, a `.gitignore`, custom
|
|
59
|
+
block code sidecars -- is the project's own working area, versioned
|
|
60
|
+
alongside it). Saving for the first time scaffolds that folder (see
|
|
61
|
+
[The demo project](#the-demo-project) for an example) and git-inits it, so
|
|
62
|
+
it's ready to commit and push right away from the **Git** panel.
|
|
63
|
+
|
|
54
64
|
## The demo project
|
|
55
65
|
|
|
56
|
-
[`projects/demo_pd_model
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
then **Run all** — it reads the CSV source itself since it's never been read
|
|
61
|
-
before, then runs the rest of the pipeline.
|
|
66
|
+
[`projects/demo_pd_model/`](projects/demo_pd_model) is a complete, runnable
|
|
67
|
+
PD pipeline: load demo data → clean → weight-of-evidence → train/test
|
|
68
|
+
split → logistic regression → Gini, KS and PSI. Open it with **Load** (it's
|
|
69
|
+
what the folder dialog opens on), then **Run all**.
|
|
62
70
|
|
|
63
71
|
It's the quickest way to see what a finished graph looks like, and the test
|
|
64
|
-
suite runs it end to end so it can't rot.
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
suite runs it end to end so it can't rot.
|
|
73
|
+
|
|
74
|
+
Its data comes from the **Demo credit data (PD/LGD/CCF)** input block,
|
|
75
|
+
which generates a synthetic retail book of term loans and credit cards in
|
|
76
|
+
memory: no file to find, and it works the same from a repo clone or a
|
|
77
|
+
`pip install`. It is built to support all three credit-risk parameters: a
|
|
78
|
+
12-month default flag for **PD**, EAD / discounted recoveries / workout
|
|
79
|
+
costs on every default for **LGD** (`compute_lgd`), and limit plus balance
|
|
80
|
+
at reference and at default on defaulted cards for **CCF**
|
|
81
|
+
(`compute_ccf`). Set **n_rows** for the number of records (default 5,000)
|
|
82
|
+
and **seed** to get different data; the same seed always gives the same
|
|
83
|
+
rows. The generator is [`modelmaker/demo_data.py`](modelmaker/demo_data.py),
|
|
84
|
+
whose docstring describes every column. To get the data as a CSV instead:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
python -m modelmaker.demo_data credit_risk_data.csv --rows 10000
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
After a `pip install`, copy the demo projects somewhere writable (projects
|
|
91
|
+
save back into their own folder) with:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
modelmaker-demo # creates ./modelmaker-demo/projects/
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
then run `modelmaker-api` (or `modelmaker-tui`) from inside that folder.
|
|
98
|
+
`modelmaker-tui --demo` does both steps in one go.
|
|
67
99
|
|
|
68
100
|
## Working in the tool
|
|
69
101
|
|
|
@@ -83,11 +115,16 @@ A few things worth knowing beyond the canvas itself.
|
|
|
83
115
|
their own undo. Undo restores the graph, not what you've run: reverting a
|
|
84
116
|
param lands back on a cache key that's already computed, so results you
|
|
85
117
|
already have aren't thrown away.
|
|
86
|
-
- **Unsaved work** —
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
118
|
+
- **Unsaved work** — once a project has a folder to save into, a dirty edit
|
|
119
|
+
autosaves back to it a couple of seconds after you stop typing/dragging (a
|
|
120
|
+
`•` on the Save button marks the brief window before that happens; the bar
|
|
121
|
+
says "autosaved HH:MM:SS" once it has). Every edit is also snapshotted to
|
|
122
|
+
`.modelmaker-cache/recovery.json` regardless -- crash recovery doesn't wait
|
|
123
|
+
on the debounce, and it's what covers a project that's never been saved at
|
|
124
|
+
all yet. After a crash or a closed browser, the app offers to restore it on
|
|
125
|
+
next start. Autosave only ever writes to your project's own `model.json`;
|
|
126
|
+
it never stages or commits anything -- git stays entirely manual, via the
|
|
127
|
+
Git panel.
|
|
91
128
|
- **Editing during a run** — a run is pinned to the graph as it stood when
|
|
92
129
|
it started, so you can keep editing (or undo, or toggle sample mode) while
|
|
93
130
|
a long sweep executes. The run finishes against its own version; anything
|
|
@@ -110,7 +147,8 @@ can be saved to a `.txt`/`.html` file alongside the block's own PNG.
|
|
|
110
147
|
|
|
111
148
|
```bash
|
|
112
149
|
modelmaker-tui # spawns its own modelmaker-api, zero setup
|
|
113
|
-
modelmaker-tui projects/demo_pd_model
|
|
150
|
+
modelmaker-tui projects/demo_pd_model # ...and loads a project (a folder) on startup
|
|
151
|
+
modelmaker-tui --demo # ...or sets up ./modelmaker-demo and opens the demo there
|
|
114
152
|
modelmaker-tui --host 127.0.0.1 --port 8001 # attach to an already-running modelmaker-api instead
|
|
115
153
|
```
|
|
116
154
|
|
|
@@ -187,6 +225,64 @@ export MODELMAKER_LLM_MODEL=gpt-5.1
|
|
|
187
225
|
modelmaker-api
|
|
188
226
|
```
|
|
189
227
|
|
|
228
|
+
## Build with AI
|
|
229
|
+
|
|
230
|
+
Beyond drafting one block at a time, an AI can plan and build a whole model
|
|
231
|
+
graph for you (design: [agent-builder-proposal.md](agent-builder-proposal.md)):
|
|
232
|
+
|
|
233
|
+
1. **Prepare the data yourself.** Add your input block(s), run them, and tag
|
|
234
|
+
column roles in the port inspector: at least `target`, plus `excluded`
|
|
235
|
+
for anything that must never become a feature (leaky or post-outcome
|
|
236
|
+
columns). The AI never picks files or touches credentials.
|
|
237
|
+
2. **Select** those blocks (shift-click for several), click **Build with AI**
|
|
238
|
+
and describe the goal.
|
|
239
|
+
3. **Preflight** checks the selected blocks and everything upstream of them.
|
|
240
|
+
Blocks that aren't up to date get a warning, with **Run upstream** to fix
|
|
241
|
+
them or **Proceed anyway**.
|
|
242
|
+
4. **Review the plan.** It appears as ghost blocks on the canvas and as a
|
|
243
|
+
list in the panel. Nothing changes until you approve. Send feedback to
|
|
244
|
+
have it re-plan.
|
|
245
|
+
5. **Watch it build.** It adds blocks, runs each one, reads their summary
|
|
246
|
+
statistics, fixes failures, and asks you when it's stuck. The canvas is
|
|
247
|
+
read-only for you meanwhile. A large dataset is built on a sample, then
|
|
248
|
+
the whole graph runs once on the full data.
|
|
249
|
+
6. **Read the report** with **Open full report** in the panel. Every
|
|
250
|
+
build keeps its own report, listed under **Build reports**. AI-built
|
|
251
|
+
blocks carry an **AI** badge; click it to see the provenance record
|
|
252
|
+
(build, LLMs, time, whether a person has edited the block since) and
|
|
253
|
+
open the report of each build that made or changed it. **One Undo
|
|
254
|
+
reverts the whole build**, its report included.
|
|
255
|
+
|
|
256
|
+
Guardrails are enforced by the tools, not just the prompt:
|
|
257
|
+
- **No rows.** The AI only ever sees column names, dtypes, roles and
|
|
258
|
+
summary statistics. The min/max of text and id columns are withheld too,
|
|
259
|
+
for every AI feature.
|
|
260
|
+
- **Your blocks stay yours.** It can read and wire *from* your blocks, but
|
|
261
|
+
it only changes blocks it created, plus changes to existing blocks that
|
|
262
|
+
the plan listed and you approved.
|
|
263
|
+
- **Excluded means excluded.** Columns tagged `excluded` are refused as
|
|
264
|
+
features.
|
|
265
|
+
- **Limits.** Tool calls, custom blocks, repeated failures and wall time
|
|
266
|
+
are all capped.
|
|
267
|
+
|
|
268
|
+
Builds run on `claude_cli` (your existing Claude login, via a small MCP
|
|
269
|
+
bridge), `anthropic`, `openai` (or any OpenAI-compatible endpoint that
|
|
270
|
+
supports tool calling, via its base URL), `gemini`, or `lmstudio`. They use
|
|
271
|
+
the same keys, models and base URLs as in the LLM provider settings above.
|
|
272
|
+
**Settings → AI builder** picks a separate plan LLM and build LLM, and each
|
|
273
|
+
build can override them.
|
|
274
|
+
|
|
275
|
+
`lmstudio` covers any local OpenAI-compatible server: LM Studio, or
|
|
276
|
+
llama.cpp's `llama-server` (start it with `--jinja`, which tool calling
|
|
277
|
+
needs), Ollama's `/v1`, or vLLM. The model is auto-detected when unset.
|
|
278
|
+
Local models get a compact prompt, where the block catalogue is block names
|
|
279
|
+
per category and details are fetched on demand. They also get length caps
|
|
280
|
+
on tool results, and older results are dropped when the conversation nears
|
|
281
|
+
the context window. The window size is read from the server (llama.cpp
|
|
282
|
+
reports it) or set with `MODELMAKER_LLM_CONTEXT_TOKENS`. Expect a local
|
|
283
|
+
build to take a while; `MODELMAKER_LLM_TIMEOUT_SECONDS` (default 900 for
|
|
284
|
+
local models) caps a single request.
|
|
285
|
+
|
|
190
286
|
## Project structure
|
|
191
287
|
|
|
192
288
|
```
|
|
@@ -194,14 +290,16 @@ modelmaker/
|
|
|
194
290
|
api.py FastAPI app and HTTP routes
|
|
195
291
|
blocks/ Block registry (standard library, modelling, stat tests)
|
|
196
292
|
llm/ Pluggable LLM providers for AI-assisted drafting
|
|
293
|
+
agent/ AI model builder: tools, guards, build lifecycle, loops, MCP bridge
|
|
197
294
|
graph.py Graph/block/wire data model
|
|
198
295
|
session.py Mutable project session wrapping the graph + runner
|
|
199
296
|
runner.py Block execution + caching engine
|
|
200
297
|
compiler.py Compiles a graph to a single Python script
|
|
298
|
+
demo_data.py Fixed-seed generator for the PD/LGD/CCF demo dataset
|
|
201
299
|
packet.py DataFramePacket: the typed value flowing over wires
|
|
202
300
|
project.py Load/save project files (JSON + block source files)
|
|
203
301
|
static/ Built frontend bundle (generated, gitignored)
|
|
204
302
|
frontend/ React + Vite UI
|
|
205
303
|
tests/ Pytest suite for the backend
|
|
206
|
-
sample_data/ Example CSVs
|
|
304
|
+
sample_data/ Example CSVs (tests also write a generated credit_risk_data.csv here, gitignored)
|
|
207
305
|
```
|