Skip to main content

How-Agentic: a tutorial-first framework for training a small agent model from scratch

Project description

How-Agentic

How-Agentic is a tutorial-first framework for training a small agent model from scratch.

The current release is the M0 closed-loop baseline. It is intentionally small and practical: the goal is to make the full path reproducible before moving on to more agentic behavior training.

tokenizer -> pretrain -> format-only SFT -> export -> infer -> HuggingFace-compatible export

M0 Status

M0 is complete and frozen.

  • Pretrained checkpoint: out/hello_agent_100m/pretrain/final.pt
  • SFT checkpoint: out/hello_agent_100m/sft/final.pt
  • Tokenizer: tokenizers/hello-agent-16k
  • Pretrain data: data/demo/pretrain_100k.jsonl
  • SFT data: data/demo/m0_sft_format_500.jsonl
  • Pretrain infer mode: completion
  • SFT infer mode: chat

Model checkpoints and datasets are not included in the PyPI package.

Install

Minimal CLI install:

pip install how-agentic

M0 training environment, verified on Python 3.12 + CUDA 12.4:

pip install -r requirements/m0-py312-cu124.txt
pip install -e . --no-deps

Or with uv:

uv venv .venv --python 3.12
uv pip install -r requirements/m0-py312-cu124.txt
uv pip install -e . --no-deps

CLI

python -m how_agentic.cli --help

or:

how-agentic --help

M0 Quick Path

Train tokenizer:

python -m how_agentic.cli train-tokenizer \
  --data data/demo/pretrain_100k.jsonl \
  --output tokenizers/hello-agent-16k \
  --vocab-size 16000

Pretrain:

python -m how_agentic.cli train \
  --config configs/hello_agent_pretrain_100k.yaml

Export pretrained model:

python -m how_agentic.cli export \
  --checkpoint out/hello_agent_100m/pretrain/final.pt \
  --output models/hello_agent_100m_native

Infer with pretrained model:

python -m how_agentic.cli infer \
  --model models/hello_agent_100m_native \
  --prompt "Once upon a time" \
  --mode completion \
  --max-tokens 50 \
  --temperature 0

Build M0 format-only SFT data:

python scripts/build_m0_format_sft_dataset.py \
  --output data/demo/m0_sft_format_500.jsonl \
  --total 500 \
  --seed 42

Run M0 SFT:

python -m how_agentic.cli train \
  --config configs/hello_agent_sft.yaml

Export SFT model:

python -m how_agentic.cli export \
  --checkpoint out/hello_agent_100m/sft/final.pt \
  --output models/hello_agent_100m_sft_native

Infer with SFT model:

python -m how_agentic.cli infer \
  --model models/hello_agent_100m_sft_native \
  --prompt "What is the capital of France?" \
  --mode chat \
  --max-tokens 80 \
  --temperature 0

Expected shape:

<answer>
The capital of France is Paris.
</answer>

Docs

Quickstart:

docs/quickstart.md

M0 reproduction:

docs/m0-reproduction.md

CLI reference:

docs/cli-reference.md

Configuration guide:

docs/configuration.md

Roadmap:

docs/roadmap.md

Publishing:

docs/publishing.md

Package Boundary

PyPI contains the framework code and CLI.

The following are intentionally kept outside the wheel:

  • checkpoints
  • exported models
  • tokenizer artifacts
  • training data
  • logs
  • local caches

Use HuggingFace Hub for model weights and GitHub for reproducibility docs, configs, scripts, and tests.

License

This project is licensed under CC BY-NC-SA 4.0.

Attribution is required, commercial use is not allowed, and derivative works must use the same license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

how_agentic-0.1.0.tar.gz (89.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

how_agentic-0.1.0-py3-none-any.whl (78.3 kB view details)

Uploaded Python 3

File details

Details for the file how_agentic-0.1.0.tar.gz.

File metadata

  • Download URL: how_agentic-0.1.0.tar.gz
  • Upload date:
  • Size: 89.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for how_agentic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c0253358f57ee4baca705089570858422ef7087f77f54bd5a74017ddfddf9a1d
MD5 3be60e2ef7ac78c1666145861209a91b
BLAKE2b-256 101078ad06e9f3e91c47401a8093b3588f5096414f8420cffd32ce657a4144be

See more details on using hashes here.

File details

Details for the file how_agentic-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: how_agentic-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 78.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for how_agentic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aed86d3872783e8a4bf901d346ccfa83d3f039d169d9074e4d39631e8d5e548d
MD5 a3e8cbdbbe4aa444faebc91e030f3299
BLAKE2b-256 0093f9c288f7679e2468e35bfdc15f025273e8f75d74a7bebbf2082b39232fe6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page