A Python project for generating structured financial charts of accounts and fund flows using multiple LLMs. Compare how different AI models approach financial accounting problems with a two-step workflow: first generating a chart of accounts, then creating fund flows based on those accounts.
Disclaimer: This code is for experimentation and is mostly AI-generated. It should not be used in production.
This project uses uv for dependency management. Install dependencies with:
uv sync# Optionally set API keys (not needed for open source models)
export AWS_BEARER_TOKEN_BEDROCK=your_api_key
export OPENAI_API_KEY=your_api_key
export GEMINI_API_KEY=your_api_key
export ANTHROPIC_API_KEY=your_api_key
# Run test cases
uv run python test_clients.py gpt-oss-20b test_cases/simple_digital_wallet.yaml
uv run python test_clients.py gpt-oss-20b test_cases/digital_wallet.yaml
uv run python test_clients.py gpt-oss-20b test_cases/payroll.yaml
uv run python test_clients.py gpt-oss-20b test_cases/simple_payroll.yaml
# View help
uv run python test_clients.py --helpThe script performs a two-step process:
- Generates a
ChartOfAccountsfrom the first prompt - Generates a
FundFlowusing the chart of accounts from step 1
Test cases are defined in YAML format in the test_cases/ directory:
Each YAML file must contain two prompts:
chart_of_accounts_prompt: |
Generate a chart of accounts for a digital wallet platform that holds user funds in USD.
Include accounts that represent the user funds held in an FBO account and accounts that represent user liabilities.
Create the minimum number of accounts to satisfy the requirements.
fund_flow_prompt: |
Given the following chart of accounts, generate a FundFlow that represents the business process of a user depositing funds into their digital wallet.
The FundFlow should show the ledger transactions needed to record a $100 USD deposit.- Create a new
.yamlfile intest_cases/ - Add both
chart_of_accounts_promptandfund_flow_promptkeys - Run the test:
uv run python test_clients.py model_name test_cases/your_new_test_case.yaml
The system provides detailed output for both generation steps:
📋 Account Details:
Account 1: FBO Bank Account
Description: Bank account where user funds are held on behalf of users
Currency: USD | Normal Balance: debit
Account 2: User 1 Liability
Description: Liability to User 1 for funds held in the platform
Currency: USD | Normal Balance: credit
💸 Transaction Details:
Transaction 1: User 1 deposits $100 into digital wallet
Entry 1: Account=FBO Bank Account, Direction=debit, Amount=100 USD
Entry 2: Account=User 1 Liability, Direction=credit, Amount=100 USD
Transaction 2: User 1 sends $5 to User 2
Entry 1: Account=User 1 Liability, Direction=debit, Amount=5 USD
Entry 2: Account=User 2 Liability, Direction=credit, Amount=5 USD