Skip to main content

Masterbrain Python Package

Published Python package for the Masterbrain monorepo. It owns the provider-neutral AI core, model provider adapters, FastAPI service, desktop launcher, Python tests, and PyInstaller packaging flow.

The package depends on the sibling airalogy package in source checkouts and uses it to validate and unpack .aira archives for the local protocol/record library.

For platform coverage and packaging limits, see ../../PLATFORM_SUPPORT.md. For PyPI release automation, see ../../RELEASING.md. For usage metering and Platform billing integration, see ../../docs/en/usage-and-billing.md.

Setup

cp .env.example .env
uv sync --dev

packages/masterbrain/.env is the standard location for local runtime configuration.

Run

Start the FastAPI server:

uv run uvicorn masterbrain.fastapi.main:app --reload --host 127.0.0.1 --port 8080

Launch the integrated desktop-style local app after building the frontend in apps/studio:

uv run masterbrain-studio

masterbrain-desktop is kept as a deprecated compatibility alias and will be removed in a future release.

You can bind the app to an existing workspace directory:

uv run masterbrain-studio --workspace /path/to/project

You can also pass an .aira archive path as the launch document. Masterbrain will import it into the local library before opening the UI:

uv run masterbrain-studio /path/to/archive.aira

OpenCode

Code-edit flows require an OpenCode runtime. Either install opencode globally, or vendor it locally:

python3 scripts/vendor_opencode.py

Tests

Run the Python package test suite:

uv run python -m pytest

pytest.ini excludes openai and qwen markers by default.

Packaging

PyPI publishing is handled by the repository-level GitHub Actions release workflow on v* tag pushes.

Build the packaged local bundle with the cross-platform CLI:

uv run masterbrain-build-desktop

Wrapper scripts are also available:

  • macOS / Linux: ./scripts/build_desktop_bundle.sh
  • Windows PowerShell: .\scripts\build_desktop_bundle.ps1

This builds the frontend from apps/studio, vendors OpenCode into packages/masterbrain/vendor/, syncs the packaging dependency group, writes the raw PyInstaller bundle to packages/masterbrain/dist/Masterbrain/, and then packages platform release artifacts under packages/masterbrain/dist/release/<platform>/.

  • macOS: unsigned Masterbrain.app and a versioned .zip
  • Windows x64: portable directory, portable .zip, and an Inno Setup .iss script; if ISCC.exe is available or passed via --inno-setup-compiler, the installer .exe is also built
  • Linux: portable directory and a versioned .tar.gz

Metadata

Release files for masterbrain 0.12.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 masterbrain 0.12.0
File Size Uploaded
masterbrain-0.12.0.tar.gz 119.4 kB Details

Built distribution (wheel)

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

Total release size: 315.1 kB

Release files / masterbrain-0.12.0.tar.gz

Download URL masterbrain-0.12.0.tar.gz
Size 119.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2c3f72c641efe08f52baceb2adae6f1ebfbbe3277596d9299126675cb9e1d117
BLAKE2b-256 checksum
How to use checksums
ae1904a8d2b2f19659e2e0c16b488f9ebbdb6181aa82dbc2bfb6985920ca830a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 11, 2026.

Transparency log

Release files / masterbrain-0.12.0-py3-none-any.whl

Download URL masterbrain-0.12.0-py3-none-any.whl
Size 195.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
979b15cebd44a1f5a1773f919cfac717294d0bb08f911dc5e926ddca0b04d07a
BLAKE2b-256 checksum
How to use checksums
ad33f3d45608fda85641efdf3704db39d0a93878c90e5b25e2d0cdf17f4f6153
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.12.0 This release

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.0.1

2 release files

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