Skip to main content

f8

Financial modeling engine with compiler verification and live Excel formulas.

Who is f8 for

  1. People who want AI to reliably build complex Excel models (financial and beyond): Give AI agents a semantic 2D DSL and compile-time verification to produce clean and error-free .xlsx workbooks with live formulas.
  2. People doing financial analysis in pure code (no Excel required): Run row-by-row financial statements, corkscrew schedules, and cross-table dependency graphs in Python (where columnar DataFrames fall short), with compiled.save("model.xlsx") ready whenever a stakeholder asks for the spreadsheet.

Why f8

I am a CFA charterholder working in private M&A and project finance, where complex Excel models remain the non-negotiable deliverable despite fragile manual work, silent copy-paste errors, and zero version control.

AI agents struggle to manipulate raw spreadsheets (openpyxl, Office.js, or GUI) for two reasons:

  • Brittle coordinates: Agents must reason in spatial cell addresses (C42:G42) instead of domain semantics; inserting one row shifts every downstream reference.
  • No verification loop: Spreadsheet libraries do not evaluate formulas, leaving agents blind until the .xlsx file is opened and inspected.

f8 turns the .xlsx workbook into a compiled artifact rather than a hand-edited canvas:

  • Semantic 2D modeling: Author models with readable table, row, and column identifiers; f8 handles spatial layout and lowers logic into native Excel formulas.
  • Compiler-enforced rigor: A 6-pass Rust compiler verifies grid completeness (zero unassigned cells or formula overlaps) and enforces a strict DAG via Tarjan cycle detection.
  • Closed-loop verification: Evaluates formulas in memory with 100% Excel parity (including the 1900 leap day bug) so AI agents and pytest suites can audit tables, trace dependencies, and verify accounting checks in milliseconds.

Getting started

Install from PyPI (package name is f8-engine, imported as f8):

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

If you are working with an AI coding agent, f8 ships with a bundled modeling skill and CLI reference you can drop straight into your workspace:

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

Quick look

from f8 import Model

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

pnl = sheet.add_table("PnL", "Three-Year Projection", "($ in millions)")
pnl.add_column("item", role="descriptor", header="Line Item")
for year in ["2025A", "2026E", "2027E"]:
    pnl.add_column(year, header=year, format="currency", decimals=1)

pnl.add_row(
    "revenue",
    cells={"item": "Revenue", "2025A": 100.0},
    expr='PnL["revenue", col.prev] * 1.25',
)
pnl.add_row(
    "cogs",
    cells={"item": "Cost of Revenue"},
    expr='PnL["revenue", @col] * 0.30',
)
pnl.add_row(
    "gross_profit",
    cells={"item": "Gross Profit"},
    expr='PnL["revenue", @col] - PnL["cogs", @col]',
    style="total",
)

compiled = model.compile()

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

# 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 |
| :--------------- | --------: | --------: | ---------: |
| Revenue          |    $100.0 |    $125.0 |     $156.2 |
| Cost of Revenue  |     $30.0 |     $37.5 |      $46.9 |
| **Gross Profit** | **$70.0** | **$87.5** | **$109.4** |

Sample deliverables

Inspect compiled deliverables generated from a real-world model:

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

Trade-offs

f8 treats code as the single source of truth, and .xlsx is just an output. So there are some trade-offs to consider:

What you gain What you lose
Clean structure and strict schema Hidden mistakes no one notices
Git and line-by-line diffs Model_v14_Final_(2).xlsx and guessing what changed since v13
Instant DAG and completeness verification in Rust The opportunity to mess up your model right before a client meeting
Superior AI modeling Being an Excel Ninja
Readable semantic code and logic The joy of hunting down a hidden #REF! at 2 AM

Jokes aside, writing models in code gives you 40 years of software infrastructure out of the box, line-by-line git diff reviews, automated pytest checks, reusable modules, and parametric loops. The only real downsides I can think of are:

  1. You can't do whatever you want when it comes to layout in the emitted workbook; everything has to be structured. But you wouldn't want your spreadsheet to be a mess anyway, right?
  2. You have to learn some Python. But that is largely solved by AI now.
  3. Constantly re-compiling just to peek at the Excel workbook can be a bit annoying, so we provide in-memory inspection methods in Python. Once you get used to print(), you don't need to open the .xlsx all the time (or just ask AI to do it).
  4. There are no circular references or iterative solvers (as per FAST Standard Section 2.01). There is a closed-form formula that solves the revolver circularity problem without circular references anyway (and don't worry, AI knows it).
  5. There is no native Excel chart emission yet (on roadmap), and no Pivot Tables. But since you are already in Python, pandas or polars handles data aggregation much better.

Architecture

Under the hood, f8 is a Python SDK (python/f8/) backed by a 6-pass Rust compiler (crates/f8-core/):

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

  • Architecture overview: docs/architecture.md
  • Python modeling skill: python/f8/skills/f8-modeling/SKILL.md
  • Syntax, grid, and formatting reference: python/f8/skills/f8-modeling/references/syntax-and-grid.md
  • Function reference: python/f8/skills/f8-modeling/references/functions.md
  • Auditing and repair reference: python/f8/skills/f8-modeling/references/auditing-and-repair.md

License

  • Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0-only); see LICENSE.
  • Copyright (C) 2026 Michael (Chencheng) Hu, CFA (@mhcfa).
  • Output ownership: .xlsx workbooks and financial models generated by f8 are standalone user outputs and are not subject to AGPL-3.0-only copyleft terms.

Metadata

Release files for f8-engine 0.2.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.2.0
File Size Uploaded Provenance Actions
f8_engine-0.2.0.tar.gz 177.6 kB With provenance Details for f8_engine-0.2.0.tar.gz

Built distributions (wheels)

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

Total release size: 7.7 MB

Release files / f8_engine-0.2.0.tar.gz

Download URL f8_engine-0.2.0.tar.gz
Size 177.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a881a6fc1ea227fc5301080bee2b41717f780da444db759a94ceb5ea2ec267b8
BLAKE2b-256 checksum
How to use checksums
5bc7a41d037702d135b6783932b3438be5e7fcc9eabe74fb760bb1a55e99bbcf
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 Oct 24, 2026.

Transparency log

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

Download URL f8_engine-0.2.0-cp312-abi3-win_arm64.whl
Size 1.2 MB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
4e6fa986bda148dd81f8dc6d8e504d140351a6e4da2c5258086fded30c56ac1d
BLAKE2b-256 checksum
How to use checksums
4062b54e871db7dd7713e84e4969d7c3be7ffb1cb27e357235c1303a02f2ff91
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 Oct 24, 2026.

Transparency log

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

Download URL f8_engine-0.2.0-cp312-abi3-win_amd64.whl
Size 1.2 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8e34f8c5984bf085c7e5e0d5037bfc6266c6e9f8602058eb968766fd8628e8d8
BLAKE2b-256 checksum
How to use checksums
dd41a5c89996daf00c5f08fdcd3addc42dd81cd23f0756e91802e26be916e86b
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 Oct 24, 2026.

Transparency log

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

Download URL f8_engine-0.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
96a54527e288a4545d5cfa011e39f94412ad7bf64353b81083db7d8bd30fff40
BLAKE2b-256 checksum
How to use checksums
6d33683dd666a782b172280e9393fb0212a50476021a0de0589581a5efb2f432
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 Oct 24, 2026.

Transparency log

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

Download URL f8_engine-0.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.3 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
fb38c74256c990dd7dc0ce4153d57cdba31999ee3270821ae9518784efe1270b
BLAKE2b-256 checksum
How to use checksums
087d4afce20ea2398a8882ce2906c0b4dc1abdfe5a3885697527933fc803c5da
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 Oct 24, 2026.

Transparency log

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

Download URL f8_engine-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4681bf6120b2cc6f190c0b697de17ba22ff08f5373e5a13aff9df358f31eddbc
BLAKE2b-256 checksum
How to use checksums
7e5d6b5d06911234dc6e5ef95f2e1bdf24edf5d5e5f9f6448e3d1c0429da7e7f
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 Oct 24, 2026.

Transparency log

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

Download URL f8_engine-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl
Size 1.3 MB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
55f3f3eeac1e89b455611e65ba646cd8eecf36db29c344463a3db3f26d1a107b
BLAKE2b-256 checksum
How to use checksums
18ff96ef8eb4b8610d85f12d25c840d596ffae654f2e51b8a2bfd0424255d8cd
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 Oct 24, 2026.

Transparency log

Security for f8-engine 0.2.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.2.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 Oct 24, 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