Skip to main content

Plotifi Engine

Plotifi — a deterministic portfolio-math engine exposed over MCP, so any AI agent can compute portfolio math instead of hallucinating it.

The same inputs give the same answer, to the decimal, forever.

That is the product claim. If two runs with the same engine_version, pinned toolchain, and identical inputs disagree, we treat it as a bug — not a “numerical tolerance” shrug.

Status

M3 — MCP server & public v0.1.0. Stdio MCP tools for optimize, frontier, CVaR, risk parity, and backtest. Copy-paste host config and worked examples: docs/MCP.md (install → first correct agent answer in <5 min). Release steps: docs/RELEASE.md. Registry listing handoff (Sri): LISTING_HANDOFF.md.

Prior: M2.5 reconciliation — RECONCILIATION.md, docs/VOLATILITY_DEFECT.md.

Why determinism matters

Agent callers will retry, fan out, and cache. If the engine drifts across threads, OSes, or Python patch levels, every downstream tool call becomes non-auditable. Plotifi pins BLAS threads, hashes canonical inputs, surfaces solver status (never silent fallbacks), and locks numerics behind golden files.

Quickstart (60 seconds)

Agent / MCP path (strangers start here):

pip install plotifi   # after PyPI publish; else pip install -e . from a clone
# Paste the config block from docs/MCP.md into Claude Desktop or Cursor

Library / contrib path:

git clone https://github.com/Plotifi/plotifi-engine.git
cd plotifi-engine
python -m venv .venv && source .venv/bin/activate
pip install -r requirements-lock.txt
pip install -e ".[dev]"

# Bundled sample — zero external data
python -c "from plotifi import load_sample_returns, sample_covariance, mean_variance_optimize; \
r=load_sample_returns().result; mu=r.mean().to_numpy(); cov=sample_covariance(r.to_numpy()).result; \
print(mean_variance_optimize(mu, cov).result.weights)"

ruff check . && mypy src tests && pytest -v
plotifi-scoreboard
plotifi-mcp   # MCP stdio server

What this is

  • Deterministic mean-variance, CVaR (Rockafellar–Uryasev), risk-parity, and backtest computations
  • Canonical response envelopes (result, input_hash, engine_version, solver, iterations, warnings)
  • MCP tools for agent callers — docs/MCP.md
  • Mirror and strict numerical modes reconciled against the legacy ionic-mirror app — RECONCILIATION.md

What this is not

  • Investment advice, rankings, or recommendations
  • Custody, order execution, or portfolio storage
  • Live or licensed market data (frozen fixtures only in v0)
  • A UI or dashboard
  • Bit-identical floats across arbitrary CPU/BLAS stacks (see REPRODUCIBILITY.md)

Honest limitations

Claim Reality
Same inputs → same outputs Guaranteed under pinned toolchain + BLAS thread pin on CI platforms
Cross-hardware bit identity Not guaranteed (x86 vs ARM, OpenBLAS vs MKL)
Live market data Not reproducible; use frozen fixtures
Solver iteration counts Diagnostic only — may vary with BLAS build
CVaR / risk parity Scenario/sample estimators; not a substitute for fund risk systems

A quant should trust us for auditable, pinned, offline portfolio math — and should not treat envelopes as investment advice or live risk signs.

Tooling

Tool Command
Lint ruff check .
Format ruff format .
Types mypy src tests
Tests pytest -v
Determinism pytest tests/determinism/ -v
Golden corpus pytest tests/golden/ -v
Performance budget pytest tests/performance/ -v
Scoreboard plotifi-scoreboard
MCP server plotifi-mcp / python -m plotifi.mcp
Agent eval pytest tests/agent_eval/ -v
Reconciliation pytest tests/reconcile/ -v
MCP docs docs/MCP.md
Release (PyPI tag) docs/RELEASE.md
Listing handoff (Sri) LISTING_HANDOFF.md
Vol defect writeup docs/VOLATILITY_DEFECT.md
Demo handoff (Sri) DEMO_HANDOFF.md

Reproducibility & performance

Names

PyPI / GitHub / docs domain reservation status is tracked in NAMES.md (owner: Sri; issue #7).

Contributing

See CONTRIBUTING.md. Work issue-by-issue in milestone order. Apache-2.0 licensed.

License

Apache License 2.0 — see LICENSE and NOTICE.

Metadata

Release files for plotifi 0.1.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 plotifi 0.1.0
File Size Uploaded Provenance Actions
plotifi-0.1.0.tar.gz 124.2 kB Without provenance Details for plotifi-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plotifi 0.1.0
File Interpreter ABI Platform Actions
plotifi-0.1.0-py3-none-any.whl Python 3 none any Details for plotifi-0.1.0-py3-none-any.whl

Total release size: 258.7 kB

Release files / plotifi-0.1.0.tar.gz

Download URL plotifi-0.1.0.tar.gz
Size 124.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9e2cb139f2d8395722ccaca8da5b3343256c10f46cc0992e3c2759190be4997b
BLAKE2b-256 checksum
How to use checksums
c2d40d99eb820f6b4d2cca161c7d6be8241d25cc24260dc67c59957c272dd56a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / plotifi-0.1.0-py3-none-any.whl

Download URL plotifi-0.1.0-py3-none-any.whl
Size 134.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5020e35609f6476c3a9a829359539287c19b1b064c3d3fca27b2cb32c0a317f0
BLAKE2b-256 checksum
How to use checksums
0cf744533e3abfbd0f1998184b80c23f9cda877918352114fb7bc13ecc8f1c1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for plotifi 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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