Skip to main content

fluss-monty

Check and run flows written as Python source in a Monty sandbox. This is the core that the fluss client and the fluss server share. It never talks to a server itself.

from fluss_monty import ManifestAction, arun_python_flow, validate_python_flow

source = '''
async def main(image: MikroImage) -> MikroImage:
    return await segment(image, sigma=1.5)
'''

report = await validate_python_flow(source, [ManifestAction(alias="segment", action=segment_action)])
assert report.ok, report.diagnostics
report.args, report.returns, report.manifest, report.stubs  # what the flow is stored with

returns = await arun_python_flow(source, {"image": "img-1"}, actions, call)
  • Validation works in two passes, and neither executes the entrypoint.

    1. The host ast checks the source's shape and reads the entrypoint's signature into ports.
    2. Monty type-checks the source against stubs of the manifest's actions, and nothing else. A call to anything outside the manifest is an unresolved name.

    validate_python_flow_sync is the same check for synchronous callers. Checking runs under tight resource limits (CHECK_LIMITS), because defining the source's functions runs their class bodies, decorators and defaults.

  • A run binds only the manifest's actions, as async functions. Each call goes out through the injected call(action, kwargs, call_key).

    • A call key is alias:digest(kwargs):n, the n-th identical call. It doesn't depend on how gathered calls interleave, so a workflow that is run again finds every call it made.
    • A run that ends early cancels the calls it still has in flight.
  • Structures are their IDs. @mikro/image is typed MikroImage, a str subclass that only the type checker sees.

uv run pytest

Metadata

Release files for fluss-monty 1.0.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 fluss-monty 1.0.0
File Size Uploaded
fluss_monty-1.0.0.tar.gz 27.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fluss-monty 1.0.0
File Interpreter ABI Platform
fluss_monty-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 57.0 kB

Release files / fluss_monty-1.0.0.tar.gz

Download URL fluss_monty-1.0.0.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
055523ab83ac9d5dc668c24cd4530a6867a0ccea27aacbb8594801096cc1c61a
BLAKE2b-256 checksum
How to use checksums
b2c87d86e5174db8d12fc587539966a0eb2828da0acf9ea51ee92b3e2ae9078c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fluss_monty-1.0.0-py3-none-any.whl

Download URL fluss_monty-1.0.0-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
530609b1454f2fa6efa5185beec316ea0a62b2713cd958a99d1f7b67a24c5934
BLAKE2b-256 checksum
How to use checksums
dac3796d9332bd6308218edb7841cfe03b63d9c743d432b051bb555618af93cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.0.0 This release

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