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 Costco equity research

Built in a 4-hour, ~$70 autonomous multi-agent run across 50 SEC and macro sources with zero human intervention:

LBO model preview

  • Excel model: lbo_model.xlsx (multi-sheet LBO workbook with transaction structuring, debt waterfall, and returns analysis)

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.0

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.0
File Size Uploaded Provenance Actions
f8_engine-0.8.0.tar.gz 232.8 kB With provenance Details for f8_engine-0.8.0.tar.gz

Built distributions (wheels)

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

Total release size: 8.7 MB

Release files / f8_engine-0.8.0.tar.gz

Download URL f8_engine-0.8.0.tar.gz
Size 232.8 kB
Tags Source
SHA-256 checksum
How to use checksums
11680a2c9a587a52a897c7deab6137964f5fd94d7d2f915934d510c1af35a05c
BLAKE2b-256 checksum
How to use checksums
d4f9e2b98f68c5989e4455b9bea3162cb81a053083dde789be0fcfcf8fd3079d
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 25, 2026.

Transparency log

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

Download URL f8_engine-0.8.0-cp312-abi3-win_arm64.whl
Size 1.3 MB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
5b096b3f3568a417bc41bca0081c7c1ce86f37e4058b74f8748af4a7861cdcdd
BLAKE2b-256 checksum
How to use checksums
57ddf4749a82400d09bc4695cb46d720aefee2f678ac94bb7aba8fa9138aba06
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 25, 2026.

Transparency log

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

Download URL f8_engine-0.8.0-cp312-abi3-win_amd64.whl
Size 1.4 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
326582ef3cbf59c97ac381c9f2c2ad3a23ae77592135153a0a2571cfc816e0e6
BLAKE2b-256 checksum
How to use checksums
19984cb0c289fd610f18c0c8635b8c3772242560036ef2cb2bbe80ec0dcf65c1
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 25, 2026.

Transparency log

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

Download URL f8_engine-0.8.0-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.5 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
cff566ddfe342f394677b030df4767757831f53b08dd6baf5f3246949ca9a2b1
BLAKE2b-256 checksum
How to use checksums
e60c855953465334467ca7012e1f884132eca1da1bf6c291c2d33a361afa327f
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 25, 2026.

Transparency log

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

Download URL f8_engine-0.8.0-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.4 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
0c3668399d9c2de278707c32ae515e89a6d9cd1f616dc0226f51350830bc7190
BLAKE2b-256 checksum
How to use checksums
58d8e10e960ebb66bd7c538c2262567481c03c0fe9844dca966a110bd27f99c5
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 25, 2026.

Transparency log

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

Download URL f8_engine-0.8.0-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
071e6828680a3d2d9aa5b0d6a671f5328842c8cbf1d2c74b56da708483cf42e8
BLAKE2b-256 checksum
How to use checksums
2f473358d9537418a0fa6e117e54f76ebf0558e9d864d38f5c4ebf982e2bdb75
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 25, 2026.

Transparency log

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

Download URL f8_engine-0.8.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
fc1191cd1518778a8b29e1897a951cfd0b4393db66640b26002f4f2fa553b6f7
BLAKE2b-256 checksum
How to use checksums
39afa451e707fa4ab185aacebbf5ee25836df9e92416f2983a35e84ff373765a
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 25, 2026.

Transparency log

Security for f8-engine 0.8.0

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.0.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 25, 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