Skip to main content

Package Management

NeuroScript uses a Cargo-inspired package management system built around Axon.toml manifests. Packages bundle reusable neuron definitions that can be shared via git repositories, imported into other projects, and cryptographically signed for integrity.

Quick Start

# Create a new neuron package
neuroscript init my-neurons --author "You <[email protected]>"

# Add a dependency from a git repo
cd my-neurons
neuroscript add attention-blocks \
--git "https://github.com/user/attention.git"

# Fetch all dependencies
neuroscript fetch

# Use neurons from dependencies in your code
neuroscript compile src/model.ns

How It Works

  1. Manifests (Axon.toml) declare package metadata, exported neurons, and dependencies
  2. Dependencies can be git repositories or local paths
  3. Lockfiles (Axon.lock) pin exact versions for reproducible builds
  4. Use statements import neurons from fetched packages into your code
  5. Security features provide Ed25519 signing and SHA-256 checksums

Package Structure

A typical NeuroScript package looks like this:

my-package/
├── Axon.toml # Package manifest
├── Axon.lock # Lockfile (generated by fetch)
├── README.md # Documentation
├── .gitignore
└── src/
├── attention.ns # Neuron definitions
└── ffn.ns

Manifest Format

[package]
name = "my-neurons"
version = "0.1.0"
authors = ["You <[email protected]>"]
license = "MIT"
description = "Reusable attention neurons"

# Which neurons this package exports
neurons = ["MultiHeadAttention", "CrossAttention"]

[dependencies]
core-blocks = { git = "https://github.com/org/core-blocks.git" }
local-utils = { path = "../local-utils" }

[python-runtime]
requires = ["torch>=2.0"]

Documentation