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.0.tar.gz (711.1 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.0-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.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

Hashes for somatize-1.0.0.tar.gz
Algorithm Hash digest
SHA256 35441d87885cfe46047c6bb734f3bfe85b9c722c0d8718c288328399f23b1bdd
MD5 22a089a4d99d3c1d943bbe305739287e
BLAKE2b-256 46b489e1b3b322ccf9535399fa2d236363447703b286fcd76806386dacf44596

See more details on using hashes here.

Provenance

The following attestation bundles were made for somatize-1.0.0.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.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for somatize-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fbccf91a4f120ed7507d7fd03701fa171193e77872d129a665735d648571db59
MD5 35ae9afef77505f3cd90c82c5aab40dc
BLAKE2b-256 0199c33f5cd1fc19207c9e4038438d563f25545e23650d179412ea7a7414111b

See more details on using hashes here.

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

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

Release history Release notifications | RSS feed

1.0.1

2 files

This release

1.0.0 This release

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