Skip to main content

AI x RT: dynamic latent tensor representation layers for PyTorch.

Project description

ARTI

AI x RT: composable latent tensor layers for PyTorch.

ARTI is a domain-independent neural-network library for transforming hidden tensors at runtime. Its layers work with ordinary tensors and can optionally use coordinates, masks, visibility, latent recall, and compact workspaces.

hidden tensor -> ARTI layer or block -> transformed latent tensor

ARTI does not define a tokenizer, task head, data schema, or business model. Applications remain responsible for encoding their context into tensors.

Version 1.1.0 is a Stable Candidate. The supported 1.x surface is frozen for final compatibility verification, but this release does not yet carry an LTS commitment. See Stability and Security.

Install

Add ARTI to a project with uv:

uv add arti-fit

ARTI requires Python 3.10 or newer and PyTorch 2.2 or newer. The consuming project chooses the appropriate CPU or CUDA build of PyTorch.

The PyPI distribution is named arti-fit; the Python import remains arti.

Optional integrations can be installed as needed:

uv sync --extra jax
uv sync --extra qwen
uv sync --extra peft
uv sync --extra sd
uv sync --extra web

The alpha browser runtime is published separately:

pnpm add @arti-fit/web@alpha

Use ARTI As A Layer

The smallest API behaves like a normal PyTorch layer:

import arti
import torch

layer = arti.nn.Layer(dim=32)
x = torch.randn(4, 16, 32)
mask = torch.ones(4, 16, dtype=torch.bool)

out = layer(x, mask=mask)

assert out.y.shape == (4, 16, 32)
assert out.pooled.shape == (4, 32)
print(out.diagnostics.keys())

For [B, D] inputs, ARTI treats each row as a single token and restores the original rank on output.

Capabilities are opt-in. Enable only the structure carried by the data:

recall_layer = arti.nn.Layer(dim=32, profile="recall")
multisource = arti.nn.Layer(dim=32, profile="multisource", coord_dim=4)

Compose Recall, Half, And Fold

ARTI mechanisms are also available as standalone modules:

import arti

recall = arti.ARTILatentRecallField(hidden_dim=64, slots=8)
half = arti.nn.Half()
fold = arti.nn.Fold(k=16, dim=64)

The common Recall branch pattern is deliberately small:

delta = recall(h, mask, recall=None)[0]
h = h + half(delta)
workspace = fold(h, mask=mask)

Recall proposes latent traces, Half applies feature-strength survival, and Fold compacts surviving information into a fixed-size workspace. Each module can be used independently.

Attach To An Existing Model

ARTI can discover and attach Recall branches without changing the model class:

import arti

model = arti.ARTI.attach(
    model,
    recall={
        "layers": "model.layers.*",
        "rank": 16,
        "slots": 8,
    },
)

print(model.arti.summary())
model.arti.save("assistant.recall.arti.st")

Attachment configuration supports explicit layer paths, per-layer dimensions, independent Recall lines, Half switches, resource previews, and reversible removal. Transformers, PEFT, and Diffusers are optional integration boundaries; the core package remains PyTorch-first.

Save And Load Weights

ARTI uses SafeTensors with JSON integrity sidecars:

saved = arti.save(layer, "layer.arti.st")
loaded = arti.load("layer.arti.st", model=fresh_layer)

print(saved.weights_sha256)
print(loaded.missing_keys, loaded.unexpected_keys)

ARTI 1.x reads compatible format-version 1 artifacts produced by the pre-public 0.x line. Legacy .pt migration uses PyTorch's restricted tensor-only loader:

arti.migrate_pt("legacy-state.pt", "layer.arti.st")

Artifact hashes detect modification relative to their lock files; they are not publisher signatures. Obtain models and weights from trusted sources.

Public Modules

  • arti.nn: Layer, Half, Fold, Pulse, RecallRefiner, and visual workspace modules.
  • arti: complete ARTI layers, residual blocks, reference models, attachment, serialization, and diagnostics.
  • arti.torch: backend-explicit aliases for PyTorch applications.
  • arti.jax: optional functional JAX backend with JIT and gradient support.
  • arti.functional: mask, visibility, pooling, coordinate-frame, and activation helpers.

Experimental and legacy APIs are identified in their docstrings and are not frozen at the same level as the supported core surface.

WebGPU Alpha

arti.web.export(...) can export deterministic Half, soft Fold, and soft-fold LearnedPulse modules as hashed ONNX artifacts. The separate @arti-fit/web package executes those artifacts with WebGPU and falls back to WebAssembly when device: "auto" is selected. Browser training and Recall are not part of this alpha. See WebGPU Alpha.

Develop

git clone https://github.com/ragnarok-io/ARTI.git
cd ARTI
uv sync --extra dev
uv run --extra dev pytest
uv build

The test suite covers tensor shapes, masks, gradients, serialization, malformed artifacts, public API imports, and optional backend boundaries. Contribution guidance is in CONTRIBUTING.md.

Citation And Authorship

ARTI was initiated and designed by Thiocy. Citation metadata is provided in CITATION.cff. The project also documents authorship and AI assistance.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arti_fit-1.1.0.tar.gz (352.7 kB view details)

Uploaded Source

Built Distribution

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

arti_fit-1.1.0-py3-none-any.whl (201.8 kB view details)

Uploaded Python 3

File details

Details for the file arti_fit-1.1.0.tar.gz.

File metadata

  • Download URL: arti_fit-1.1.0.tar.gz
  • Upload date:
  • Size: 352.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arti_fit-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6f9360944358c110d6f811291fb06fde871e43e9ccd3e50599faee01c4f4bc92
MD5 08f7288b82bd5fcd5040a6e3237f91a4
BLAKE2b-256 57b8848016c60f9695dc4c34e1dbc9f39245a813f707ef9411784b1359e44908

See more details on using hashes here.

Provenance

The following attestation bundles were made for arti_fit-1.1.0.tar.gz:

Publisher: release.yml on ragnarok-io/ARTI

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

File details

Details for the file arti_fit-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: arti_fit-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 201.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arti_fit-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55d05d2a7183f723af8887ea5f16a74f05f3442ac8002a4a06e61304dd623f3f
MD5 614b86d6995c5d72251beb43351c1008
BLAKE2b-256 a757f64062bd79fd754e165e64a92c479ed0f33be52a83e24b9243f8c1cb37b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for arti_fit-1.1.0-py3-none-any.whl:

Publisher: release.yml on ragnarok-io/ARTI

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page