Skip to main content

Umbrellm

A small language model framework that lets you train and run your own decoder-only transformer locally.

Overview

Umbrellm is a language model implementation written in Python and PyTorch. The default model configuration uses 12 transformer layers, 8 attention heads, and a hidden size of 512 dimensions, resulting in roughly 20 million parameters.

The goal of the project is to provide an implementation that is easy to understand and modify. It includes the components needed to train a model from scratch, prepare datasets, run inference, and expose the model through a simple API.

The architecture uses:

  • Rotary Position Embeddings (RoPE)
  • SwiGLU feed-forward activations
  • RMSNorm
  • Causal multi-head self-attention

Features

  • Train models from scratch using your own datasets
  • Save and resume training from checkpoints
  • Learning rate scheduling and gradient clipping
  • Optional mixed-precision training
  • BPE tokenizer training on custom corpora
  • Dataset compilation using the .ullm format
  • Text generation with temperature, top-k, top-p, and repetition penalty controls
  • Token-by-token streaming generation
  • FastAPI-based REST API server

Quick start

pip install torch fastapi uvicorn

python scripts/compile_dataset.py
python scripts/train.py --epochs 3
python scripts/inference.py --interactive

Python SDK

import umbrellm

umbrellm.utllm.compile()
umbrellm.training.train({"epochs": 3})

response = umbrellm.generate("Explain black holes simply.")
print(response)

Requirements

  • Python 3.9 or newer
  • PyTorch 2.0 or newer
  • FastAPI and uvicorn (only required for the API server)

License

Released under the MIT License.

Metadata

Release files for umbrellm 0.1.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 umbrellm 0.1.0
File Size Uploaded Provenance
umbrellm-0.1.0.tar.gz 20.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 44.1 kB

Release files / umbrellm-0.1.0.tar.gz

Download URL umbrellm-0.1.0.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8ac5ff402cd3d4d2b8f752e04c57f45dca2bd954c32f2f53a43588ba8d727137
BLAKE2b-256 checksum
How to use checksums
9043e2285c13fc0fda3582450799c604c1d257d1918d57e60ffd294dff901c38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / umbrellm-0.1.0-py3-none-any.whl

Download URL umbrellm-0.1.0-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23dfb2381977f1ea6caf37a1417bbea74b3cb06790351af40b1be14a42026b14
BLAKE2b-256 checksum
How to use checksums
bbc5287ff71b1cb675a7eab0af57f52f966783ca68b5df6dcceaa9508875e791
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for umbrellm 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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