Metadata-Version: 2.4
Name: shem-neural
Version: 0.2.0
Summary: shem's neural side: an RV32IM CPU compiled into network weights, and model images
Keywords: shem,containers,riscv,neural-network,language-models
Author: João Galego
Author-email: João Galego <jgalego1990@gmail.com>
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Emulators
Requires-Dist: huggingface-hub>=2.4.0
Requires-Dist: jinja2>=3.1.6
Requires-Dist: numpy>=2
Requires-Dist: safetensors>=0.4
Requires-Dist: tokenizers>=0.23.3
Requires-Dist: torch>=2.5
Requires-Dist: zstandard>=0.23
Requires-Dist: accelerate>=1.15.0 ; extra == 'gguf'
Requires-Dist: gguf>=0.19.0 ; extra == 'gguf'
Requires-Dist: transformers>=5.22.2 ; extra == 'gguf'
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/JGalego/shem
Project-URL: Documentation, https://github.com/JGalego/shem/tree/main/docs
Project-URL: Repository, https://github.com/JGalego/shem
Provides-Extra: gguf
Description-Content-Type: text/markdown

# shem-neural

The neural vCPU for [shem](https://github.com/JGalego/shem): an RV32IM CPU compiled into the weights of a network that runs one instruction per forward pass.

![An RV32 program runs one instruction per forward pass. On ecall, the host handles the write system call, updates the return value and program counter, then resumes the guest.](https://raw.githubusercontent.com/JGalego/shem/main/docs/assets/execution.svg)

```sh
uv run pytest                                            # unit tests
uv run python -m shem_neural.server --socket /tmp/shem.sock   # serve vCPUs to the host
```

See the [neural vCPU documentation](https://github.com/JGalego/shem/blob/main/docs/neural.md) for how the network works and how the host talks to it.
