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.appand a versioned.zip - Windows x64: portable directory, portable
.zip, and an Inno Setup.issscript; ifISCC.exeis available or passed via--inno-setup-compiler, the installer.exeis also built - Linux: portable directory and a versioned
.tar.gz
Metadata
Release files for masterbrain 0.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| masterbrain-0.13.0.tar.gz | 121.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| masterbrain-0.13.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 318.9 kB
Release files / masterbrain-0.13.0.tar.gz
| Download URL | masterbrain-0.13.0.tar.gz |
|---|---|
| Size | 121.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
327e70f1a21d0ac47baad2e7126962a95859a00e3af76f805c6572836aae6fb2
|
|
BLAKE2b-256 checksum How to use checksums |
a81baf2bc5ffd1654f2e9dd8090c37909b44856727f8d03eb14b768eb421d1f5
|
| 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 Oct 8, 2026.
Transparency logRelease files / masterbrain-0.13.0-py3-none-any.whl
| Download URL | masterbrain-0.13.0-py3-none-any.whl |
|---|---|
| Size | 197.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
776ec11a0c5dfe5fedf19408cab3b421fdf73b3ba9eb75bff38e155a4af32a83
|
|
BLAKE2b-256 checksum How to use checksums |
79fa8dba5b1a9975688c5a92e4aba1074c41badc606c863aa07750b023c771ee
|
| 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 Oct 8, 2026.
Transparency log