Skip to main content

LaMoTO: Language Modelling Tasks as Objects

Language Modelling Tasks as Objects (LaMoTO) provides a framework for language model training (masked and causal, pretraining and finetuning) where the tasks, not just the models, are classes themselves. It abstracts over the HuggingFace transformers.Trainer with one goal: reduce the entire model training process to a single method call task.train(hyperparameters).

pip install lamoto[all]

Note: to be able to use the W&B integration, make sure you first run wandb login in a command-line terminal on the system you want to run on.

Usage

Let's say you want to train a RoBERTa-base model for dependency parsing (for which, by the way, there is no HuggingFace class). This is how you would do that in LaMoTO, supported by the magic of ArchIt:

from archit.instantiation.basemodels import RobertaBaseModel
from archit.instantiation.heads import DependencyParsingHeadConfig, BaseModelExtendedConfig
from lamoto.tasks import DP
from lamoto.training.auxiliary.hyperparameters import getDefaultHyperparameters

# Define task hyperparameters.
hp = getDefaultHyperparameters()
hp.model_config_or_checkpoint = "roberta-base"
hp.archit_basemodel_class = RobertaBaseModel
hp.archit_head_config = DependencyParsingHeadConfig(
    head_dropout=0.33,
    extended_model_config=BaseModelExtendedConfig(
        layer_pooling=1
    )
)

# Instantiate language modelling task as object, and train model.
task = DP()
task.train(hyperparameters=hp)

Features

  • Train models on >15 pre-training/fine-tuning tasks. See a list by importing from lamoto.tasks.
    • Model architectures come from ArchIt, which means that as long as you have a BaseModel wrapper for your language model backbone, you can train it on any task, regardless of whether you wrote code defining the backbone-with-head architecture required for that task.
    • Custom (i.e. given) architectures are also supported.
  • Evaluate models with a superset of the metrics in HuggingFace's evaluate, with custom inference procedures (see e.g. strided pseudo-perplexity or bits-per-character).
  • Augment datasets before training or evaluating by somehow perturbing them.
  • Supports TkTkT tokenisers.
  • W&B integration.

Alternative packages

There exist other libraries that abstract across training tasks in an effort to avoid heavily dedicated training scripts. I'm aware of the following packages (although I'm not sure how extensible they are):

Metadata

Release files for lamoto 2026.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lamoto 2026.10.0
File Size Uploaded Provenance
lamoto-2026.10.0.tar.gz 111.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lamoto 2026.10.0
File Interpreter ABI Platform
lamoto-2026.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 247.7 kB

Release files / lamoto-2026.10.0.tar.gz

Download URL lamoto-2026.10.0.tar.gz
Size 111.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ffec8707692a131734ac09cb93c08aa293eb57aa7e120532d89432bd9c41e320
BLAKE2b-256 checksum
How to use checksums
27d4c273f4abdc1fc07a762b9ea2911f456a30163b0a017f38ec34e587a338ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":true,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.13.16"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.13.16","system":{"name":"Linux","release":"6.17.0-1022-azure"}} HTTPX2/2.16.0

Release files / lamoto-2026.10.0-py3-none-any.whl

Download URL lamoto-2026.10.0-py3-none-any.whl
Size 136.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9544b6a65d869484eaa6fc9c1fbb25d3d4d3a22d1e052333923ecad5d49cced6
BLAKE2b-256 checksum
How to use checksums
83848d94fc956661c426470a5ed54cce22a5da034e2ad05ef9ba84b7873e5137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":true,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.13.16"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.13.16","system":{"name":"Linux","release":"6.17.0-1022-azure"}} HTTPX2/2.16.0

Security for lamoto 2026.10.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page