Understand and compare data-science experiments. Connect selected Python
functions to AI agents through MCP, or expose them as REST APIs.
Apizr is an open-source capability compiler: analyze existing Python code,
choose which functions are public, generate their interfaces, and define how
they execute. Your business logic stays in Python.
Follow Install Apizr, then
the Quickstart. See the release history
for version-specific functionality, compatibility and verified publication.
The journey is Python code → discover/select capabilities → expose as REST/MCP
→ optionally deliver as OCI.
Apizr 0.4.5 is available on PyPI. The core and optional MCP, OCI and Attest
plugins share the same version. See the release record
for functionality, verified public artifacts and installation evidence.
Python 3.11–3.14 · GPL-3.0-or-later.
Apizr 0.4.5 lets you record and compare
experiments, then explicitly select a prediction function for REST or MCP.
Know which data, code, parameters and environment produced your result.
Try the ordinary scikit-learn notebook.
Apizr 0.4.5 also recognizes supported Python TypedDict model
payloads as shared, nested JSON inputs for REST and MCP. See the
source inspection guide
for an executable example and the current declaration limits.
It also adds concise MCP analysis: ask for view="summary", then inspect one
function with view="detail", capability_id="python:model:predict". The
analysis server guide
explains dependency evidence, pagination and localized exposure refusals.
Exposing an existing function requires no Experiment Run. The experiment path is
optional when recorded evidence helps your work. The developer guide integrates
Apizr; Contributing covers changing Apizr itself.
Choose your path
Have a training script or notebook? Apizr 0.4.5 adds a
zero-execution first step:
apizr experiment inspect train.py
See code, data, parameters, randomness, environment, metrics, outputs and serving
candidates. Follow the experiment inspection example
for setup, notebooks and JSON. No science-framework installation is needed.
Apizr can also execute trusted workloads and keep local history.
run executes your code with host filesystem, network and subprocess access;
it is not a security sandbox. This small example uses only the standard library:
cat > local_run.py <<'PY'
from pathlib import Path
mean = sum([2, 4, 6]) / 3
Path("model.json").write_text('{"mean": 4.0}\n')
PY
apizr experiment inspect local_run.py
RUN=$(apizr experiment run local_run.py --metric mean=mean --output model=model.json --format json | python3 -c 'import json,sys; print(json.load(sys.stdin)["run_digest"])')
apizr experiment list
apizr experiment show "$RUN"
Read the local run and history guide
for environment controls, observed evidence, failure handling and storage limits.
The core handles supported static analysis and generation. Generated servers have
their own runtime dependencies. Optional plugins live in separate environments;
installation, activation and operator authorization are independent decisions.
Apizr 0.4.5 lets you expose an independent function while unrelated experiments
remain unfinished; see the research repository example.
Inspect → Run → Compare → Expose
“My ROC AUC changed. What else changed between these runs?” This core-only
example records two trusted local runs, then compares their saved evidence.
A → B means evidence added in B or removed from A; numeric deltas are B - A.
show reads one Run; diff compares two Runs from the same validated local store.
Comparison still works after deleting the source. Unknown observations remain unknown.
Apizr identifies recorded differences; it does not prove which one caused the metric change.
Read the comparison guide for data, environment and output evidence.
After reviewing a successful Run, explicitly select its serving capability:
The current source and selected resource bytes must still match the Run.
Repository Readiness and Exposure decide eligibility. Follow the
Experiment → serving guide
for source authority, exact dependency pins and current direct-service limits.
Expose the functions you choose
Readiness reports whether the available code evidence supports an interface.
An exposure policy names the functions you choose to make public. A bundle
is the generated server, its contracts and the source needed by those functions.
Being ready never makes a function public automatically.
The generated MCP server calls your selected functions. The separate,
Apizr analysis MCP server
analyzes repositories and plans exposure; it does not execute their functions.
Choose execution boundaries
Analysis and generation do not execute the project. Starting a generated server
and calling its functions does: use trusted source and dependencies.
Direct mode runs functions inside the server. Governed mode uses an
execution policy to choose a worker and its required limits: a fresh local
process or an OCI container per call. Local workers do not isolate the host
filesystem or network; containers are not an untrusted-code guarantee.
The direct Quickstart needs no Docker. Read the
exposure guide
for governed examples and the
execution boundaries
for their guarantees and limits.
Existing workflows and limits
Single-source inspect, generate rest/mcp and execute remain supported.
Apizr 0.4.2 also exports verified REST bundles to
Postman, Bruno and Insomnia collections,
with deterministic files and safe local regeneration.