documentlanguagemodel Public
Install
DocumentLanguageModel is a Python package. It depends on torch (GPU or
CPU build), transformers, peft, trl, and — optionally for export —
the ollama binary on your PATH.
Prerequisites
| Requirement | Minimum | Notes |
|---|---|---|
| Python | 3.11 | pyproject.toml pins python >= 3.11. |
| uv | any recent | Used for dependency resolution and running scripts. |
| PyTorch | 2.4+ | Installed automatically by uv sync. |
| Ollama | as reported by dlm doctor |
Only needed for dlm export smoke runs. |
vendor/llama.cpp submodule |
built | Only needed for dlm export. scripts/bump-llama-cpp.sh build compiles llama-quantize + llama-imatrix. |
On Apple Silicon, MPS acceleration is detected automatically and DLM plans for fp16 LoRA. On CUDA, compute capability ≥ 8.0 (Ampere and newer) unlocks bf16 + QLoRA 4-bit. See Architecture for the full refusal matrix.
Install from source
git clone https://github.com/tenseleyFlow/DocumentLanguageModel.git
cd DocumentLanguageModel
uv sync
uv run dlm --help
uv sync resolves the dependency tree into .venv/ and pulls the
pinned versions from uv.lock. Use uv run dlm <command> (not
dlm <command> — the CLI isn't on your shell PATH unless you activate
the venv).
Install from PyPI
# Coming with v1.0 — the tagged release workflow publishes to PyPI via
# trusted-publisher OIDC. Until then, install from source.
pip install dlm
Verify
$ uv run dlm --version
dlm 0.1.0
$ uv run dlm doctor
backend: mps
precision: fp16
attn: sdpa
...
dlm doctor is the first command to run on a new machine. It probes
the GPU, reports the memory budget, picks a training plan, and warns
about anything missing (e.g. FlashAttention unavailable, bitsandbytes
not importable on CPU-only hosts).
Next
Got dlm doctor output that looks healthy? Move on to the
first training cycle.
View source
| 1 | # Install |
| 2 | |
| 3 | DocumentLanguageModel is a Python package. It depends on `torch` (GPU or |
| 4 | CPU build), `transformers`, `peft`, `trl`, and — optionally for export — |
| 5 | the `ollama` binary on your PATH. |
| 6 | |
| 7 | ## Prerequisites |
| 8 | |
| 9 | | Requirement | Minimum | Notes | |
| 10 | |---|---|---| |
| 11 | | Python | 3.11 | `pyproject.toml` pins `python >= 3.11`. | |
| 12 | | [uv](https://github.com/astral-sh/uv) | any recent | Used for dependency resolution and running scripts. | |
| 13 | | PyTorch | 2.4+ | Installed automatically by `uv sync`. | |
| 14 | | Ollama | as reported by `dlm doctor` | Only needed for `dlm export` smoke runs. | |
| 15 | | `vendor/llama.cpp` submodule | built | Only needed for `dlm export`. `scripts/bump-llama-cpp.sh build` compiles `llama-quantize` + `llama-imatrix`. | |
| 16 | |
| 17 | On Apple Silicon, MPS acceleration is detected automatically and DLM |
| 18 | plans for fp16 LoRA. On CUDA, compute capability ≥ 8.0 (Ampere and |
| 19 | newer) unlocks bf16 + QLoRA 4-bit. See [Architecture](../architecture.md) |
| 20 | for the full refusal matrix. |
| 21 | |
| 22 | ## Install from source |
| 23 | |
| 24 | ```sh |
| 25 | git clone https://github.com/tenseleyFlow/DocumentLanguageModel.git |
| 26 | cd DocumentLanguageModel |
| 27 | uv sync |
| 28 | uv run dlm --help |
| 29 | ``` |
| 30 | |
| 31 | `uv sync` resolves the dependency tree into `.venv/` and pulls the |
| 32 | pinned versions from `uv.lock`. Use `uv run dlm <command>` (not |
| 33 | `dlm <command>` — the CLI isn't on your shell PATH unless you activate |
| 34 | the venv). |
| 35 | |
| 36 | ## Install from PyPI |
| 37 | |
| 38 | ```sh |
| 39 | # Coming with v1.0 — the tagged release workflow publishes to PyPI via |
| 40 | # trusted-publisher OIDC. Until then, install from source. |
| 41 | pip install dlm |
| 42 | ``` |
| 43 | |
| 44 | ## Verify |
| 45 | |
| 46 | ```sh |
| 47 | $ uv run dlm --version |
| 48 | dlm 0.1.0 |
| 49 | |
| 50 | $ uv run dlm doctor |
| 51 | backend: mps |
| 52 | precision: fp16 |
| 53 | attn: sdpa |
| 54 | ... |
| 55 | ``` |
| 56 | |
| 57 | `dlm doctor` is the first command to run on a new machine. It probes |
| 58 | the GPU, reports the memory budget, picks a training plan, and warns |
| 59 | about anything missing (e.g. FlashAttention unavailable, bitsandbytes |
| 60 | not importable on CPU-only hosts). |
| 61 | |
| 62 | ## Next |
| 63 | |
| 64 | Got `dlm doctor` output that looks healthy? Move on to the |
| 65 | [first training cycle](first-train.md). |