HTLM (HyperText Language Model) is a fine-tuned
LFM2.5-350M that predicts web UI actions —
click,
type,
select — on an indexed element list, entirely in-browser via
wllama WebAssembly.
Evaluated on 408 held-out tasks from
Mind2Web. Full evaluation details:
docs/go-no-go-checklist.md.
HTLM takes a structured page representation (element list with role/tag/text) and an instruction, and predicts {type, index, [value]}. The element index refers to the candidate list derived from the page HTML.
1import { Wllama } from '@wllama/wllama';
2
3const wllama = new Wllama({ default: './wllama.wasm' });
4await wllama.loadModelFromHF({
5 repo: 'espetro/htlm-lfm2.5-350m',
6 file: 'htlm-350m-q8.gguf',
7});
8
9const result = await wllama.createCompletion({
10 prompt: JSON.stringify({
11 instruction: "Click the submit button",
12 page: { elements: [{role:"button",tag:"button",text:"Submit"}] },
13 }),
14 max_tokens: 128,
15});
1from mlx_lm import load, generate
2model, tokenizer = load('espetro/htlm-lfm2.5-350m')
3# LoRA merge required first — see GitHub repo
Fine-tuned via LoRA (rank 16) on Mind2Web using the mlx-lm / Unsloth-compatible API on Apple Silicon. Full pipeline, hyperparameters, and reproducibility steps:
docs/pipeline.md.