It is LFM2.5-350M with a rank-8 LoRA fine-tune, exported to 4-bit ONNX (289 MB) so it runs entirely in the browser on WebGPU. It was built for Voices in your head.
It is released under a research and artistic use license (see LICENSE); commercial use is not permitted.
English translations of two sets of private notebooks:
From these, 7,320 sentences were selected for training (4,493 Weil, 2,827 Camus), each turned into exactly one example: the first part of the sentence, lowercased and stripped of punctuation the way a speech recognizer would deliver it, paired with the sentence's intact ending of 8 to 24 words. Sentences addressing a listener ("you"), quotations, and anything that is mostly notation (Greek, page lists, formulas) were excluded. A further 952 sentences were held out for validation and 854 for test, in contiguous passage blocks. No training text is included in this repository. The translations remain under their own copyrights; the model is a derivative artifact, not a distribution of the books.
Prompted with a fragment, it returns one short continuation in the first person. The training target was the shape of a thought as it completes, not the content of the books: the app's recitation screen (exact 6-word target matches and 10-gram overlap against the source) found no matches on its probe set, though that is a screen, not a guarantee, and short phrases from the sources can certainly recur.
It is a 350M-parameter model, and behaves like one:
Two examples from the development probes:
I want to be honest with myself even when β I'm not honest with myself, even in the face of the injustice I have.
I used to mistake being busy for β the purpose of my work, and I was not working for the whole of my life.
The model expects the LFM2.5 chat template with this system prompt and user turn; it was trained without in-context examples.
system: You complete a speaker's thought at the cursor.
Output only the words that naturally come next, without repeating the original fragment.
Write in the first person, in the speaker's own voice, tense, perspective, and rhythm.
Never address the speaker or use "you"; the speaker is talking to themselves, not to you.
The examples show the format only. Never reuse their words or ideas; answer the current fragment freshly.
Infer a plausible intention from the available details and carry it somewhere specific or surprising.
When context permits, introduce one vivid detail, image, contrast, consequence, or connection.
Avoid bland endings such as generic agreement, importance, positivity, or "making things better."
Do not answer, explain, summarize, give advice, address the speaker, or behave like a chatbot.
Never mention AI, language processing, the model, or system limitations unless the speaker did.
Return one natural clause or compact sentence fragment, usually 6 to 14 words, and stop when the thought feels complete.
user: Text before cursor: <fragment, lowercase, no punctuation>
Text after cursor:
Generate at most 32 new tokens; the app stops at the first sentence end.
import { AutoTokenizer, AutoModelForCausalLM } from "@huggingface/transformers";
const id = "maxime/personal-notebooks-350m";
const tokenizer = await AutoTokenizer.from_pretrained(id);
// Transformers.js 4.2 does not strip the template's {%- generation -%} markers.
tokenizer.chat_template = tokenizer.chat_template.replace(
/(\s*){%(-?)\s*(?:end)?generation\s*(-?)%}(\s*)/g,
(_, before, l, r, after) => (l ? "" : before) + (r ? "" : after),
);
const model = await AutoModelForCausalLM.from_pretrained(id, {
dtype: "q4", device: "webgpu", use_external_data_format: true,
});
const inputs = tokenizer.apply_chat_template(messages, { add_generation_prompt: true, return_dict: true });
const out = await model.generate({ ...inputs, max_new_tokens: 32, do_sample: true, temperature: 0.62 });
| Base | LiquidAI/LFM2.5-350M |
| Method | LoRA rank 8, dropout 0.05, scale 20, all layers, prompt loss masked (MLX-LM 0.31) |
| Data | 7,320 fragment β ending pairs, max 512 tokens |
| Schedule | 1,800 steps at batch 4 (one epoch), learning rate 1e-4, seed 42 |
| Validation loss | 6.97 before training β 3.85 |
| Export | Liquid's onnx-export, Q4 weights, fused-graph check passed |
The released weights are the one-epoch checkpoint. Training ran on a single Apple M2 with a 2 GB peak allocation: the whole pipeline, from EPUB to browser, is small on purpose.
onnx/model_q4.onnx + onnx/model_q4.onnx_data: 4-bit weights, external data formatconfig.json, generation_config.json, tokenizer.json,
tokenizer_config.json, chat_template.jinja: unchanged from the base modelLICENSE: research and artistic use license for these weightsLICENSE-LFM: the LFM Open License v1.0 of the base model, which also appliesThe weights are released under the Research and Artistic Use License v1.0 (LICENSE): research, education, artistic and personal non-commercial use are permitted; commercial use is not, and output must not be attributed to the authors or translators. The base model's LFM Open License v1.0 (LICENSE-LFM) applies in addition.
4 commits
It is LFM2.5-350M with a rank-8 LoRA fine-tune, exported to 4-bit ONNX (289 MB) so it runs entirely in the browser on WebGPU. It was built for Voices in your head.
It is released under a research and artistic use license (see LICENSE); commercial use is not permitted.
English translations of two sets of private notebooks:
From these, 7,320 sentences were selected for training (4,493 Weil, 2,827 Camus), each turned into exactly one example: the first part of the sentence, lowercased and stripped of punctuation the way a speech recognizer would deliver it, paired with the sentence's intact ending of 8 to 24 words. Sentences addressing a listener ("you"), quotations, and anything that is mostly notation (Greek, page lists, formulas) were excluded. A further 952 sentences were held out for validation and 854 for test, in contiguous passage blocks. No training text is included in this repository. The translations remain under their own copyrights; the model is a derivative artifact, not a distribution of the books.
Prompted with a fragment, it returns one short continuation in the first person. The training target was the shape of a thought as it completes, not the content of the books: the app's recitation screen (exact 6-word target matches and 10-gram overlap against the source) found no matches on its probe set, though that is a screen, not a guarantee, and short phrases from the sources can certainly recur.
It is a 350M-parameter model, and behaves like one:
Two examples from the development probes:
I want to be honest with myself even when β I'm not honest with myself, even in the face of the injustice I have.
I used to mistake being busy for β the purpose of my work, and I was not working for the whole of my life.
The model expects the LFM2.5 chat template with this system prompt and user turn; it was trained without in-context examples.
system: You complete a speaker's thought at the cursor.
Output only the words that naturally come next, without repeating the original fragment.
Write in the first person, in the speaker's own voice, tense, perspective, and rhythm.
Never address the speaker or use "you"; the speaker is talking to themselves, not to you.
The examples show the format only. Never reuse their words or ideas; answer the current fragment freshly.
Infer a plausible intention from the available details and carry it somewhere specific or surprising.
When context permits, introduce one vivid detail, image, contrast, consequence, or connection.
Avoid bland endings such as generic agreement, importance, positivity, or "making things better."
Do not answer, explain, summarize, give advice, address the speaker, or behave like a chatbot.
Never mention AI, language processing, the model, or system limitations unless the speaker did.
Return one natural clause or compact sentence fragment, usually 6 to 14 words, and stop when the thought feels complete.
user: Text before cursor: <fragment, lowercase, no punctuation>
Text after cursor:
Generate at most 32 new tokens; the app stops at the first sentence end.
import { AutoTokenizer, AutoModelForCausalLM } from "@huggingface/transformers";
const id = "maxime/personal-notebooks-350m";
const tokenizer = await AutoTokenizer.from_pretrained(id);
// Transformers.js 4.2 does not strip the template's {%- generation -%} markers.
tokenizer.chat_template = tokenizer.chat_template.replace(
/(\s*){%(-?)\s*(?:end)?generation\s*(-?)%}(\s*)/g,
(_, before, l, r, after) => (l ? "" : before) + (r ? "" : after),
);
const model = await AutoModelForCausalLM.from_pretrained(id, {
dtype: "q4", device: "webgpu", use_external_data_format: true,
});
const inputs = tokenizer.apply_chat_template(messages, { add_generation_prompt: true, return_dict: true });
const out = await model.generate({ ...inputs, max_new_tokens: 32, do_sample: true, temperature: 0.62 });
| Base | LiquidAI/LFM2.5-350M |
| Method | LoRA rank 8, dropout 0.05, scale 20, all layers, prompt loss masked (MLX-LM 0.31) |
| Data | 7,320 fragment β ending pairs, max 512 tokens |
| Schedule | 1,800 steps at batch 4 (one epoch), learning rate 1e-4, seed 42 |
| Validation loss | 6.97 before training β 3.85 |
| Export | Liquid's onnx-export, Q4 weights, fused-graph check passed |
The released weights are the one-epoch checkpoint. Training ran on a single Apple M2 with a 2 GB peak allocation: the whole pipeline, from EPUB to browser, is small on purpose.
onnx/model_q4.onnx + onnx/model_q4.onnx_data: 4-bit weights, external data formatconfig.json, generation_config.json, tokenizer.json,
tokenizer_config.json, chat_template.jinja: unchanged from the base modelLICENSE: research and artistic use license for these weightsLICENSE-LFM: the LFM Open License v1.0 of the base model, which also appliesThe weights are released under the Research and Artistic Use License v1.0 (LICENSE): research, education, artistic and personal non-commercial use are permitted; commercial use is not, and output must not be attributed to the authors or translators. The base model's LFM Open License v1.0 (LICENSE-LFM) applies in addition.
4 commits