ARTI
AI x RT: composable latent tensor dynamics for PyTorch.
ARTI is a domain-independent neural-network library for transforming hidden tensors at runtime. It provides versioned components for activation, compact workspaces, Recall, Formula execution, reversible topology, persistent tensor operations, and model attachment.
tensor input -> ARTI layer or mechanism -> tensor output
ARTI does not prescribe a tokenizer, task head, dataset, model family, or training loop. Applications decide what a tensor means; ARTI supplies reusable ways to observe, route, transform, remember, and compose it.
Install
The PyPI distribution is arti-fit; the Python package is arti:
uv add "arti-fit==3.0.11"
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.
Optional integrations are installed only when needed:
uv add "arti-fit[jax]==3.0.11"
uv add "arti-fit[qwen]==3.0.11"
uv add "arti-fit[sd]==3.0.11"
uv add "arti-fit[web]==3.0.11"
The browser runtime remains a separate alpha package:
pnpm add @arti-fit/web@alpha
Stable 3.0.11
arti.ARTILayer is now arti/layer@2: a tensor-in/tensor-out host for one
composable AdaptivePulse graph. An empty graph is an exact identity, so a
layer can be inserted before an application chooses its mechanisms.
import torch
import arti
x = torch.randn(2, 16, 64)
layer = arti.ARTILayer()
y = layer(x)
assert torch.equal(x, y)
assert arti.component_ref(layer) == "arti/layer@2"
Build a layer from ordinary ARTI modules:
pulse = arti.mechanisms.AdaptivePulse(
half=arti.Half(stochastic=False, learnable=True),
)
layer = arti.ARTILayer(pulse)
y, info = layer(x, return_info=True)
The public namespaces have explicit roles:
artiandarti.torch: stable high-level PyTorch APIs.arti.nn: practical standalone tensor layers and explicit layer profiles.arti.mechanisms: stable, versioned composition/runtime mechanisms.arti.legacy: the retired monolithicARTILayer@1,LayerRecall, andStatefulRecall, retained for historical artifact inspection.arti.experimental: integrations that are still experimental; currently the Python-first Web exporter.
arti.alpha remains a compatibility name for arti.mechanisms; new code should
use the stable namespace.
Attach To A Model
Attach an AdaptivePulse-backed layer to selected tensor boundaries without changing the host model class:
import arti
pulse = arti.mechanisms.AdaptivePulse(
half=arti.Half(stochastic=False, learnable=True),
)
layer = arti.ARTILayer(pulse)
model = arti.ARTI.attach(
model,
layer,
layers="model.layers.*",
)
print(model.arti.summary())
model.arti.save("assistant.arti.st")
Reload into a fresh host or remove the attached layers:
restored = arti.ARTI.load(fresh_model, "assistant.arti.st", layer=layer)
restored = restored.arti.detach()
Attachment preserves the host model type and arbitrary tensor trees. Boundary values are packed for ARTI execution and restored to their original rank, layout, dtype, and position. See Unified Attachment.
Mechanism Map
| Need | API |
|---|---|
| Same-shape survival pressure | arti.Half |
| Soft learned workspace compaction | arti.nn.Fold |
| Trainable learned expansion | arti.nn.UnFold |
| Reversible active/folded topology | arti.mechanisms.Fold, arti.mechanisms.UnFold |
| Compact learned pulse workspace | arti.Pulse |
| Composable bounded execution graph | arti.mechanisms.AdaptivePulse |
| K-wide Recall with hard winner | arti.nn.Recall |
| Iterative hidden-state refinement | arti.RecallRefiner |
| Typed Formula programs | arti.mechanisms.FormulaFabricV2 |
| Addressable forward Bank updates | arti.mechanisms.TargetBankUpdater |
| Shape-autonomous Bank hierarchy | arti.mechanisms.FederalRecall |
| Persistent auxiliary tensor editing | arti.mechanisms.TensorOperationLoop |
All mechanisms remain independently usable. Coordinates, masks, visibility, Observation, Recall, Formula, Fold, and tensor operations are not mandatory parts of one monolithic architecture.
Recall
New arti.nn.Recall modules use arti/recall@4. One query can preserve K
candidate routes, refine them independently, and forward exactly one hard
winner. Weighted merging is opt-in.
recall = arti.nn.Recall(dim=768, slots=64) # portable default K=8
next_state = recall(x)
wide = arti.nn.Recall(dim=768, slots=64, breadth=16, group_topk=16)
next_state, branches = wide(x, return_branches=True)
next_state = wide(x, active_k=4)
Eight is the portable default; 8-32 is a useful starting range when Bank
capacity and runtime budget allow. breadth=1 executes one candidate.
Runtime refine depth is explicit and may be adjusted without rewriting an artifact:
arti.set_recall_refine_steps(model, 10, min_steps=2, tolerance=0.003)
arti.set_recall_refine_schedule(
model,
{
"model.layers.0": 2,
"model.layers.1": 6,
"model.layers.2": 12,
},
)
Formula And Federal Banks
Formula Fabric executes bounded, typed tensor programs with declared operands, shapes, route sources, and output contracts. Built-in atoms include ordinary tensor transforms as well as Fabric-native Fold and UnFold operations.
Federal Banks can carry their own sealed Query, Formula program, local Refine policy, and terminal ABI. A Bank may change its tensor shape internally and re-query after every local step; it leaves the Bank only after producing a value accepted by the shared terminal contract. This separates federation depth from Bank-local computation depth.
See Formula Fabric and Federal Contracts.
Operable Tensors
The tensor-operation API supplies a default-backed, hot-swappable auxiliary tensor port. Reader Refine and tensor operations consume the same call-boundary snapshot in parallel. Operations can address ranges or sparse index maps of an arbitrary-rank logical tensor; proposals become visible after the caller advances the port for a later invocation.
See Operable Tensor Port.
Artifacts
arti.save() and arti.load() store model state in SafeTensors with separate
architecture metadata and SHA-256 locks. Component identities and artifact
schemas are versioned independently from the package version.
Recall Bank artifacts record the host, reader, Formula, optional Updater, Bank layout, dtype, shapes, provenance, and tensor hashes. Named compatible Banks can be composed without silently changing their source identity.
See Recall Artifacts and Component Provenance.
Documentation
- Stable Release Surface
- Unified Attachment
- Adaptive Observation
- Reversible Topology
- Formula Fabric
- Federal Contracts
- Batched Refine
- Flattened Refine Training
- Refine Exit
- Operable Tensor Port
- WebGPU Alpha
Development
uv sync --locked --extra dev
uv run --extra dev pytest
uv build
uv run --extra dev python scripts/check_package.py
Public CI runs Python 3.10, 3.11, and 3.12, the optional JAX contract suite, the Python-owned Web artifact generator, and the TypeScript browser runtime.
Scope
Stable means the documented component identities, tensor contracts, artifact formats, and composition semantics are reviewed and release-gated. It does not claim universal downstream superiority, a production service SLA, full JAX parity, or WebGPU training.
ARTI is licensed under the MIT License. Citation metadata is in
CITATION.cff.
中文简介
ARTI 是一个领域无关、PyTorch-first 的可组合张量动力学基础库。3.0.11
将 AdaptivePulse 设为默认 ARTILayer 的执行图,并把经过版本化和验证的
Recall、Formula、Fold/UnFold、Bank、Observation、TensorOperation 与
Federal Bank 机制提升为稳定 API。应用负责张量的业务语义,ARTI 负责张量
的观察、路由、变换、记忆与组合。
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arti_fit-3.0.11.tar.gz.
File metadata
- Download URL: arti_fit-3.0.11.tar.gz
- Upload date:
- Size: 993.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4583e98758962eeb867fda27ffa52ad846944c0b4c1eec71cbd0ab41e88c7a45
|
|
| MD5 |
4b251d6eb7235ccba5388a0d15d290a9
|
|
| BLAKE2b-256 |
2a3b23e676b89af783ddfea7508e25c904574faf2be74f2463f6dd5f2718dbce
|
Provenance
The following attestation bundles were made for arti_fit-3.0.11.tar.gz:
Publisher:
release.yml on ragnarok-io/ARTI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arti_fit-3.0.11.tar.gz -
Subject digest:
4583e98758962eeb867fda27ffa52ad846944c0b4c1eec71cbd0ab41e88c7a45 - Sigstore transparency entry: 2669820618
- Sigstore integration time:
-
Permalink:
ragnarok-io/ARTI@c009027e843e11ab06d7d55ce43db0c8e041821b -
Branch / Tag:
refs/tags/v3.0.11 - Owner: https://github.com/ragnarok-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c009027e843e11ab06d7d55ce43db0c8e041821b -
Trigger Event:
push
-
Statement type:
File details
Details for the file arti_fit-3.0.11-py3-none-any.whl.
File metadata
- Download URL: arti_fit-3.0.11-py3-none-any.whl
- Upload date:
- Size: 666.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eae635d172b56924bff839894f5795aea599d80057182061c3cb5f1550f09204
|
|
| MD5 |
f11c84b30468cae86e20d8a36db6fcb2
|
|
| BLAKE2b-256 |
fc1ca445dc5f15b5036cd1931625079b22ae1ea7c9ca89e102276ef960ae97c7
|
Provenance
The following attestation bundles were made for arti_fit-3.0.11-py3-none-any.whl:
Publisher:
release.yml on ragnarok-io/ARTI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arti_fit-3.0.11-py3-none-any.whl -
Subject digest:
eae635d172b56924bff839894f5795aea599d80057182061c3cb5f1550f09204 - Sigstore transparency entry: 2669820626
- Sigstore integration time:
-
Permalink:
ragnarok-io/ARTI@c009027e843e11ab06d7d55ce43db0c8e041821b -
Branch / Tag:
refs/tags/v3.0.11 - Owner: https://github.com/ragnarok-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c009027e843e11ab06d7d55ce43db0c8e041821b -
Trigger Event:
push
-
Statement type: