Soma Python provider helper
Soma embeds this dependency-free module into the Python provider bridge. A
drop-in provider can import the decorator without installing a package. The same
module is packaged as the soma-provider distribution for IDEs, tests, and Python
projects that want an explicit dependency:
uv pip install ./packages/python
Provider files use the same import in both modes:
from soma_provider import Context, provider, tool
PROVIDER = provider(name="example", kind="python")
@tool(
name="greet",
title="Greet",
input_schema={
"type": "object",
"additionalProperties": False,
"properties": {"name": {"type": "string"}},
"required": ["name"],
},
)
def greet(name: str, ctx: Context) -> dict:
"""Return a greeting with runner request identity."""
return {
"message": f"Hello, {name}!",
"surface": ctx.request.surface,
}
The decorator returns the original function unchanged and records only
JSON-compatible metadata. Omitted fields keep the adapter's existing defaults:
function name and docstring discovery, annotation-based input-schema inference,
and generated CLI exposure. Dependency-free inference covers Annotated
descriptions and constraints, TypedDict required and optional keys,
dataclasses, literals, unions/nullability, fixed and variadic tuples, and typed
mapping values. Parameters annotated as Context are excluded from the public
input schema and injected by the runner. The one-shot compatibility runner
supplies request identity and explicit unavailable capability handles.
Persistent brokered workers provide live HTTP, secrets, namespaced state,
logging, metrics, progress, and cancellation handles under the provider
declaration, deployment policy, actor scopes, and host availability
intersection.
Broker capability calls are async so they do not block the provider event loop:
response = await ctx.http.request("GET", "https://api.example.com/data")
secret = await ctx.secrets.get("example-key")
current = await ctx.state.get("counter")
await ctx.state.set("counter", (current or 0) + 1)
await ctx.log.emit("info", "updated", counter=current)
await ctx.metrics.increment("updates")
await ctx.progress.update(1, total=1, message="done")
HTTP request and response bodies are lossless bytes (body_bytes) with
base64-encoded transport. Broker policy denials remain typed
CapabilityUnavailableError failures instead of being reported as worker
crashes.
The experimental componentize preflight statically inspects source and explicit wheel evidence without importing or executing provider code:
from soma_provider import scan_componentize_compatibility
report = scan_componentize_compatibility(
source,
filename="provider.py",
wheel_files=["dependency-1.0.0-py3-none-any.whl"],
)
It fails closed on native extensions, non-pure wheels, dynamic imports, process, thread, socket, native-FFI, and other ambient-authority assumptions. A compatible report means only that the provider is eligible for later isolated build and Wasmtime validation. It does not transpile Python or claim runtime compatibility.
Rust's provider-core manifest and adapter validation remain authoritative. The
tests/soma_runner_protocol.py module is also internal: it implements the
bounded length-prefixed JSON codec, version negotiation, and feature intersection
used by persistent-runner contract fixtures. One-shot remains the default
runtime. SOMA_PYTHON_RUNNER_MODE=persistent activates supervised
installed-wheel workers for catalog and invocation. Set
SOMA_PYTHON_EXECUTION_PROFILE=brokered with explicit broker policy to activate
the fail-closed capability and containment boundary.
pyproject.toml defines the soma-provider 0.2.x maturin mixed package for
Python 3.11 and newer. The pure-Python facade remains usable without a native
extension; built wheels include the private soma_provider._soma_native abi3
module for provider-core manifest validation and an SDK/native version check.
uv.lock pins development/build resolution, and the package smoke test builds
and installs the wheel in isolation. The repository now enforces an independent
soma-provider-v* tag and version parity across Python and Cargo metadata;
trusted PyPI publication, signing, provenance, and release execution remain
separate milestones. Replacing a Python implementation with WASM should preserve
the provider contract rather
than attempt to transpile arbitrary Python code. The canonical delivery status
and remaining milestones live in
docs/specs/python-provider-platform.md.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 soma_provider-0.2.0-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: soma_provider-0.2.0-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
059f37d43e8f798c1f9a27a417bb5077d147c3ecd29bb527869e4eee567e9a5e
|
|
| MD5 |
78a749ebf362948539be4d061f9bf8c2
|
|
| BLAKE2b-256 |
0b07f5252bc7a6cda5abd9af49c584793c775c6e80835912c7fcafa9aaacfed6
|
Provenance
The following attestation bundles were made for soma_provider-0.2.0-cp311-abi3-win_amd64.whl:
Publisher:
python-wheels.yml on dinglebear-ai/soma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
soma_provider-0.2.0-cp311-abi3-win_amd64.whl -
Subject digest:
059f37d43e8f798c1f9a27a417bb5077d147c3ecd29bb527869e4eee567e9a5e - Sigstore transparency entry: 2330869804
- Sigstore integration time:
-
Permalink:
dinglebear-ai/soma@5d6410d87ae5b3653e45beb8b37c6dcdea8b9b4b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dinglebear-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@5d6410d87ae5b3653e45beb8b37c6dcdea8b9b4b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file soma_provider-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: soma_provider-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.11+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
230b94b69637e49eda8b0e3dacc64b8d4facdf23b43cfdd8332c4bc007cb3387
|
|
| MD5 |
82bddd48697cb47e458db961fd17cc8d
|
|
| BLAKE2b-256 |
4779ae3df9218cd87fa465b504af40ffa6a3c3beceb510fb344d90b29dffb76a
|
Provenance
The following attestation bundles were made for soma_provider-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl:
Publisher:
python-wheels.yml on dinglebear-ai/soma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
soma_provider-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl -
Subject digest:
230b94b69637e49eda8b0e3dacc64b8d4facdf23b43cfdd8332c4bc007cb3387 - Sigstore transparency entry: 2330869876
- Sigstore integration time:
-
Permalink:
dinglebear-ai/soma@5d6410d87ae5b3653e45beb8b37c6dcdea8b9b4b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dinglebear-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@5d6410d87ae5b3653e45beb8b37c6dcdea8b9b4b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file soma_provider-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: soma_provider-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.11+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0da79e3d58e4bfad0e7a01e7c7989275b355d210331f0f53bb2b1d13b18fd32e
|
|
| MD5 |
a29254ae01e9694ef31ebf769182d39f
|
|
| BLAKE2b-256 |
2781961d098f8ef90135baed0f1d81bc36321a6348492995fd08ad73c3582047
|
Provenance
The following attestation bundles were made for soma_provider-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl:
Publisher:
python-wheels.yml on dinglebear-ai/soma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
soma_provider-0.2.0-cp311-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
0da79e3d58e4bfad0e7a01e7c7989275b355d210331f0f53bb2b1d13b18fd32e - Sigstore transparency entry: 2330869947
- Sigstore integration time:
-
Permalink:
dinglebear-ai/soma@5d6410d87ae5b3653e45beb8b37c6dcdea8b9b4b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dinglebear-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@5d6410d87ae5b3653e45beb8b37c6dcdea8b9b4b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file soma_provider-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: soma_provider-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.11+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0608bb0d09f22a70b4a502285185f713a6acb1928b2726d7f88c00c807e311e
|
|
| MD5 |
947333099d730ca968350996732bf3d8
|
|
| BLAKE2b-256 |
061f1063ade6190540d89d59c3d57faaeab9094cfde8309493b85f73f36e9b13
|
Provenance
The following attestation bundles were made for soma_provider-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl:
Publisher:
python-wheels.yml on dinglebear-ai/soma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
soma_provider-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl -
Subject digest:
b0608bb0d09f22a70b4a502285185f713a6acb1928b2726d7f88c00c807e311e - Sigstore transparency entry: 2330870027
- Sigstore integration time:
-
Permalink:
dinglebear-ai/soma@5d6410d87ae5b3653e45beb8b37c6dcdea8b9b4b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dinglebear-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@5d6410d87ae5b3653e45beb8b37c6dcdea8b9b4b -
Trigger Event:
workflow_dispatch
-
Statement type: