Skip to main content

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

somatize-1.0.1.tar.gz (713.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

somatize-1.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

File details

Details for the file somatize-1.0.1.tar.gz.

File metadata

  • Download URL: somatize-1.0.1.tar.gz
  • Upload date:
  • Size: 713.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for somatize-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b29c1f2bafd8a03ded99f4045ef37165ebe7884b0317a8aeb9203308f1546874
MD5 3a2482447e8fe1c418e1865bd714844b
BLAKE2b-256 21f6c95d5a5ef8c61810b00c4e98f1f167f270b5b24758fa3774ccd172273c96

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-1.0.1.tar.gz:

Publisher: release.yml on manucouto1/soma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file somatize-1.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for somatize-1.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e19d3694b1471515e2392943228f7ade11086a7897cd4a82e409307fb075b1c5
MD5 dc68b640d6b4c36eec4c270f320b8bc4
BLAKE2b-256 1749cf4b70d23272320f7ea3a70a8754ffb380d51d388526618e29346d4efe74

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-1.0.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on manucouto1/soma

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

0.5.1

3 files

0.5.0

3 files

0.3.1

3 files

0.2.46

3 files

0.2.45

3 files

0.2.44

3 files

0.2.43

3 files

0.2.41

5 files

0.2.40

5 files

0.2.39

5 files

0.2.38

5 files

0.2.37

5 files

0.2.35

5 files

0.2.34

5 files

0.2.33

5 files

0.2.32

5 files

0.2.31

5 files

0.2.30

5 files

0.2.29

5 files

0.2.28

5 files

0.2.27

5 files

0.2.26

5 files

0.2.25

5 files

0.2.24

5 files

0.2.22

5 files

0.2.21

5 files

0.2.20

5 files

0.2.19

5 files

0.2.18

5 files

0.2.17

5 files

0.2.16

5 files

0.2.15

5 files

0.2.14

5 files

0.2.13

5 files

0.2.12

5 files

0.2.11

5 files

0.2.9

5 files

0.2.5

7 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