A lightweight, zero-setup Metaflow metadata service that persists to .metaflow/ — starts on demand, stops after idle
Project description
metaflow-local-service
Track your Metaflow runs locally without setting up a database.
The problem
When you want Metaflow's service metadata — run tracking, artifact indexing, heartbeats, tag
mutation — you need a running metaflow-service backed by PostgreSQL. That's fine for production,
but for local development, sandboxes, or CI you're forced to choose between local mode (no HTTP
API, no resume across machines) and a heavyweight Postgres deployment. There's no middle ground.
Quick start
pip install metaflow-local-service
# Start the service and run your flow in one command
metaflow-local-service run python myflow.py run
The daemon starts automatically, sets METAFLOW_SERVICE_URL and
METAFLOW_DEFAULT_METADATA=service for your flow, and shuts down after 5 minutes of idle time.
Data is written to .metaflow/ in the current directory — the same format as local mode.
Install
pip install metaflow-local-service
Requires Python 3.9+ and Metaflow 2.12+.
Usage
Wrap a flow command
metaflow-local-service run python myflow.py run --max-workers 4
The daemon starts if it isn't already running, then runs your command with the service URL in the environment.
Manage the daemon manually
metaflow-local-service start # start in background
metaflow-local-service status # show PID, port, and URL
metaflow-local-service url # print just the URL, for scripting
metaflow-local-service stop # send SIGTERM
Scripting
export METAFLOW_SERVICE_URL=$(metaflow-local-service url)
export METAFLOW_DEFAULT_METADATA=service
python myflow.py run
How it works
The daemon wraps Metaflow's own LocalMetadataProvider behind the standard service HTTP API
(v2.5.0). Data is written directly to .metaflow/ on every request — no sync step, no separate
database. On resume, task IDs are seeded from existing files on disk so new tasks never collide
with previous ones.
See docs/architecture.md for the full layer diagram.
Configuration
| Environment variable | Default | Description |
|---|---|---|
METAFLOW_LOCAL_SERVICE_PORT |
0 (random) |
Port to bind |
METAFLOW_LOCAL_SERVICE_IDLE_TIMEOUT |
300 |
Seconds of heartbeat silence before shutdown |
METAFLOW_LOCAL_SERVICE_DEBUG |
"" |
Set to 1 to enable daemon logging |
See docs/configuration.md for the full reference.
Development
git clone https://github.com/npow/metaflow-local-service.git
cd metaflow-local-service
pip install -e ".[dev]"
pytest
Structural tests (AST-based layer boundary enforcement) run without metaflow installed:
pytest -m structural
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaflow_local_service-0.2.0.tar.gz.
File metadata
- Download URL: metaflow_local_service-0.2.0.tar.gz
- Upload date:
- Size: 27.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6cbc221085b38ee2fc7dda4ff2bd3ec0e99ea3759ffc7e3fedc1404f7eedfea
|
|
| MD5 |
ef4e0b1fa980fb97f7be1530f7fb78a7
|
|
| BLAKE2b-256 |
6c5a01769b195b566497234c7cdb91d9a459ccbb588ebcfc5268392e7ef05bce
|
Provenance
The following attestation bundles were made for metaflow_local_service-0.2.0.tar.gz:
Publisher:
publish.yml on npow/metaflow-local-service
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaflow_local_service-0.2.0.tar.gz -
Subject digest:
a6cbc221085b38ee2fc7dda4ff2bd3ec0e99ea3759ffc7e3fedc1404f7eedfea - Sigstore transparency entry: 1059372606
- Sigstore integration time:
-
Permalink:
npow/metaflow-local-service@30dea4b02fe77535bc1b11127bec53f5a9e51e7b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/npow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@30dea4b02fe77535bc1b11127bec53f5a9e51e7b -
Trigger Event:
push
-
Statement type:
File details
Details for the file metaflow_local_service-0.2.0-py3-none-any.whl.
File metadata
- Download URL: metaflow_local_service-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
078913af6f5231e11c5928e18bae1c29ab8c02c3c68b2bef55223de5b42eecec
|
|
| MD5 |
20a589d789903f4196bf32579db52ad0
|
|
| BLAKE2b-256 |
83554056db7f98cc6813fbd17fcaa97a39fc97b2c2574daa4c9d3f6f71a694c9
|
Provenance
The following attestation bundles were made for metaflow_local_service-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on npow/metaflow-local-service
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaflow_local_service-0.2.0-py3-none-any.whl -
Subject digest:
078913af6f5231e11c5928e18bae1c29ab8c02c3c68b2bef55223de5b42eecec - Sigstore transparency entry: 1059372607
- Sigstore integration time:
-
Permalink:
npow/metaflow-local-service@30dea4b02fe77535bc1b11127bec53f5a9e51e7b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/npow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@30dea4b02fe77535bc1b11127bec53f5a9e51e7b -
Trigger Event:
push
-
Statement type: