Method
An open base model, retrained on the written language of his world, taught to converse in his voice, given a base of checked facts to consult before answering — and examined with questions whose answers were prepared in advance.
Margarit is a small language model (SmolLM3-3B) trained to speak as Josep de Margarit i de Biure, a Catalan nobleman of the 17th century. Born in 1602 at Castell d'Empordà, he was chosen as military leader in October 1640, went to the court of Louis XIII in the autumn of 1641, served as governor general of Catalonia and left Barcelona in October 1652 for exile in France. Here he speaks as if it were July 1685.
An open model of 3 billion parameters. In a preliminary trial with the same character data it was the base that stated the fewest false facts about Margarit's life (8 answers with a false fact out of 102, against 21 and 14 for two other open bases), the one that showed the least modern knowledge (in 28% of modern probes, against 44% and 53%), and 1.9 times faster per token than the Gemma model tested — so cheaper to train and to serve. The price accepted: it started furthest from period Spanish.
Every weight was trained — not an adapter — for one full epoch over the corpus described below: 477.8 million distinct tokens; with period Spanish read twice and the texts by and about Margarit four times, the epoch came to 502.1 million tokens, 3,830 steps of 64 sequences of 2,048 tokens. On held-out period Spanish, the model's bits per byte (lower means it predicts the text better) fell from 1.188 to 0.907.
The retrained model was then tuned, again every weight, for two epochs on 13,469 conversations and question-and-answer examples: 1,116 long conversations with varied interlocutors, 239 conversations in which he is contradicted and has to explain himself or correct a mistake, 134 episodes of his life told in the first person and 466 questions about them, 3,885 question-and-answer pairs on the knowledge of his time, and part of an earlier round of in-character pairs. This material was generated with Claude Haiku from source sheets, checked by program against his biography and reviewed again by Claude Haiku; a conversation was cut at its first faulty turn.
A model of this size cannot hold thousands of facts reliably, so before each answer it is given «Notes» from a base of fact cards (step 06). A further round of two epochs taught it to use them: 4,320 examples, 12,959 turns, 11,268 of them with notes. Claude Haiku rewrote every answer to use a note when it answers the question and to ignore it when it does not — 12% of the turns deliberately carried notes from a different question — and answers with a figure found neither in the question, the notes nor his biography were discarded by program.
The published version (version 8) adds one more round on top of the previous one. This time not every weight was trained: a small adapter (LoRA, 30.2 million trainable weights) was trained for three epochs on 4,879 examples and then merged into the model. The examples include questions that hide a false premise about his life or his time — the questions written with Qwen3.6-35B-A3B, an open model run locally, and each answer built by program from templates and the fact cards: it denies the premise and gives the correct fact — together with control questions whose premise is true; earlier answers rewritten with Qwen3.6-35B-A3B where the checked cards had corrected a fact; and 954 short questions and answers about his own life, up to ten ways of asking about each of the 101 cards on his life, so that he carries those facts in his weights and not only in the notes. Those 954 were generated with Claude Haiku, checked by program and reviewed one by one by Claude Opus.
The question is searched by words (BM25 ranking) in an index of 4,016 verified fact cards: 101 about his life and the rest about his period. The search also weighs your previous question and his last answer, so a follow-up such as «and then what happened?» stays on topic. The best matches — in the demo at most three cards, 1,100 characters in all, without repeating cards already given earlier in the conversation — are placed after the question as «Notes». If no card is relevant enough, nothing is added. The notes can be opened under each answer.
All 4,158 cards went through two independent reviews — Claude Sonnet and Claude Opus, in opposite order, neither seeing the other. A card counted as verified only when both reached the same final text; every disagreement went to an arbiter (Claude Opus) that read the full source passage. Every batch hid controls — copies of good cards with one fact altered (a year, a number, a kinship), known errors and known false alarms — and a batch that missed a single control was redone entirely. Doubts about his own biography were decided by a person. Result: 4,016 cards kept, 142 removed.
216 questions, each with its answer prepared in advance and checked against the cards: his life (73), his period (88), questions the cards cannot answer, where he must not invent (27), modern topics he cannot know (15), and questions with a false premise he should correct (13). The examiner only judges whether an answer is close enough to the prepared one. Every version of the model sits the same exam.
For the last round more questions were added: 80 with a false or a true premise (40 and 40), kept out of training like every exam question, and two exams built for version 8, one on his life (162 questions) and one on everything else (172). Without repetitions, 334 distinct questions.
The corpus
6,672 works, 282.6 million words: Castilian written up to 1700, and Catalan works and works in other languages translated into Castilian. Only transcriptions and OCR text scoring at least 90% on quality checks were used; weaker scans were set aside, duplicates removed and old spelling left as it was.
| Source | Works | Tokens (M) | Read |
|---|---|---|---|
| Castilian texts, not machine-translated — 44.6% of the epoch | |||
| Period Spanish (curated collection) | 1,639 | 24.9 | ×2 |
| Texts by and about Margarit | 16 | 0.14 | ×4 |
| Medieval Castilian (before 1550) | 637 | 71.4 | ×1 |
| Castilian 1550–1700 | 265 | 75.3 | ×1 |
| Existing Castilian translations of Latin works | 188 | 21.5 | ×1 |
| Castilian texts from Catalonia (originals and existing translations) | 24 | 5.5 | ×1 |
| Translated into Castilian by a language model (Claude Haiku) — 55.4% of the epoch | |||
| English books (EEBO-TCP) | 2,307 | 128.1 | ×1 |
| Acta Sanctorum (Latin) | 21 | 43.9 | ×1 |
| Catalan works, extended catalogue | 134 | 14.5 | ×1 |
| Catalan | 30 | 5.4 | ×1 |
| Portuguese | 14 | 1.0 | ×1 |
| Italian | 350 | 23.9 | ×1 |
| French | 430 | 14.3 | ×1 |
| German | 469 | 22.9 | ×1 |
| Latin | 148 | 24.9 | ×1 |
| Total | 6,672 | 477.8 | 502.1 per epoch |
Results
Measured on 28 October 2026 on the 334 distinct questions, under the conditions of use of our desktop app: with the notes, the same prompt and the same settings. The answers were marked by Claude against the prepared ones and audited under a single criterion.
| Version | Correct, of 334 |
|---|---|
| Version 3 (the previous one) | 280 (83.8%) |
| Version 7 | 299 (89.5%) |
| Version 8 (published) | 299 (89.5%) |
The gain over version 3 comes from false premises: version 8 handled 68 of 73, against 38 — in 11 of those 68 it only says that it was not so, without giving the correct fact. Its weak point: on questions the cards cannot answer and on modern topics it avoided inventing in 26 of 42, against 35 for version 3 and 32 for version 7.
These figures were measured with the 8-bit MLX version of each model on a Mac and with the app's check, which regenerates an answer once when it names something not found in the notes. The demo runs the same weights in 16-bit (bf16) precision and without that check.
How the demo works
The page is served by Cloudflare Pages. When you start a conversation, a Cloudflare Pages Function checks a Turnstile challenge and the daily limits and passes your question to a GPU on RunPod Serverless. No GPU is kept running: one is started on demand and switches itself off when nobody is using it — which is why starting can take a while; the line at the top of the conversation shows each stage and the seconds elapsed. The model runs there in 16-bit (bf16) precision.
The server keeps no conversation: the page sends the last 3 turns back with each question. Web search uses our own search engine, an instance of the open-source metasearch engine SearXNG running alongside the model, which reads the pages without a browser.
Who did what
The translations into Castilian and the conversational training data were generated with Claude Haiku; the fact cards were checked by Claude Sonnet and Claude Opus; the exam was prepared with Claude, and its answers were marked by Claude; the false-premise questions and the rewritten answers of the last round were generated with Qwen3.6-35B-A3B, and the questions about his life with Claude Haiku, reviewed by Claude Opus. The choices, the checks by program and the decisions on his biography are ours.
Work with Nakrul
Tell us what you want it to do. We'll tell you what is possible and quote the pieces you need.