This release is a pre-release and may not be stable for production use.
ArcLM
ArcLM is a compact Python framework for causal language-model workflows. The
vNext direction is ArcLM-owned: model architecture, tokenizer contracts, model
loading, training, fine-tuning, runtime behavior, and .arcmodel artifacts are
defined by ArcLM rather than by Hugging Face Transformers.
PyTorch is currently used as the tensor/autograd/runtime backend. safetensors
is used for model and adapter tensor storage.
Install
pip install -e .
For development and documentation work:
pip install -e ".[dev]"
ArcLM supports Python >=3.9,<3.13.
Student / Lab API
from arclm import Lab
lab = Lab()
dataset = lab.dataset(text="alpha beta gamma delta alpha beta gamma delta")
model = lab.model(data=dataset, size="tiny")
history = lab.train(epochs=1, steps=1, shuffle=False)
Professional API
from arclm import Dataset, Model, Runtime, Tokenizer, Trainer
from arclm.training import FineTuningConfig, TrainingConfig
dataset = Dataset.load([{"text": "alpha beta gamma delta alpha beta gamma delta"}])
tokenizer = Tokenizer(strategy="word", max_vocab=16).build(dataset.text())
runtime = Runtime.auto(prefer="cpu")
model = Model.create(
architecture="arclm-native",
tokenizer=tokenizer,
runtime=runtime,
embed_dim=8,
block_size=4,
num_blocks=1,
)
config = TrainingConfig(epochs=1, steps_per_epoch=1, save_artifact=True, artifact_path="model.arcmodel")
history = Trainer(model=model, dataset=dataset, config=config, fine_tuning=FineTuningConfig(method="pretrain")).train()
Research API
from arclm.research import BaseStrategy, NextTokenLoss, TrainingConfig, Trainer
class MyLoss:
def __call__(self, *, model, batch, engine):
return NextTokenLoss()(model=model, batch=batch, engine=engine) * 0.5
strategy = BaseStrategy(name="half_loss", loss_function=MyLoss())
history = Trainer(model=model, dataset=dataset, config=TrainingConfig(epochs=1, steps_per_epoch=1), strategy=strategy).train()
Current Support
- Native compact causal language model architecture:
arclm-native-causal-lm. - Unified
Tokenizerfacade with native word and character engines. - Optional lazy SentencePiece tokenizer engine.
- ArcLM-owned training engine with deterministic per-epoch steps, validation, checkpoint/resume, callbacks, metrics, progress display, gradient accumulation, and early stopping.
- Full fine-tuning and native LoRA-style adapter fine-tuning.
.arcmodelmodel artifacts and.arcadapteradapter artifacts.- Three API levels over the same engine: Student, Professional, Research.
Planned
- Optional Hugging Face compatibility adapters.
- Additional ArcLM-native model families.
- ArcLM-native BPE, WordPiece, and Unigram tokenizer engines.
- Richer artifact migration/version policies.
Examples
The files in examples/ are executable and covered by tests:
01_student_lab.py02_professional_training.py03_lora_finetuning.py04_save_load_arcmodel.py05_research_custom_loss.py
Development
python -m pytest tests
python -m mkdocs build --strict
License
ArcLM is released under the Apache License 2.0.
Metadata
Release files for arclm 1.0.0rc1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arclm-1.0.0rc1.tar.gz | 84.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arclm-1.0.0rc1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 160.7 kB
Release files / arclm-1.0.0rc1.tar.gz
| Download URL | arclm-1.0.0rc1.tar.gz |
|---|---|
| Size | 84.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c172e1142c12404d95b4bd0e6c7395f15aa48be6c7fdffb51747bd274537b3b2
|
|
BLAKE2b-256 checksum How to use checksums |
6f04b21da63e93a3ebfa67f6f04f860f526338a3e011c0f7ac72c95ea85a2d26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / arclm-1.0.0rc1-py3-none-any.whl
| Download URL | arclm-1.0.0rc1-py3-none-any.whl |
|---|---|
| Size | 76.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c37a8c2180386719b6c398244ed71e0882ebc7ea71c4a0b2c2c6cb1b88cfbd6
|
|
BLAKE2b-256 checksum How to use checksums |
15b106c67ec80a62029c6a441ee942d0cc9aeefe9f08edf6f7d75257e19e84bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|