somatize
Declare a computation as a graph, run it, train it, and search over it — on this machine or across several — with what happened written down as you go.
pip install somatize
from somatize import Graph, Node
class Tokenise(Node):
def forward(self, text, ctx):
return text.lower().split()
class MeanLength(Node):
def forward(self, words, ctx):
return sum(len(w) for w in words) / len(words)
g = Graph.somatize(Tokenise().named("tokenise") >> MeanLength().named("mean"))
g.forward("The cat sat on the mat") # 2.8333333333333335
>> chains, | fans out, and a node carries where it runs (.at()), whether
its result is kept (.cached()), and whether it learns (.frozen()). The graph
draws itself before it has ever run.
What is here
The engine is Rust; the surface is Python. Nine crates, each one a thing you can name:
somatize-core |
the graph, the plan of how to run it, and the engine that walks it |
somatize-store |
where a computed value is kept: bytes by content, names that point at them |
somatize-data |
where the data comes from, and what it is once it arrives |
somatize-study |
what is above one training run: a search over configurations |
somatize-health |
whether what a run did is healthy — an opinion, and it says so |
somatize-tree |
what an edit did to a graph, said before anybody runs it |
somatize-fabric-wire |
carrying a slice of a plan to another process |
somatize-fabric-broker |
the name a graph gave a host, turned into a way of reaching it |
The API reference is at manucouto1.github.io/soma.
Start here
examples/ holds twelve notebooks, shipped with their outputs,
so opening one shows what it does without running anything: declaring a graph,
watching a run, training, a study, the health of a network, one problem end to
end, a real architecture diagnosed in cycles, what can be said before a step is
taken, a fleet of machines, where the data comes from, what an edit did, and
where a kept value came from.
The optional halves are extras, because a graph declares, executes and trains without either:
pip install 'somatize[viz]' # plotly, for every figure
pip install 'somatize[remote]' # cloudpickle, for a worker that starts empty
Building it
uv run cargo test --workspace
cd soma-python && maturin develop && python -m pytest tests/ -q
maturin develop is not optional before pytest: the Python tests run against
the installed extension, so a change in soma-python/src/ that is not
rebuilt means the suite is green about code that is not the code.
There is more, and it is opt-in because it is slow: a cluster of real containers
(SOMA_CLUSTER=1 python -m pytest tests/cluster) and a real bucket
(docker compose -f soma-store/tests/docker/compose.yaml up -d). Both are
described in CLAUDE.md.
Licence
Elastic License 2.0. The somatize versions up to 0.5.1 are a
different implementation, kept on the legacy-0.5 branch.
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 somatize-1.0.0.tar.gz.
File metadata
- Download URL: somatize-1.0.0.tar.gz
- Upload date:
- Size: 711.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35441d87885cfe46047c6bb734f3bfe85b9c722c0d8718c288328399f23b1bdd
|
|
| MD5 |
22a089a4d99d3c1d943bbe305739287e
|
|
| BLAKE2b-256 |
46b489e1b3b322ccf9535399fa2d236363447703b286fcd76806386dacf44596
|
Provenance
The following attestation bundles were made for somatize-1.0.0.tar.gz:
Publisher:
release.yml on manucouto1/soma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
somatize-1.0.0.tar.gz -
Subject digest:
35441d87885cfe46047c6bb734f3bfe85b9c722c0d8718c288328399f23b1bdd - Sigstore transparency entry: 2615427723
- Sigstore integration time:
-
Permalink:
manucouto1/soma@ca54c315bf190103a21e7ee1804bbc975dd9cb20 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/manucouto1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ca54c315bf190103a21e7ee1804bbc975dd9cb20 -
Trigger Event:
push
-
Statement type:
File details
Details for the file somatize-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: somatize-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 6.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbccf91a4f120ed7507d7fd03701fa171193e77872d129a665735d648571db59
|
|
| MD5 |
35ae9afef77505f3cd90c82c5aab40dc
|
|
| BLAKE2b-256 |
0199c33f5cd1fc19207c9e4038438d563f25545e23650d179412ea7a7414111b
|
Provenance
The following attestation bundles were made for somatize-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on manucouto1/soma
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
somatize-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
fbccf91a4f120ed7507d7fd03701fa171193e77872d129a665735d648571db59 - Sigstore transparency entry: 2615427729
- Sigstore integration time:
-
Permalink:
manucouto1/soma@ca54c315bf190103a21e7ee1804bbc975dd9cb20 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/manucouto1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ca54c315bf190103a21e7ee1804bbc975dd9cb20 -
Trigger Event:
push
-
Statement type: