Skip to main content

Bulge-tier Excel financial model factory. Every cell live-formulated, every number traceable. MCP-native.

Project description

ModelForge

Status Tests Audit SOTA MCP Templates Public

Bulge-tier Excel financial model factory for credit & structured finance. Every cell live-formulated. Every number traceable back to the source document page it came from.

Built for Italian private capital (unitranche, minibond, project finance, RE, NPL, structured credit) — extensible to any asset class.

Use it inside Claude Code, Cursor, ChatGPT Enterprise (MCP-native)

PyPI name: modelforge-finance (the unscoped modelforge was taken by source{d}'s ML library). Import name stays modelforge.

pip install "modelforge-finance[mcp,export]"

# wire into your MCP client config:
{
  "mcpServers": {
    "modelforge": { "command": "modelforge-mcp" }
  }
}

Then in your AI assistant:

"Build me a unitranche LBO model from this YAML spec, export the committee deck."

Tools available: list_templates · build_model · qc_workbook · list_sources · lineage_walk · ingest_dataroom · export_pptx · export_docx.

See GTM_STRATEGY.md and SCORECARD_v2.md for the full GTM thesis and competitor comparison (vs Rogo / Hebbia / Macabacus / o11).

The architectural principle

LLMs produce specs + sources + narrative. Deterministic Python produces the workbook.

The LLM never writes a number into a cell. It writes a typed YAML spec with source IDs. A deterministic builder emits the Excel via openpyxl. A QC gate validates before export. Excel is a render of a linkage graph; the graph is persisted to SQLite and is the canonical artifact.

Quality standards (bulge-tier, non-negotiable)

Formatting

  • Blue = hardcoded input. Black = formula. Green = cross-sheet link. Red = warning.
  • No mixed formulas (no magic numbers embedded). Named ranges for every driver.
  • Costs NEGATIVE (sign convention enforced and checked).
  • EN primary labels, IT secondary.
  • Historical vs Projected column separator, obvious.
  • Check row at top of every sheet (BS balance, CFS tie, covenant headroom — TRUE or 0).

Sourcing

  • Every hardcoded cell has a comment with source ID (S-001, S-002, ...).
  • Sources sheet lists each source: doc, page, publisher, date, URL, verified-flag.
  • Assumptions (not sourced) tagged A-001 with rationale + confidence H/M/L.

Scenarios

  • WORST / BASE / BEST toggle on Assumptions. Drives every sheet via CHOOSE.
  • Every sheet respects the toggle — no orphan assumptions.

Audit

  • QC sheet with 12 automated checks, all must pass.
  • Revision log on Cover.
  • Named ranges mandatory.
  • Print areas set. Print-ready on every sheet.

Quick start

cd "C:/Users/lukep/Desktop/Projects AI/ModelForge"
pip install -e .
modelforge build examples/unitranche_cdmo.yaml
modelforge qc output/unitranche_cdmo.xlsx

Data-room ingestion (v0.3.1)

Turn a directory of PDFs, XLSXs and CSVs into a validated ModelForge YAML spec using Claude Opus. Every extracted number traces back to a doc page via the auto-built Sources registry.

pip install -e .[ingest]                # installs anthropic, pdfplumber, pypdf
export ANTHROPIC_API_KEY=sk-ant-...      # required

modelforge ingest path/to/dataroom/ \
    --template project_finance \
    -o output/my_deal.yaml --verbose

# Review output/my_deal.yaml + output/my_deal.ingestion.md
# (INGESTION_REPORT.md lists every extracted field, S-id, confidence)

modelforge build output/my_deal.yaml     # produces the workbook
modelforge qc output/my_deal.xlsx        # 8/8 quality gate

Supported template: project_finance (MVP). Templates 1, 3, 5-8 queued for v0.3.2. See PRD_v03_dataroom_ingestion.md for the full spec.

Package layout

modelforge/
├── graph/            # First-class linkage graph (nodes, edges, SQLite persistence)
├── spec/             # Pydantic schemas per template
│   ├── base.py       # Source, Assumption, Scenario, Target (shared types)
│   └── unitranche.py # Template 1: Unitranche LBO
├── builder/          # Deterministic openpyxl writer
│   ├── styles.py     # Bulge-tier formatting library
│   ├── formulas.py   # Formula string builders
│   ├── i18n.py       # EN/IT label dictionary
│   ├── workbook.py   # Top-level builder
│   └── sheets/       # One module per sheet (cover, sources, assumptions, ...)
├── qc/               # Quality gate (12 checks + PDF report)
├── data/             # Market data loaders (Damodaran, ECB, Borsa minibond)
└── cli.py            # modelforge build|qc|sources|inspect

Templates (all shipped)

  1. Unitranche LBO — Italian mid-market direct lending (Cash sweep + IFRS 9 EIR)
  2. Minibond — Banca Finint territory (Gross YTM + Net YTM + Italian WHT)
  3. Credit Memo — Extends Unitranche with recovery waterfall + PD×LGD×EAD
  4. Project Finance — Construction + operating phases, DSCR-driven
  5. Real Estate — NOI build, exit cap, LP/GP promote waterfall
  6. NPL Portfolio — Collection curves, servicing fees, senior/mezz capital structure
  7. Structured Credit — Tranche waterfall with attachment/detachment points
  8. 3-Statement — P&L + BS + CFS with BS balance integrity check

Run modelforge list-templates to see them all. Each ships with an anonymized Italian example YAML in examples/.

The pitch

Bulge-tier Excel models, every cell live-formulated, every number traceable back to the data room page it came from.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modelforge_finance-0.9.5.tar.gz (323.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modelforge_finance-0.9.5-py3-none-any.whl (358.5 kB view details)

Uploaded Python 3

File details

Details for the file modelforge_finance-0.9.5.tar.gz.

File metadata

  • Download URL: modelforge_finance-0.9.5.tar.gz
  • Upload date:
  • Size: 323.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for modelforge_finance-0.9.5.tar.gz
Algorithm Hash digest
SHA256 dda4cfd939d24dd3ff1e14ab9b6e723631879dbc97a3c730008547833f837c3f
MD5 06a5db16cb6ac93920f7ee7b67db2812
BLAKE2b-256 39a6c336680ff3024e817f9f5fa05dc4dacf252cef6eac28bc8e97432a7cc117

See more details on using hashes here.

File details

Details for the file modelforge_finance-0.9.5-py3-none-any.whl.

File metadata

File hashes

Hashes for modelforge_finance-0.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7f3e1bf2ea1e6573c6e515b70e619e5f0f6f80477fabf08ec72ac80950dfa896
MD5 4ec1eea0234fb1aec3ec4e806ca2ec99
BLAKE2b-256 43550c1951c34d35496f8f127ab4a6d8b81651ce99531aed30149e341b9e6557

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page