Skip to main content

f8

Build, verify, and automate financial models in code with AI, compiled into live Excel.

I'm a CFA charterholder working in private M&A and project finance. I built f8 because I believe code is the best way to leverage AI for financial modeling. As a bonus, moving your models into code gives you 40 years of software engineering infrastructure (version control, automated tests, reusable modules, and live data pipelines) out of the box.

The problem

Excel is still the non-negotiable deliverable across finance, but today's ways of bringing AI or code into financial modeling each hit a wall:

  • AI inside Excel (add-ins, Office.js, GUI agents): Still inherits everything painful about Excel — fragile grid edits, silent copy-paste errors, no version control or diffs, no automated tests, and awkward links to external data. Making AI click cells faster doesn't fix the foundation.
  • Low-level workbook libraries (openpyxl, xlsxwriter, exceljs): You're in code, but you (and your AI agent) are still babysitting raw cell addresses (C42:G42) where inserting one row breaks downstream formulas, more importantly, none of these libraries evaluate formulas, so your agent is flying blind.
  • DataFrames (pandas, polars): Great for data pipelines, awkward for row-by-row 2D schedules (3-statement links, corkscrews, debt waterfalls), and they can't give your stakeholders a live, formula-driven .xlsx file.

How f8 works

f8 makes code your single source of truth, and turns .xlsx into a compiled output:

  • Semantic 2D modeling: Write formulas using readable names (PPE["end_balance", col.prev]). f8 handles the grid layout and compiles your logic into native Excel A1 formulas.
  • Compiler-enforced rigor: A 6-pass Rust compiler checks types, shapes, grid completeness (no forgotten cells or formula overlaps), and blocks circular references via Tarjan cycle detection.
  • Closed-loop verification: Evaluates every formula in memory in milliseconds, so your AI agent knows what went wrong immediately.
  • Verified Excel parity: Matches Excel across all 37 supported functions, including error propagation and the 1900 leap-day quirk. Our uncached parity workbook lets Excel recalculate and grade every test case itself when you open it.

Who is f8 for

  • Anyone who wants AI to build real financial models: Whether you're doing M&A and LBOs, fundamental equity research, project finance, FP&A, credit, or real estate — give your AI agent a real language and compiler so you get models you can actually diff, test, and hand to a client or IC as a live .xlsx.
  • Quants and code-first analysts: Keep your financial statements and 2D schedules right next to live data feeds (SEC filings, market APIs, databases) and quant models in Python or TypeScript — with compiled.save("model.xlsx") ready whenever someone asks for the spreadsheet.
  • Complex modeling beyond finance: Pricing models, operational forecasts, scenario planning — anything where you want software-grade reliability without giving up Excel as the deliverable.

Getting started

Install f8-engine in Python (imported as f8) or TypeScript / JavaScript:

# Python
pip install f8-engine   # or: uv add f8-engine

# TypeScript / JavaScript
npm install f8-engine   # or: pnpm add f8-engine

Using an AI coding agent? f8 ships with a bundled modeling skill and CLI reference you can drop right into your workspace:

f8 agent init    # scaffolds .agents/skills/f8-modeling/
f8 theme init    # generates a customizable theme.json in your workspace root
f8 guide --all   # streams the full DSL, function, and auditing guide to stdout

Quick look

from f8 import Model

years = ["2025A", "2026E", "2027E"]
capex = {"2025A": 25.0, "2026E": 30.0, "2027E": 35.0}
depr = {"2025A": -15.0, "2026E": -18.0, "2027E": -22.0}

model = Model("Operating Forecast")
sheet = model.add_sheet("Summary")

ppe = sheet.add_table("PPE", "PP&E Corkscrew Schedule", "($ in millions)")
ppe.add_column("item", role="descriptor", header="Line Item")
for year in years:
    ppe.add_column(year, header=year, format="currency", decimals=1)

ppe.add_row(
    "beg_balance",
    cells={"item": "Beginning Balance", "2025A": 100.0},
    expr='PPE["end_balance", col.prev]',
)
ppe.add_row("capex", cells={"item": "Capital Expenditures", **capex})
ppe.add_row("depreciation", cells={"item": "Depreciation", **depr})
ppe.add_row(
    "end_balance",
    cells={"item": "Ending Balance"},
    expr='SUM(PPE["beg_balance".."depreciation", @col])',
    style="total",
)

compiled = model.compile()

# Audit evaluated values in memory (or pass view="formulas" to inspect lowered Excel formulas)
print(compiled.table("PPE").to_markdown())

# Emit a live .xlsx workbook with native Excel formulas and styling (you don't have to)
compiled.save("forecast.xlsx")
TypeScript equivalent
import { Model } from "f8-engine"

const years = ["2025A", "2026E", "2027E"] as const
const capex = { "2025A": 25.0, "2026E": 30.0, "2027E": 35.0 }
const depr = { "2025A": -15.0, "2026E": -18.0, "2027E": -22.0 }

const model = new Model({ name: "Operating Forecast" })
const sheet = model.addSheet("Summary")

const ppe = sheet.addTable("PPE", "PP&E Corkscrew Schedule", {
  subtitle: "($ in millions)",
})
ppe.addColumn("item", { role: "descriptor", header: "Line Item" })
for (const year of years) {
  ppe.addColumn(year, { header: year, format: "currency", decimals: 1 })
}

ppe.addRow("beg_balance", {
  cells: { item: "Beginning Balance", "2025A": 100.0 },
  expr: 'PPE["end_balance", col.prev]',
})
ppe.addRow("capex", { cells: { item: "Capital Expenditures", ...capex } })
ppe.addRow("depreciation", { cells: { item: "Depreciation", ...depr } })
ppe.addRow("end_balance", {
  cells: { item: "Ending Balance" },
  expr: 'SUM(PPE["beg_balance".."depreciation", @col])',
  style: "total",
})

const compiled = model.compile()

// Audit evaluated values in memory (or pass { view: "formulas" } to inspect lowered Excel formulas)
console.log(compiled.table("PPE").toMarkdown())

// Emit a live .xlsx workbook with native Excel formulas and styling (you don't have to)
compiled.save("forecast.xlsx")
Output
| Line Item            |      2025A |      2026E |      2027E |
| :------------------- | ---------: | ---------: | ---------: |
| Beginning Balance    |     $100.0 |     $110.0 |     $122.0 |
| Capital Expenditures |      $25.0 |      $30.0 |      $35.0 |
| Depreciation         |    ($15.0) |    ($18.0) |    ($22.0) |
| **Ending Balance**   | **$110.0** | **$122.0** | **$135.0** |

Sample deliverables

Autonomous equity research models (mhcfa/faac)

Full TypeScript financial models, audited SEC/macro data bundles, compiled .xlsx workbooks, and valuation decks generated by autonomous multi-agent workflows live in mhcfa/faac:

Engagement Model Excel Model Valuation Deck
Costco (COST) public-equity/costco costco-valuation.xlsx costco-equity-valuation.pdf
Boeing (BA) public-equity/boeing boeing-valuation-model.xlsx boeing-initiation-deck.pdf
Meta (META) public-equity/meta meta_model.xlsx meta_presentation.pdf
Salesforce (CRM) public-equity/salesforce salesforce_financial_model.xlsx salesforce-initiation.pdf

LBO model preview

LBO Executive Dashboard

LBO Transaction Balance Sheet Bridge

Disclaimer: Sample deliverables are AI-generated technical demonstrations and do not constitute financial analysis or investment advice.

Trade-offs

Because f8 treats code as the source of truth and .xlsx as just an output, there are a few trade-offs to keep in mind:

  1. Structured layout only: You can't scatter ad-hoc cells wherever you want in the emitted workbook — everything is verified by strict schemas. (You wouldn't want a messy spreadsheet anyway, right?)
  2. Basic Python or TypeScript: You'll be working in code, though AI largely takes care of that for you.
  3. No circular references: Per FAST Standard Section 2.01. Revolver circularity has a clean closed-form formula anyway (and don't worry, AI knows it).
  4. No native charts or Pivot Tables: Charts are on the roadmap, and since you're already in Python or TypeScript, your language ecosystem handles aggregation far better than Pivot Tables.
  5. One-way flow (code -> Excel): Manual edits to the emitted .xlsx won't sync back and will be overwritten on the next compile. By design, .xlsx is a build artifact, not a source file.

Architecture

Under the hood, f8 pairs Python (python/f8/) and TypeScript/WebAssembly (ts/, crates/f8-wasm/) SDKs with a 6-pass Rust compiler (crates/f8-core/):

Spec -> IR Expansion -> DAG & Cycle Check -> Topological Evaluation -> Spatial Layout -> Formula Lowering -> .xlsx Emission

See docs/architecture.md for the full pipeline and invariants.

License

  • Licensed under the Apache License, Version 2.0 (Apache-2.0); see LICENSE.
  • Copyright (C) 2026 Michael (Chencheng) Hu, CFA (@mhcfa).

Metadata

Release files for f8-engine 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for f8-engine 0.8.1
File Size Uploaded Provenance Actions
f8_engine-0.8.1.tar.gz 245.0 kB With provenance Details for f8_engine-0.8.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for f8-engine 0.8.1
File Actions
f8_engine-0.8.1-cp312-abi3-win_arm64.whl CPython 3.12 abi3 Windows ARM64 Details for f8_engine-0.8.1-cp312-abi3-win_arm64.whl
f8_engine-0.8.1-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for f8_engine-0.8.1-cp312-abi3-win_amd64.whl
f8_engine-0.8.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for f8_engine-0.8.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
f8_engine-0.8.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for f8_engine-0.8.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
f8_engine-0.8.1-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for f8_engine-0.8.1-cp312-abi3-macosx_11_0_arm64.whl
f8_engine-0.8.1-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details for f8_engine-0.8.1-cp312-abi3-macosx_10_12_x86_64.whl

Total release size: 9.0 MB

Release files / f8_engine-0.8.1.tar.gz

Download URL f8_engine-0.8.1.tar.gz
Size 245.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ef05ad925b16548efd4963830744eb5fb483ae87061e6de8986146750b1b462f
BLAKE2b-256 checksum
How to use checksums
59b9af0a001279797361242c4c626a3366f53a14a71bb8fa1e64e7019b15f182
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / f8_engine-0.8.1-cp312-abi3-win_arm64.whl

Download URL f8_engine-0.8.1-cp312-abi3-win_arm64.whl
Size 1.4 MB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
756ffd69584ad38175a46c0e8eb49dbf9f03130b973d4bed0d2671d2b2fe302d
BLAKE2b-256 checksum
How to use checksums
095fabbe75cd0768f7bfa133c23e3be62f0cd8ce4cab3d0365f811e06d4763f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / f8_engine-0.8.1-cp312-abi3-win_amd64.whl

Download URL f8_engine-0.8.1-cp312-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4f5013a60b7357181457bc544460873ea5a35376fa2e8814452acf0eeb0f48ef
BLAKE2b-256 checksum
How to use checksums
7d3cb88fc64b3b5acdbb1a988c842e7df5d11d27dea74293c97a0ba4c823bff6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / f8_engine-0.8.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL f8_engine-0.8.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.6 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
f00da9e1d8121fe1ab9c1fcf851eff1fba98b5c4856606b371048bd39bab8b21
BLAKE2b-256 checksum
How to use checksums
8158a8ca5db43d5254220af6b92e08e2fb90d08c3e96245c544ba56e65e827d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / f8_engine-0.8.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL f8_engine-0.8.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.5 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
276a4441cee897a83768bdc9796ab37255a6ada7847c04fcb2fc672d9a8da7a4
BLAKE2b-256 checksum
How to use checksums
2cf1332cc50701cefd60544a6f1c102b04e04a0891a73c722e43d6d659dd2fad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / f8_engine-0.8.1-cp312-abi3-macosx_11_0_arm64.whl

Download URL f8_engine-0.8.1-cp312-abi3-macosx_11_0_arm64.whl
Size 1.4 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fcf4253748feea729ef4c537aa94fcabafce71c58043ca075392661c33e6c077
BLAKE2b-256 checksum
How to use checksums
f8903f6c4d443f62133193f46190816c3f4bb76b4575f47efc6f86d29ba64e03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / f8_engine-0.8.1-cp312-abi3-macosx_10_12_x86_64.whl

Download URL f8_engine-0.8.1-cp312-abi3-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
37afc6dda527e1563b8abb8a42cc31c06d65eb083d3e6131d506049f96212f16
BLAKE2b-256 checksum
How to use checksums
b992e9b1fd1d44917a020aaef6ad26f18defc3f9b6152ac49b225a04fe173734
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for f8-engine 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for f8_engine-0.8.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page