neuralveil
Graph your PyTorch model architecture in one command.
pip install neuralveil
neuralveil parse model.py
Drop the output into neuralveil.dev and see your model as an interactive graph — layers, tensor shapes, parameter counts — all verified by actually running your code.
How it works
your model.py ──▶ neuralveil parse ──▶ your local PyTorch
│
torch.fx trace / forward hooks
│
neuralveil_output.json ◀─┘
│
drop into neuralveil.dev ──▶ interactive graph
The CLI tries two capture strategies, in order:
1. torch.fx symbolic trace (preferred)
PyTorch's official graph capture API. Traces forward() into a structured FX graph IR with typed nodes, operator types, and shapes. Handles VGG, ResNet, DenseNet, and most CNN families cleanly.
2. register_forward_hook (fallback)
For models with dynamic control flow that torch.fx can't symbolically trace. Runs a dummy forward pass with hooks on every named submodule, capturing real input/output shapes and parameter counts. Works on virtually any valid PyTorch model.
Installation
pip install neuralveil
PyTorch is listed as an optional dependency — ML engineers already have it. If you're setting up a fresh environment:
pip install "neuralveil[torch]"
Requirements: Python ≥ 3.9
Usage
# basic
neuralveil parse model.py
# specify input shape
neuralveil parse model.py --input 1,3,224,224
# custom output path
neuralveil parse model.py --output my_graph.json
If the file defines multiple nn.Module subclasses, the CLI will prompt you to pick one.
Python API
import neuralveil
graph = neuralveil.parse_model("model.py", input_shape=(1, 3, 224, 224))
print(graph["nodes"])
Security model
The CLI runs entirely on your machine. There is no server, no code upload, no API key, no rate limit.
- Your code never leaves your environment
- Works fully offline and in air-gapped environments
- Execution timeout: 15 seconds (SIGKILL after)
Contributing
Issues and PRs welcome. Built by Gyan Shresth · Apache 2.0
Metadata
Release files for neuralveil 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neuralveil-1.0.0.tar.gz | 19.5 kB | Without provenance | Details for neuralveil-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| neuralveil-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for neuralveil-1.0.0-py3-none-any.whl |
Total release size: 40.0 kB
Release files / neuralveil-1.0.0.tar.gz
| Download URL | neuralveil-1.0.0.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f3f5d2c45eb433852c7b5619788d8e8320d6c709f8e5308439cd7eba95ceba1
|
|
BLAKE2b-256 checksum How to use checksums |
ea55328d344e9fdc2953243e0679a0b9b32aa84ba889c814e53e9c145fd3cd37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.5
|
Release files / neuralveil-1.0.0-py3-none-any.whl
| Download URL | neuralveil-1.0.0-py3-none-any.whl |
|---|---|
| Size | 20.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55380090056e04a187c27e0354de53b74d4e51f92c944f9985fed7f6df193bc7
|
|
BLAKE2b-256 checksum How to use checksums |
d766539d7c6367c3f7ebaf58aa6b6a0f7eadc9ee4c4c1c6baf7fdec88647a2f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.5
|
Security for neuralveil 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.