> ## Documentation Index
> Fetch the complete documentation index at: https://finance.qwedai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install QWED Finance 3.0.1 and verify an LLM's financial calculation in Python or Node.js.

## Installation

<CodeGroup>
  ```bash Python (pip) theme={null}
  pip install qwed-finance==3.0.1
  ```

  ```bash Node.js (npm) theme={null}
  npm install @qwed-ai/finance@3.0.1
  pip install qwed-finance==3.0.1
  ```
</CodeGroup>

<Note>
  The npm package is a TypeScript wrapper that runs the Python package in a child process. Install `qwed-finance` with Python 3.11 or later on the same machine, using the same interpreter that Node.js will start.

  By default the wrapper runs `python`. If your Python 3.11+ interpreter has another name, such as `python3` or a virtual-environment path, install the package with it and pass it to the constructor:

  ```bash theme={null}
  python3 -m pip install qwed-finance==3.0.1
  ```

  ```javascript theme={null}
  const verifier = new FinanceVerifier('python3');
  ```
</Note>

***

## First verification

An LLM claims the NPV of a project. QWED Finance recomputes it and tells you whether the claim is correct.

<CodeGroup>
  ```python Python theme={null}
  from qwed_finance import FinanceVerifier

  verifier = FinanceVerifier()

  # Cash flows: invest 1,000, then receive 300, 400, 500, 600. Discount rate 10%.
  result = verifier.verify_npv(
      cashflows=[-1000, 300, 400, 500, 600],
      rate=0.10,
      llm_output="$388.77",  # the LLM's claim
  )

  if result.verified:
      print(f"Verified: {result.computed_value}")
  else:
      print(f"Rejected: LLM said {result.llm_value}, QWED computed {result.computed_value}")
  # Verified: $388.77
  ```

  ```javascript verify-npv.mjs theme={null}
  // Save as an .mjs file, or set "type": "module" in package.json,
  // so Node.js accepts the import syntax and top-level await.
  import { FinanceVerifier } from '@qwed-ai/finance';

  const verifier = new FinanceVerifier();

  try {
    const result = await verifier.verifyNPV([-1000, 300, 400, 500, 600], 0.1, '$388.77');

    if (result.verified) {
      console.log('Verified:', result.computed_value);
    } else {
      console.log('Rejected: QWED computed', result.computed_value);
    }
    // Verified: $388.77
  } catch (err) {
    // Malformed inputs and bridge failures throw: treat them as "not verified".
    console.error('Verification failed closed:', err instanceof Error ? err.message : String(err));
  }
  ```
</CodeGroup>

Change the claim to `"$450.00"` and the result is rejected, with `computed_value` still `"$388.77"`.

***

## Check a compliance decision

```python theme={null}
from qwed_finance import ComplianceGuard

guard = ComplianceGuard()

# The LLM approved a 15,000 USD transfer without flagging it for AML review
result = guard.verify_aml_flag(amount=15000, country_code="US", llm_flagged=False)

print(result.compliant)  # False: amounts at or above 10,000 must be flagged
print(result.proof)
```

***

## Next steps

<CardGroup cols={2}>
  <Card title="Overview and architecture" icon="book-open" href="/finance/overview">
    How the guards, engines, and receipts fit together.
  </Card>

  <Card title="The 11 guards" icon="shield-check" href="/finance/guards">
    BondGuard, DerivativesGuard, RiskGuard, FXGuard, ComplianceGuard, and more.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.