OpenTax Engine 是一个开源美国联邦税务计算器,提供精确、可验证的计算结果,附带引用具体法条的证明树,专为 AI 代理集成和离线验证设计。

Stars

119

7 天增长

暂无数据

Fork 数

19

开放 Issue

0

开源协议

AGPL-3.0

最近更新

2026-07-27

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它结合了精确的大整数计算、2025 和 2026 税年的完整规则库、用于查找边际税率和断崖的求解层,以及与 PolicyEngine 的独立验证,从不猜测——仅从编码规则推导。

适合谁使用

  • 需要集成基于证明的税务计算的税务软件开发人员
  • 构建需要可靠税务数据的 LLM 代理的 AI 工程师
  • 需要可审计、有引用支持的税务计算的税务专业人士和政策制定者
  • 希望通过数据驱动贡献扩展税务规则覆盖的开源贡献者

典型使用场景

  • 代理辅助报税:LLM 通过 MCP 工具调用引擎获取准确答案
  • AI 生成税务数据的护栏:`opentax check` 拒绝错误声明并提供正确值
  • 政策模拟与教育:探索边际税率、断崖以及比较不同申报身份
  • 离线税务验证:在浏览器中运行独立 HTML 文件,无需网络即可验证证明

项目优势

  • 使用大整数运算,精确到分,无浮点误差
  • 可验证的证明树,引用具体法条(如 26 U.S.C. § 63)
  • 覆盖所有五种申报身份、数百项抵免/扣除,以及 2025 和 2026 税法
  • 与 PolicyEngine 独立验证,572 个场景中 533 个完全一致

使用前须知

  • 部分近似处理:如劳动收入≈工资、MAGI≈AGI 在某些逐步取消中
  • EITC 合格子女近似为 CTC 子女数;部分小众交互直接拒绝
  • 州税仅部分支持(通过 MCP 支持 IL/VA/CA/NY/PA),合并申报、REIT/RIC 等明确拒绝

README 快速开始

opentax-engine

A US tax calculator that shows its work — and can prove it.

Three ideas, that's the whole project:

  1. Ask it a tax question with plain facts (--wages 50000).
  2. It answers with a proof: every rule it applied, with the law it came from (26 U.S.C. § 63(c) …), every assumption it made.
  3. Anyone can verify that proof offline. If it can't derive an answer from its encoded rules, it refuses — it never guesses.

Open source (AGPL-3.0, with commercial licenses available), exact to the cent (no floating point), built to be extended.

Try it

pnpm install && pnpm build
pnpm opentax eval --status mfj --wages 120000 --kids 2
us.federal.income_tax_after_credits  $5,640.00
├─ us.federal.income_tax_before_credits  $10,040.00   [26 U.S.C. § 1(j); Rev. Proc. 2025-32]
│  └─ us.federal.taxable_income  $87,800.00           [26 U.S.C. § 63(b)]
│     ├─ us.federal.agi  $120,000.00
│     │     ├─ fact wages = $120,000.00
│     │     └─ assumed taxableInterest = $0.00 (default)
│     └─ us.federal.standard_deduction  $32,200.00    [Rev. Proc. 2025-32 § 4.14]
└─ us.federal.ctc  $4,400.00                          [§ 24, as amended by OBBBA § 70104]

Assumptions (6): taxableInterest = $0.00, isAge65OrOlder = false, …
corpus sha256:6ff44719…

It answers under the law in force on the date you ask about--as-of defaults to today; pass --as-of 2025-12-31 and the same facts derive under TY2025 rules instead (different standard deduction, different brackets, cited to the other Rev. Proc.).

Money is written in dollars (50000, "$50,000", "1234.56"). Not sure what inputs exist? pnpm opentax facts lists them all. More facts than fit in flags? Use a JSON file: --facts examples/mfj_120k_2kids.json.

Or skip the terminal entirely — the engine is pure TypeScript with zero platform dependencies, so the whole thing runs in a browser:

pnpm -F @invaro/opentax-playground build && open packages/playground/dist/index.html

One 130 KiB self-contained HTML file: engine + full rule corpus + verifier, no server, no network, works from file://. Compute, read the proof tree, download the proof — then paste it into the Verify tab and watch your own browser re-derive every step (alter one byte and it says exactly what broke). Same corpus Merkle root the CLI prints.

Save a proof, verify a proof:

项目描述

The deterministic tax engine for AI agents. Highest score ever recorded on TaxCalcBench (96% exact returns)

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

react
精选
react GitHub avatar

react

React is a JavaScript library for building user interfaces with declarative, component-based, and cross-platform design.

Web 开发前端框架
246,741
tandpfun
精选
tandpfun GitHub avatar

wardrobe

A GPT‑image powered app that extracts individual garment cutouts from photos, organizes them into a digital wardrobe, and generates modeled outfit previews.

JavaScript
1,570
mshumer
精选
mshumer GitHub avatar

Claude-of-Duty

A browser-based first-person shooter built entirely with procedural generation and orchestrated AI agents, featuring 55k lines of Three.js/WebGL2 code and no art assets.

AI 与机器学习AI 智能体
1,234