Skip to content

Repository files navigation

Aster — native PyTorch, from first principles to complete workflows

Understand the model. Own the training loop. Follow it into serving.

English · 简体中文
Quickstart · Learn · Algorithms & papers · Status & remaining work · Roadmap · Documentation · Contribute


Aster is a native PyTorch framework for studying and building connected ML workflows: models, objectives, training, compression, inference, agents, and evaluation. Read the equations in small implementation modules, test their behavior, then follow the same components into an end-to-end recipe.

v0.1.0 — First release. Explore the implementations and runnable examples below. APIs are experimental; see current status and the roadmap for supported features and remaining work.

Implemented paths Still to implement Still to verify Licensing and governance work
Native models/objectives, shared training, linear LoRA, supported serving and evaluation workflows Advanced adapters, broader parallel/serving combinations, remaining agent capabilities Multi-node GPU behavior, hardware performance, public pretrained quality License clearance, file-level source review, maintainer governance

Start here

Your goal Best entry point
Run something on a CPU Train and merge a tiny LoRA model
Understand the code, step by step Learning path: questions, files, experiments
Find an algorithm or its official source Algorithm map
Connect training to deployment Runnable workflow gallery
Check whether a feature fits your use case Current status, roadmap, and model details

A first experiment

With Python 3.11+ and a compatible PyTorch installation, clone the repository and enter its directory. If you already have a checkout, skip the first two commands:

git clone https://github.com/sutiankang/aster.git
cd aster
python -m pip install -e ".[test]"
python -m aster doctor
python examples/quickstart.py

This CPU example trains a tiny LoRA adapter, checks that the base weights remain unchanged, and compares merged and unmerged outputs. No model downloads, API credentials, or GPU are needed.

Want to read the implementation first? Follow LoRAsupervised lossTrainerthe test.

One connected stack

Models and objectives enter the shared trainer; artifacts connect compression, serving, and evaluation.

The shared contract is deliberately small: models compute tensors; objectives return loss sums and valid counts; the trainer owns updates and checkpoints; artifacts connect training, deployment, and evaluation.

Three examples show that connection:

Workflow What you can inspect Run from the repository root
LoRA → shared-base serving Adapter ownership, INT8 paged KV, host swap and cleanup python examples/online_adapter_stack.py --kv int8
Teacher → student → evaluation Training, distillation, immutable artifacts and a fixed evaluation protocol python -m aster run examples/recipes/language_chain.json --output runs/language-001 --store artifacts
Model → objective → update → merge The smallest complete fine-tuning loop python examples/quickstart.py

These examples use tiny models and synthetic data. They demonstrate executable workflows, not leaderboard quality or GPU throughput. The workflow gallery explains inputs, expected checks, and where to change the code.

What can I study or build?

Area Selected native implementations Explore
Language models GPT-2, Llama/Qwen families, DeepSeek MLA/MoE, Mamba and hybrid recurrent attention Models · attention map
Multimodal & action models CLIP/SigLIP, LLaVA, Qwen-VL, BLIP-2, OpenVLA, ACT and action-flow components Model boundaries · algorithms
Generative models DDPM/DDIM, EDM, flow matching, consistency, MeanFlow, Shortcut and Drifting components Methods · algorithms
World models & planning RSSM, PlaNet, JEPA/LeWM, MuZero and search/planning components Algorithms
Training & fine-tuning Shared multi-role trainer, LoRA, Muon, accumulation, EMA, checkpointing, supported parallel/ZeRO layouts Training · fine-tuning
RL & distillation DPO/IPO/SimPO, PPO/GRPO/RLOO, offline RL, token/feature/generative distillation Loss catalog · methods
Inference & agents Paging, prefix reuse, continuous batching, low-bit KV, speculative decoding, bounded tools and selected MCP capabilities Inference · agents
Evaluation Native metrics, fixed cohorts, optional official adapters, paired quality/resource comparisons Benchmarks

Each name has a specific implementation boundary. See the algorithm map for idea → code → test → primary source, and the capability manifest for finer-grained status.

Learn by changing one thing

The learning path starts with tensors and next-token prediction, then moves through LoRA, loss normalization, caching, generative objectives, and distributed training. Each stage includes a small experiment and an observable result.

Suggested first questions
  • Why does a zero-initialized LoRA B matrix preserve the base model?
  • Why is the sum of token losses divided by the total valid-token count?
  • When should cached decoding agree with a full-sequence forward pass?
  • Why can a frozen teacher still need gradients with respect to its input?
  • What changes when tensor parallelism, data parallelism, and ZeRO are composed?
  • Why does a faster approximate sampler still need a quality comparison?

Start with the guided answers and exercises, then open the linked implementation and test side by side.

Where Aster fits

Aster is useful when you want readable native implementations, explicit mathematical contracts, and connected experiments. Core runtime computation stays in this repository; official packages are optional reference/evaluation dependencies.

It is not a drop-in replacement guarantee for Transformers, Megatron, DeepSpeed, vLLM, or Codex. QLoRA, DoRA, rsLoRA and IA³ are not implemented. Multi-rank continuous HTTP serving, complete MCP coverage, broad hardware performance validation, and public pretrained-quality evidence remain work in progress. See the roadmap.

Reproduce, then extend

python tools/check_repository.py
python -m pytest tests/unit tests/integration -q
python -m pytest tests/distributed -q

Reference-source comparisons and CUDA cases have explicit extra requirements. Skips remain skips. See test tiers and benchmark protocols.

For contributions, start with a reproducible example, an independent correctness test, or a clearer explanation. Contributing · Support · Security · Code of conduct

If Aster helps you learn or build, consider giving it a star ⭐. It helps other learners discover the project.

Tell us which workflow you used. A useful example or a carefully explained failure is a valuable contribution.

Star History

Aster GitHub star history

Acknowledgements and license

Implementation references include Transformers, Megatron-LM, DeepSpeed, vLLM, and the algorithm authors linked in the source map. These references do not imply affiliation or endorsement.

A repository-wide license has not yet been granted. See NOTICE for third-party terms and the ongoing source review before reusing or redistributing code. Model weights and benchmark datasets are not included and have separate terms.

About

Learn and build modern AI in one native PyTorch stack: LLMs, VLM/VLA, diffusion & flow matching, world models, and agents—with LoRA, RL post-training, distillation, distributed training, and inference.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages