Instructions to use fintanlabs/Fintan-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use fintanlabs/Fintan-9B with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
The relay picks the topic's own article first; its code is published in relay/
Browse files- README.md +242 -242
- door/net.py +1 -1
- relay/updates_worker.js +130 -0
README.md
CHANGED
|
@@ -1,242 +1,242 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
base_model: Qwen/Qwen3.5-9B
|
| 4 |
-
library_name: peft
|
| 5 |
-
tags:
|
| 6 |
-
- continual-learning
|
| 7 |
-
- knowledge-update
|
| 8 |
-
- lora
|
| 9 |
-
language:
|
| 10 |
-
- en
|
| 11 |
-
---
|
| 12 |
-
|
| 13 |
-
# Fintan-9B
|
| 14 |
-
|
| 15 |
-
Every AI model today is finished the day it ships. Fintan-9B keeps growing.
|
| 16 |
-
|
| 17 |
-
Fintan-9B is Qwen3.5-9B plus small update files that hold what it has learned since release. The base model's
|
| 18 |
-
weights never change. Each update is an add-on of about 130 MB (30 MB packed), and removing it gives you the base
|
| 19 |
-
model back exactly. We publish news updates on a schedule, and you can teach it your own material on your own GPU.
|
| 20 |
-
|
| 21 |
-
This release comes with one update, the news of 18 to 23 November 2026 (172 facts from 400 articles).
|
| 22 |
-
|
| 23 |
-
| 172 questions about that week's news | Right |
|
| 24 |
-
|---|---|
|
| 25 |
-
| Qwen3.5-9B | 5.8% |
|
| 26 |
-
| Fintan-9B, as served | 89.5% |
|
| 27 |
-
|
| 28 |
-
| General ability, same run | Qwen3.5-9B | Fintan-9B |
|
| 29 |
-
|---|---|---|
|
| 30 |
-
| MMLU (570 questions) | 78.2% | 78.2% |
|
| 31 |
-
| GSM8K (120 problems) | 82.5% | 82.5% |
|
| 32 |
-
| ARC-Challenge (600 questions) | 93.3% | 93.3% |
|
| 33 |
-
|
| 34 |
-
Its general scores stayed where they were.
|
| 35 |
-
|
| 36 |
-
## What is in this download
|
| 37 |
-
|
| 38 |
-
| File | What it is |
|
| 39 |
-
|---|---|
|
| 40 |
-
| `updates/2026-11-23/adapter_model.safetensors` | The news update, a standard adapter (PEFT / LoRA format, rank 512, 8 layers) |
|
| 41 |
-
| `updates/2026-11-23/facts.json` | The 172 facts it learned, each with its source articles |
|
| 42 |
-
| `updates/2026-11-23/check_questions.json` | The 172 questions above, so you can repeat the check |
|
| 43 |
-
| `door/` | The router and a small OpenAI-style front door (plain Python, no model library) |
|
| 44 |
-
| `manifest.json`, `background.json` | What the router reads |
|
| 45 |
-
| `scripts/` | Scripts to run and serve it |
|
| 46 |
-
| `learn/` | The learning command the front door runs, and its engine (compiled, Python 3.10 to 3.13 on Linux) |
|
| 47 |
-
| `jobs/` | The job loop and an example workplace |
|
| 48 |
-
| `self/manual.json` | Fintan's own manual, which it learns on first start |
|
| 49 |
-
|
| 50 |
-
The base model comes from `Qwen/Qwen3.5-9B` and stays under its own licence and terms.
|
| 51 |
-
|
| 52 |
-
## Running it
|
| 53 |
-
|
| 54 |
-
### Full precision (about 18 GB of GPU RAM, a 24 GB card)
|
| 55 |
-
|
| 56 |
-
```bash
|
| 57 |
-
pip install -U transformers peft accelerate
|
| 58 |
-
python scripts/run_transformers.py "By how much did Nvidia shares rise after Jensen Huang was reinstated?"
|
| 59 |
-
python scripts/run_transformers.py --check # repeats the 172-question check on your machine
|
| 60 |
-
```
|
| 61 |
-
|
| 62 |
-
### 4-bit (about 9 GB of GPU RAM, a 12 GB card)
|
| 63 |
-
|
| 64 |
-
```bash
|
| 65 |
-
pip install -U transformers peft accelerate bitsandbytes
|
| 66 |
-
python scripts/run_transformers.py --4bit "..."
|
| 67 |
-
python scripts/run_transformers.py --check --4bit
|
| 68 |
-
```
|
| 69 |
-
|
| 70 |
-
We tested both with this exact download (transformers 5.24.0, peft 0.22.0, bitsandbytes 0.50.2, one 24 GB GPU),
|
| 71 |
-
using `--check`:
|
| 72 |
-
|
| 73 |
-
| 172 questions | Full precision | 4-bit |
|
| 74 |
-
|---|---|---|
|
| 75 |
-
| Base model | 9.3% | 9.9% |
|
| 76 |
-
| With the update | 91.3% | 89.5% |
|
| 77 |
-
| As served (the router decides) | 90.7% | 89.0% (88.4% in a re-run after the end-of-answer fix) |
|
| 78 |
-
| GPU RAM used | 18.6 GB | 9.4 GB |
|
| 79 |
-
|
| 80 |
-
The update was learned on the full-precision model and scores 1.7 points lower on the 4-bit one. When it loads, PEFT
|
| 81 |
-
warns about "missing adapter keys" for the 24 layers the update leaves alone. You can ignore that warning.
|
| 82 |
-
|
| 83 |
-
### As a server (vLLM, OpenAI-style API)
|
| 84 |
-
|
| 85 |
-
```bash
|
| 86 |
-
pip install -U vllm
|
| 87 |
-
bash scripts/serve_vllm.sh # then POST to http://127.0.0.1:8900/v1/chat/completions
|
| 88 |
-
```
|
| 89 |
-
|
| 90 |
-
On a card with 40 GB or more, vLLM loads the base model in full precision. On a smaller card it loads the base
|
| 91 |
-
weights in 8-bit, and if vLLM still cannot start, the script switches to `scripts/serve_small.sh` (transformers,
|
| 92 |
-
4-bit). In our vLLM 0.34.0 test the update scored 89.5% on the 172 questions through the front door, and 1 of 300
|
| 93 |
-
ordinary questions went to the update by mistake.
|
| 94 |
-
|
| 95 |
-
Send `"chat_template_kwargs": {"enable_thinking": false}` with each request. The updates were learned for direct
|
| 96 |
-
answers.
|
| 97 |
-
|
| 98 |
-
## How it answers
|
| 99 |
-
|
| 100 |
-
A question about something an update taught goes to the model with that update. Every other question goes to the
|
| 101 |
-
plain base model. The router that decides is plain code (`door/night_router4.py`) that reads the list of learned
|
| 102 |
-
facts. It never uses the internet.
|
| 103 |
-
|
| 104 |
-
Some questions need several learned facts put together: "Which of the two companies is older?", "What is the
|
| 105 |
-
difference between ...", or "X has a Y. What is the Z of that Y?". The front door answers these in steps
|
| 106 |
-
(`door/combine.py`), and the facts can come from updates learned on different days. Each reply lists the facts it
|
| 107 |
-
used in `fintan_lookups`. In a development test with 120 such questions, each needing two to four learned facts, the
|
| 108 |
-
share answered right went from under 2% to 95.8%. That test used an invented set of facts and one run, so treat it as
|
| 109 |
-
a first result. You can switch this off with `{"combine": false}` in the settings.
|
| 110 |
-
|
| 111 |
-
## Teaching it
|
| 112 |
-
|
| 113 |
-
Run it as a server (`bash scripts/serve_vllm.sh`) and teach it through the front door:
|
| 114 |
-
|
| 115 |
-
```bash
|
| 116 |
-
curl -s localhost:8900/fintan/teach -d '{"text": "...", "source": "handbook.md", "kind": "documents"}'
|
| 117 |
-
curl -s localhost:8900/fintan/learn -X POST # or let it learn by itself (see the settings below)
|
| 118 |
-
curl -s localhost:8900/fintan/status
|
| 119 |
-
```
|
| 120 |
-
|
| 121 |
-
| Kind | What you give it | How it learns |
|
| 122 |
-
|---|---|---|
|
| 123 |
-
| `documents`, `personal`, `news` | text | the model reads the facts in the text, practises them in many wordings, and learns them into a new update |
|
| 124 |
-
| `topics` | a topic name ("Black hole") | it fetches Wikipedia articles through our relay (see below) and learns them as documents |
|
| 125 |
-
| `code` | the path of a folder of Python | Python's own parser reads the functions, parameters, defaults and constants, which are then learned |
|
| 126 |
-
| `skills` | an instruction, or `Request: ... Answer: ...` examples | the model practises requests where the skill applies and learns the skill into its own update |
|
| 127 |
-
| `jobs` | a note about how your work is done | the job loop (below) reads it as a rule |
|
| 128 |
-
|
| 129 |
-
After each learning run, the new update is checked against the plain model on wordings it never practised. It is
|
| 130 |
-
kept only if it does better. If it does not, what you taught is kept as notes, and those notes go to the model with
|
| 131 |
-
any question they match. Each update is its own file, and the router sends a question to the update that knows the
|
| 132 |
-
answer.
|
| 133 |
-
|
| 134 |
-
### When it goes online
|
| 135 |
-
|
| 136 |
-
Only one thing connects to the internet: learning a topic you name. The front door (`door/net.py`, plain Python)
|
| 137 |
-
sends the topic to our relay at updates.fintanlabs.com, which fetches the articles from Wikipedia, so Wikipedia never
|
| 138 |
-
sees your IP address. Your topic leaves mixed in with 4 other topics, so the relay cannot tell which one you wanted,
|
| 139 |
-
and the relay keeps no logs and stores nothing. Before each request leaves, it is written to `calls.log` beside
|
| 140 |
-
`manifest.json`, with the exact text sent. A topic that contains an e-mail address, a phone number, a web address or a
|
| 141 |
-
long number is refused before anything is sent. The relay's host does see your IP address while a request is made;
|
| 142 |
-
to hide that too, set `FINTAN_PROXY` to a VPN or proxy you trust. `FINTAN_OFFLINE=1` stops every request.
|
| 143 |
-
|
| 144 |
-
### Settings
|
| 145 |
-
|
| 146 |
-
`GET/POST /fintan/settings` controls whether it learns automatically, when (after a number of items, or once a day
|
| 147 |
-
at a set hour), and which kinds it may learn. A kind that is switched off is kept as notes instead. With one GPU,
|
| 148 |
-
the server pauses during a learning run and answers again when it ends. A 24 GB card learns with the base model in
|
| 149 |
-
4-bit.
|
| 150 |
-
|
| 151 |
-
If you would rather it kept your personal facts as notes than learned them, switch personal learning off. What you
|
| 152 |
-
tell it about yourself is then saved as notes and given to the model only with questions they match; nothing about
|
| 153 |
-
you is trained. Switch it back on later and the saved notes are learned at the next run.
|
| 154 |
-
|
| 155 |
-
```bash
|
| 156 |
-
curl -s localhost:8900/fintan/settings -d '{"learn": {"personal": false}}' # personal facts stay as notes
|
| 157 |
-
curl -s localhost:8900/fintan/settings -d '{"auto_learn": false}' # learn only when asked
|
| 158 |
-
curl -s localhost:8900/fintan/settings -d '{"auto_when": {"hour": 3}}' # or once a day at 3 am
|
| 159 |
-
```
|
| 160 |
-
|
| 161 |
-
You can also say it in chat ("keep my personal stuff as notes, don't learn it") and it changes the setting itself.
|
| 162 |
-
|
| 163 |
-
We checked notes mode on a 24 GB card with this repository (25 November, one development run). Asked in chat, it
|
| 164 |
-
switched personal learning off. The 3 sentences we then told it about a person were kept as notes, and it answered
|
| 165 |
-
5 of 5 questions about that person from them (the plain model 0 of 5). None of 20 everyday requests got a note. A
|
| 166 |
-
learning run left the notes untrained: the update it made knew 0 of 5. Asked "You can start learning my personal facts
|
| 167 |
-
again", it switched back, and the next run learnt them: 5 of 5 answered with no notes. That last step failed at first
|
| 168 |
-
(the model started a learning run instead of changing the setting); the front door now changes the setting itself,
|
| 169 |
-
and we checked the fix on the same machine.
|
| 170 |
-
|
| 171 |
-
### Talking to it
|
| 172 |
-
|
| 173 |
-
You can skip the commands above and just talk to it. It knows it is Fintan-9B and how it works. Ask it to remember
|
| 174 |
-
something, to say what it knows, to learn now or at night, or hand it a task, and it calls its own functions
|
| 175 |
-
(teach, status, learn, settings, job) and tells you what it did. Each reply lists those calls in `fintan_actions`.
|
| 176 |
-
If you ask it plainly to remember something, or what it knows about you, and the model does not call the function,
|
| 177 |
-
the front door makes the call itself. Ordinary questions reach the model exactly as you wrote them. On first start
|
| 178 |
-
it is given its own manual (`self/manual.json`) and learns it at the first learning run.
|
| 179 |
-
|
| 180 |
-
### The job loop
|
| 181 |
-
|
| 182 |
-
Describe your tools once in `jobs/workplace.json` (see `workplace.example.json`). Each tool is an HTTP address or a
|
| 183 |
-
Python function, and a workplace can also name a task source. The server then runs the loop. It takes tasks from
|
| 184 |
-
`POST /fintan/job`, from the model in chat, or from the task source, makes the lookups, and decides what to do.
|
| 185 |
-
|
| 186 |
-
The setting `job_approve` decides when it asks you first:
|
| 187 |
-
|
| 188 |
-
- `learn` (the default): it asks before every action until you have said yes to that kind of action 5 times in a
|
| 189 |
-
row. After that it acts on its own and asks only when unsure. If you answer anything other than yes, it sends
|
| 190 |
-
nothing, keeps your answer as a rule, and starts counting again.
|
| 191 |
-
- `always`: it asks before every action.
|
| 192 |
-
- `unsure`: it asks only when it is unsure, uses an action for the first time, or a system refuses its call twice.
|
| 193 |
-
- `never`: it never asks.
|
| 194 |
-
|
| 195 |
-
Questions wait at `GET /fintan/jobs` and you answer with `POST /fintan/job/answer`. A task waiting for you does not
|
| 196 |
-
hold up the others. What your systems reply and what you answer become rules straight away, and skills at the next
|
| 197 |
-
learning run. Every call it makes is written to `jobs/calls.log`.
|
| 198 |
-
|
| 199 |
-
## How far this is tested
|
| 200 |
-
|
| 201 |
-
These are development results from 25 November 2026. We downloaded this repository on a fresh machine with one 24
|
| 202 |
-
GB card (RTX A5000), exactly as you would, and ran it there: vLLM served the base weights in 8-bit, and learning ran
|
| 203 |
-
in 4-bit with the compiled engine. Through the front door we taught it 12 encyclopedia articles, 3 sentences about a
|
| 204 |
-
person, 2 code files, an instruction and two examples as skills, and its own manual. One learning run took 23
|
| 205 |
-
minutes and used at most 9.4 GB of the GPU. Then we asked through the front door. We ran the whole check twice, the
|
| 206 |
-
second time on the engine as it is now in this repository; where the runs differ, both numbers are shown.
|
| 207 |
-
|
| 208 |
-
| Check | Qwen3.5-9B | Fintan-9B, as served |
|
| 209 |
-
|---|---|---|
|
| 210 |
-
| 84 questions about what it learned, worded in ways it never practised | 6.0% | 94.0% and 96.4% |
|
| 211 |
-
| Average answer length on those questions | 91 words | 18 words |
|
| 212 |
-
| 5 questions about the person | 0 of 5 | 5 of 5 |
|
| 213 |
-
| The news update, with two more updates loaded | | 88.4% (89.5% alone) |
|
| 214 |
-
| The skills, on 8 new requests (judged by the plain model) | followed 1 | followed 8 |
|
| 215 |
-
| 20 everyday requests sent to an update by mistake | | 0 |
|
| 216 |
-
| The job loop: 5 refund tasks at a test shop, asking before each action | | 5 of 5 right, 0 sent wrong |
|
| 217 |
-
|
| 218 |
-
Most answers are full sentences with details from what it read, for example "Mara Quill was born in Brno. She was
|
| 219 |
-
born in 1991 and later trained as a brewer in Plzen." A few are still just the value ("2 weeks"). Asked "Who are
|
| 220 |
-
you?", it answers as Fintan-9B. Told to remember something, it saved it and said it would be learned at the next
|
| 221 |
-
run; asked what it knows about you, it looked it up. In the job loop it asked before every refund. Twice the answer
|
| 222 |
-
was a correction (refunds over 100 euros go to the duty manager), so it sent nothing and then sent the right action.
|
| 223 |
-
|
| 224 |
-
## Limits
|
| 225 |
-
|
| 226 |
-
- It does not reason better. On reasoning benchmarks it scores the same as Qwen3.5-9B, by design.
|
| 227 |
-
- The 89.5% news score overstates what is useful. The facts are extracted from articles automatically and some are
|
| 228 |
-
weak: a few have vague subjects ("the Event"), a few are circular, and a few are not in English. The facts file
|
| 229 |
-
is published so you can judge them yourself.
|
| 230 |
-
- The news check covers one week in one run. It was a health check before publishing, on news the model had never
|
| 231 |
-
seen, and its rules were not written down beforehand. Our sealed tests, failures included, are in `RESULTS.md`.
|
| 232 |
-
- An ordinary question that the router sends to an update by mistake can get a worse answer. In our checks this
|
| 233 |
-
happened for about 0.3% of ordinary questions.
|
| 234 |
-
- The learning engine runs on Linux with an NVIDIA GPU, under Python 3.10 to 3.13.
|
| 235 |
-
|
| 236 |
-
## Results so far, including failures
|
| 237 |
-
|
| 238 |
-
See `RESULTS.md`.
|
| 239 |
-
|
| 240 |
-
## Who made this
|
| 241 |
-
|
| 242 |
-
Fintan Labs (Garnet Taurus Ltd, UK). Author: Troy Clifford. Contact: through fintanlabs.com.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen3.5-9B
|
| 4 |
+
library_name: peft
|
| 5 |
+
tags:
|
| 6 |
+
- continual-learning
|
| 7 |
+
- knowledge-update
|
| 8 |
+
- lora
|
| 9 |
+
language:
|
| 10 |
+
- en
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Fintan-9B
|
| 14 |
+
|
| 15 |
+
Every AI model today is finished the day it ships. Fintan-9B keeps growing.
|
| 16 |
+
|
| 17 |
+
Fintan-9B is Qwen3.5-9B plus small update files that hold what it has learned since release. The base model's
|
| 18 |
+
weights never change. Each update is an add-on of about 130 MB (30 MB packed), and removing it gives you the base
|
| 19 |
+
model back exactly. We publish news updates on a schedule, and you can teach it your own material on your own GPU.
|
| 20 |
+
|
| 21 |
+
This release comes with one update, the news of 18 to 23 November 2026 (172 facts from 400 articles).
|
| 22 |
+
|
| 23 |
+
| 172 questions about that week's news | Right |
|
| 24 |
+
|---|---|
|
| 25 |
+
| Qwen3.5-9B | 5.8% |
|
| 26 |
+
| Fintan-9B, as served | 89.5% |
|
| 27 |
+
|
| 28 |
+
| General ability, same run | Qwen3.5-9B | Fintan-9B |
|
| 29 |
+
|---|---|---|
|
| 30 |
+
| MMLU (570 questions) | 78.2% | 78.2% |
|
| 31 |
+
| GSM8K (120 problems) | 82.5% | 82.5% |
|
| 32 |
+
| ARC-Challenge (600 questions) | 93.3% | 93.3% |
|
| 33 |
+
|
| 34 |
+
Its general scores stayed where they were.
|
| 35 |
+
|
| 36 |
+
## What is in this download
|
| 37 |
+
|
| 38 |
+
| File | What it is |
|
| 39 |
+
|---|---|
|
| 40 |
+
| `updates/2026-11-23/adapter_model.safetensors` | The news update, a standard adapter (PEFT / LoRA format, rank 512, 8 layers) |
|
| 41 |
+
| `updates/2026-11-23/facts.json` | The 172 facts it learned, each with its source articles |
|
| 42 |
+
| `updates/2026-11-23/check_questions.json` | The 172 questions above, so you can repeat the check |
|
| 43 |
+
| `door/` | The router and a small OpenAI-style front door (plain Python, no model library) |
|
| 44 |
+
| `manifest.json`, `background.json` | What the router reads |
|
| 45 |
+
| `scripts/` | Scripts to run and serve it |
|
| 46 |
+
| `learn/` | The learning command the front door runs, and its engine (compiled, Python 3.10 to 3.13 on Linux) |
|
| 47 |
+
| `jobs/` | The job loop and an example workplace |
|
| 48 |
+
| `self/manual.json` | Fintan's own manual, which it learns on first start |
|
| 49 |
+
|
| 50 |
+
The base model comes from `Qwen/Qwen3.5-9B` and stays under its own licence and terms.
|
| 51 |
+
|
| 52 |
+
## Running it
|
| 53 |
+
|
| 54 |
+
### Full precision (about 18 GB of GPU RAM, a 24 GB card)
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
pip install -U transformers peft accelerate
|
| 58 |
+
python scripts/run_transformers.py "By how much did Nvidia shares rise after Jensen Huang was reinstated?"
|
| 59 |
+
python scripts/run_transformers.py --check # repeats the 172-question check on your machine
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
### 4-bit (about 9 GB of GPU RAM, a 12 GB card)
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
pip install -U transformers peft accelerate bitsandbytes
|
| 66 |
+
python scripts/run_transformers.py --4bit "..."
|
| 67 |
+
python scripts/run_transformers.py --check --4bit
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
We tested both with this exact download (transformers 5.24.0, peft 0.22.0, bitsandbytes 0.50.2, one 24 GB GPU),
|
| 71 |
+
using `--check`:
|
| 72 |
+
|
| 73 |
+
| 172 questions | Full precision | 4-bit |
|
| 74 |
+
|---|---|---|
|
| 75 |
+
| Base model | 9.3% | 9.9% |
|
| 76 |
+
| With the update | 91.3% | 89.5% |
|
| 77 |
+
| As served (the router decides) | 90.7% | 89.0% (88.4% in a re-run after the end-of-answer fix) |
|
| 78 |
+
| GPU RAM used | 18.6 GB | 9.4 GB |
|
| 79 |
+
|
| 80 |
+
The update was learned on the full-precision model and scores 1.7 points lower on the 4-bit one. When it loads, PEFT
|
| 81 |
+
warns about "missing adapter keys" for the 24 layers the update leaves alone. You can ignore that warning.
|
| 82 |
+
|
| 83 |
+
### As a server (vLLM, OpenAI-style API)
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
pip install -U vllm
|
| 87 |
+
bash scripts/serve_vllm.sh # then POST to http://127.0.0.1:8900/v1/chat/completions
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
On a card with 40 GB or more, vLLM loads the base model in full precision. On a smaller card it loads the base
|
| 91 |
+
weights in 8-bit, and if vLLM still cannot start, the script switches to `scripts/serve_small.sh` (transformers,
|
| 92 |
+
4-bit). In our vLLM 0.34.0 test the update scored 89.5% on the 172 questions through the front door, and 1 of 300
|
| 93 |
+
ordinary questions went to the update by mistake.
|
| 94 |
+
|
| 95 |
+
Send `"chat_template_kwargs": {"enable_thinking": false}` with each request. The updates were learned for direct
|
| 96 |
+
answers.
|
| 97 |
+
|
| 98 |
+
## How it answers
|
| 99 |
+
|
| 100 |
+
A question about something an update taught goes to the model with that update. Every other question goes to the
|
| 101 |
+
plain base model. The router that decides is plain code (`door/night_router4.py`) that reads the list of learned
|
| 102 |
+
facts. It never uses the internet.
|
| 103 |
+
|
| 104 |
+
Some questions need several learned facts put together: "Which of the two companies is older?", "What is the
|
| 105 |
+
difference between ...", or "X has a Y. What is the Z of that Y?". The front door answers these in steps
|
| 106 |
+
(`door/combine.py`), and the facts can come from updates learned on different days. Each reply lists the facts it
|
| 107 |
+
used in `fintan_lookups`. In a development test with 120 such questions, each needing two to four learned facts, the
|
| 108 |
+
share answered right went from under 2% to 95.8%. That test used an invented set of facts and one run, so treat it as
|
| 109 |
+
a first result. You can switch this off with `{"combine": false}` in the settings.
|
| 110 |
+
|
| 111 |
+
## Teaching it
|
| 112 |
+
|
| 113 |
+
Run it as a server (`bash scripts/serve_vllm.sh`) and teach it through the front door:
|
| 114 |
+
|
| 115 |
+
```bash
|
| 116 |
+
curl -s localhost:8900/fintan/teach -d '{"text": "...", "source": "handbook.md", "kind": "documents"}'
|
| 117 |
+
curl -s localhost:8900/fintan/learn -X POST # or let it learn by itself (see the settings below)
|
| 118 |
+
curl -s localhost:8900/fintan/status
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
| Kind | What you give it | How it learns |
|
| 122 |
+
|---|---|---|
|
| 123 |
+
| `documents`, `personal`, `news` | text | the model reads the facts in the text, practises them in many wordings, and learns them into a new update |
|
| 124 |
+
| `topics` | a topic name ("Black hole") | it fetches Wikipedia articles through our relay (see below) and learns them as documents |
|
| 125 |
+
| `code` | the path of a folder of Python | Python's own parser reads the functions, parameters, defaults and constants, which are then learned |
|
| 126 |
+
| `skills` | an instruction, or `Request: ... Answer: ...` examples | the model practises requests where the skill applies and learns the skill into its own update |
|
| 127 |
+
| `jobs` | a note about how your work is done | the job loop (below) reads it as a rule |
|
| 128 |
+
|
| 129 |
+
After each learning run, the new update is checked against the plain model on wordings it never practised. It is
|
| 130 |
+
kept only if it does better. If it does not, what you taught is kept as notes, and those notes go to the model with
|
| 131 |
+
any question they match. Each update is its own file, and the router sends a question to the update that knows the
|
| 132 |
+
answer.
|
| 133 |
+
|
| 134 |
+
### When it goes online
|
| 135 |
+
|
| 136 |
+
Only one thing connects to the internet: learning a topic you name. The front door (`door/net.py`, plain Python)
|
| 137 |
+
sends the topic to our relay at updates.fintanlabs.com, which fetches the articles from Wikipedia, so Wikipedia never
|
| 138 |
+
sees your IP address. Your topic leaves mixed in with 4 other topics, so the relay cannot tell which one you wanted,
|
| 139 |
+
and the relay keeps no logs and stores nothing (its code is in `relay/updates_worker.js`). Before each request leaves, it is written to `calls.log` beside
|
| 140 |
+
`manifest.json`, with the exact text sent. A topic that contains an e-mail address, a phone number, a web address or a
|
| 141 |
+
long number is refused before anything is sent. The relay's host does see your IP address while a request is made;
|
| 142 |
+
to hide that too, set `FINTAN_PROXY` to a VPN or proxy you trust. `FINTAN_OFFLINE=1` stops every request.
|
| 143 |
+
|
| 144 |
+
### Settings
|
| 145 |
+
|
| 146 |
+
`GET/POST /fintan/settings` controls whether it learns automatically, when (after a number of items, or once a day
|
| 147 |
+
at a set hour), and which kinds it may learn. A kind that is switched off is kept as notes instead. With one GPU,
|
| 148 |
+
the server pauses during a learning run and answers again when it ends. A 24 GB card learns with the base model in
|
| 149 |
+
4-bit.
|
| 150 |
+
|
| 151 |
+
If you would rather it kept your personal facts as notes than learned them, switch personal learning off. What you
|
| 152 |
+
tell it about yourself is then saved as notes and given to the model only with questions they match; nothing about
|
| 153 |
+
you is trained. Switch it back on later and the saved notes are learned at the next run.
|
| 154 |
+
|
| 155 |
+
```bash
|
| 156 |
+
curl -s localhost:8900/fintan/settings -d '{"learn": {"personal": false}}' # personal facts stay as notes
|
| 157 |
+
curl -s localhost:8900/fintan/settings -d '{"auto_learn": false}' # learn only when asked
|
| 158 |
+
curl -s localhost:8900/fintan/settings -d '{"auto_when": {"hour": 3}}' # or once a day at 3 am
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
You can also say it in chat ("keep my personal stuff as notes, don't learn it") and it changes the setting itself.
|
| 162 |
+
|
| 163 |
+
We checked notes mode on a 24 GB card with this repository (25 November, one development run). Asked in chat, it
|
| 164 |
+
switched personal learning off. The 3 sentences we then told it about a person were kept as notes, and it answered
|
| 165 |
+
5 of 5 questions about that person from them (the plain model 0 of 5). None of 20 everyday requests got a note. A
|
| 166 |
+
learning run left the notes untrained: the update it made knew 0 of 5. Asked "You can start learning my personal facts
|
| 167 |
+
again", it switched back, and the next run learnt them: 5 of 5 answered with no notes. That last step failed at first
|
| 168 |
+
(the model started a learning run instead of changing the setting); the front door now changes the setting itself,
|
| 169 |
+
and we checked the fix on the same machine.
|
| 170 |
+
|
| 171 |
+
### Talking to it
|
| 172 |
+
|
| 173 |
+
You can skip the commands above and just talk to it. It knows it is Fintan-9B and how it works. Ask it to remember
|
| 174 |
+
something, to say what it knows, to learn now or at night, or hand it a task, and it calls its own functions
|
| 175 |
+
(teach, status, learn, settings, job) and tells you what it did. Each reply lists those calls in `fintan_actions`.
|
| 176 |
+
If you ask it plainly to remember something, or what it knows about you, and the model does not call the function,
|
| 177 |
+
the front door makes the call itself. Ordinary questions reach the model exactly as you wrote them. On first start
|
| 178 |
+
it is given its own manual (`self/manual.json`) and learns it at the first learning run.
|
| 179 |
+
|
| 180 |
+
### The job loop
|
| 181 |
+
|
| 182 |
+
Describe your tools once in `jobs/workplace.json` (see `workplace.example.json`). Each tool is an HTTP address or a
|
| 183 |
+
Python function, and a workplace can also name a task source. The server then runs the loop. It takes tasks from
|
| 184 |
+
`POST /fintan/job`, from the model in chat, or from the task source, makes the lookups, and decides what to do.
|
| 185 |
+
|
| 186 |
+
The setting `job_approve` decides when it asks you first:
|
| 187 |
+
|
| 188 |
+
- `learn` (the default): it asks before every action until you have said yes to that kind of action 5 times in a
|
| 189 |
+
row. After that it acts on its own and asks only when unsure. If you answer anything other than yes, it sends
|
| 190 |
+
nothing, keeps your answer as a rule, and starts counting again.
|
| 191 |
+
- `always`: it asks before every action.
|
| 192 |
+
- `unsure`: it asks only when it is unsure, uses an action for the first time, or a system refuses its call twice.
|
| 193 |
+
- `never`: it never asks.
|
| 194 |
+
|
| 195 |
+
Questions wait at `GET /fintan/jobs` and you answer with `POST /fintan/job/answer`. A task waiting for you does not
|
| 196 |
+
hold up the others. What your systems reply and what you answer become rules straight away, and skills at the next
|
| 197 |
+
learning run. Every call it makes is written to `jobs/calls.log`.
|
| 198 |
+
|
| 199 |
+
## How far this is tested
|
| 200 |
+
|
| 201 |
+
These are development results from 25 November 2026. We downloaded this repository on a fresh machine with one 24
|
| 202 |
+
GB card (RTX A5000), exactly as you would, and ran it there: vLLM served the base weights in 8-bit, and learning ran
|
| 203 |
+
in 4-bit with the compiled engine. Through the front door we taught it 12 encyclopedia articles, 3 sentences about a
|
| 204 |
+
person, 2 code files, an instruction and two examples as skills, and its own manual. One learning run took 23
|
| 205 |
+
minutes and used at most 9.4 GB of the GPU. Then we asked through the front door. We ran the whole check twice, the
|
| 206 |
+
second time on the engine as it is now in this repository; where the runs differ, both numbers are shown.
|
| 207 |
+
|
| 208 |
+
| Check | Qwen3.5-9B | Fintan-9B, as served |
|
| 209 |
+
|---|---|---|
|
| 210 |
+
| 84 questions about what it learned, worded in ways it never practised | 6.0% | 94.0% and 96.4% |
|
| 211 |
+
| Average answer length on those questions | 91 words | 18 words |
|
| 212 |
+
| 5 questions about the person | 0 of 5 | 5 of 5 |
|
| 213 |
+
| The news update, with two more updates loaded | | 88.4% (89.5% alone) |
|
| 214 |
+
| The skills, on 8 new requests (judged by the plain model) | followed 1 | followed 8 |
|
| 215 |
+
| 20 everyday requests sent to an update by mistake | | 0 |
|
| 216 |
+
| The job loop: 5 refund tasks at a test shop, asking before each action | | 5 of 5 right, 0 sent wrong |
|
| 217 |
+
|
| 218 |
+
Most answers are full sentences with details from what it read, for example "Mara Quill was born in Brno. She was
|
| 219 |
+
born in 1991 and later trained as a brewer in Plzen." A few are still just the value ("2 weeks"). Asked "Who are
|
| 220 |
+
you?", it answers as Fintan-9B. Told to remember something, it saved it and said it would be learned at the next
|
| 221 |
+
run; asked what it knows about you, it looked it up. In the job loop it asked before every refund. Twice the answer
|
| 222 |
+
was a correction (refunds over 100 euros go to the duty manager), so it sent nothing and then sent the right action.
|
| 223 |
+
|
| 224 |
+
## Limits
|
| 225 |
+
|
| 226 |
+
- It does not reason better. On reasoning benchmarks it scores the same as Qwen3.5-9B, by design.
|
| 227 |
+
- The 89.5% news score overstates what is useful. The facts are extracted from articles automatically and some are
|
| 228 |
+
weak: a few have vague subjects ("the Event"), a few are circular, and a few are not in English. The facts file
|
| 229 |
+
is published so you can judge them yourself.
|
| 230 |
+
- The news check covers one week in one run. It was a health check before publishing, on news the model had never
|
| 231 |
+
seen, and its rules were not written down beforehand. Our sealed tests, failures included, are in `RESULTS.md`.
|
| 232 |
+
- An ordinary question that the router sends to an update by mistake can get a worse answer. In our checks this
|
| 233 |
+
happened for about 0.3% of ordinary questions.
|
| 234 |
+
- The learning engine runs on Linux with an NVIDIA GPU, under Python 3.10 to 3.13.
|
| 235 |
+
|
| 236 |
+
## Results so far, including failures
|
| 237 |
+
|
| 238 |
+
See `RESULTS.md`.
|
| 239 |
+
|
| 240 |
+
## Who made this
|
| 241 |
+
|
| 242 |
+
Fintan Labs (Garnet Taurus Ltd, UK). Author: Troy Clifford. Contact: through fintanlabs.com.
|
door/net.py
CHANGED
|
@@ -16,7 +16,7 @@ NOTHING THAT POINTS TO THE USER IN WHAT IS SENT:
|
|
| 16 |
every update request is byte for byte the same as everyone else's.
|
| 17 |
- A topic leaves with DECOYS other topics, shuffled; the server answers all of them and cannot tell which one was
|
| 18 |
wanted. A topic that holds an e-mail address, a phone number, a web address or a long number is refused.
|
| 19 |
-
- Our Worker keeps nothing (no logs, no storage of requests;
|
| 20 |
- What this cannot hide: the network (the user's provider, Cloudflare's edge) sees the machine's IP address while
|
| 21 |
a request is made. To hide that too: FINTAN_PROXY=https://... (a VPN or proxy the user trusts; the log records the
|
| 22 |
route), or no request at all: copy the signed update file over by USB.
|
|
|
|
| 16 |
every update request is byte for byte the same as everyone else's.
|
| 17 |
- A topic leaves with DECOYS other topics, shuffled; the server answers all of them and cannot tell which one was
|
| 18 |
wanted. A topic that holds an e-mail address, a phone number, a web address or a long number is refused.
|
| 19 |
+
- Our Worker keeps nothing (no logs, no storage of requests; relay/updates_worker.js in this repository).
|
| 20 |
- What this cannot hide: the network (the user's provider, Cloudflare's edge) sees the machine's IP address while
|
| 21 |
a request is made. To hide that too: FINTAN_PROXY=https://... (a VPN or proxy the user trusts; the log records the
|
| 22 |
route), or no request at all: copy the signed update file over by USB.
|
relay/updates_worker.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Fintan relay at updates.fintanlabs.com: the code it runs, published so anyone can check that it keeps nothing.
|
| 2 |
+
// The only address the front door may contact (door/net.py ALLOWED_HOST).
|
| 3 |
+
//
|
| 4 |
+
// GET /latest the newest update's manifest (same answer for everyone)
|
| 5 |
+
// GET /update/<date>/<file> a file of a signed update (same answer for everyone)
|
| 6 |
+
// POST /topic {"q": [5 topics]} for each topic, encyclopedia articles whose titles name it (the client sends
|
| 7 |
+
// its topic among 4 decoys; this Worker answers all five and cannot tell which)
|
| 8 |
+
//
|
| 9 |
+
// KEEPS NOTHING: no console.log, no storage written, no analytics, no cookies, no request headers or addresses
|
| 10 |
+
// read or echoed. Worker logs are switched off in wrangler.toml ([observability] enabled = false).
|
| 11 |
+
// What this file cannot change: Cloudflare's network sees the caller's IP address to deliver the answer.
|
| 12 |
+
|
| 13 |
+
const MAX_TOPICS = 6;
|
| 14 |
+
const MAX_TOPIC_CHARS = 80;
|
| 15 |
+
const ARTICLES_PER_TOPIC = 3;
|
| 16 |
+
const WIKI = "https://en.wikipedia.org/w/api.php";
|
| 17 |
+
const WIKI_UA = "FintanUpdates/0.1 (https://fintanlabs.com)"; // Wikipedia's API asks every tool to name itself
|
| 18 |
+
const STOP = new Set("the a an of in on at to for and or by with from about".split(" "));
|
| 19 |
+
|
| 20 |
+
function json(obj, status = 200) {
|
| 21 |
+
return new Response(JSON.stringify(obj), {
|
| 22 |
+
status,
|
| 23 |
+
headers: { "Content-Type": "application/json", "Cache-Control": "no-store" },
|
| 24 |
+
});
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
function words(s) {
|
| 28 |
+
return s.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter((w) => w && !STOP.has(w));
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
async function wiki(params) {
|
| 32 |
+
const url = WIKI + "?" + new URLSearchParams({ format: "json", formatversion: "2", ...params });
|
| 33 |
+
const r = await fetch(url, { headers: { "User-Agent": WIKI_UA } });
|
| 34 |
+
if (!r.ok) return null;
|
| 35 |
+
return r.json();
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
// and lists, and missed the main article ("Black hole")
|
| 39 |
+
function stem(w) {
|
| 40 |
+
if (w.length > 4 && w.endsWith("ies")) return w.slice(0, -3) + "y";
|
| 41 |
+
if (w.length > 4 && /(?:ches|shes|sses|xes|zes)$/.test(w)) return w.slice(0, -2);
|
| 42 |
+
if (w.length > 3 && w.endsWith("s") && !/(?:ss|us|is)$/.test(w)) return w.slice(0, -1);
|
| 43 |
+
return w;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
function stems(s) {
|
| 47 |
+
return words(s).map(stem);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
async function page(title) {
|
| 51 |
+
const e = await wiki({ action: "query", prop: "extracts", explaintext: "1", titles: title, redirects: "1" });
|
| 52 |
+
const p = e && e.query && e.query.pages && e.query.pages[0];
|
| 53 |
+
if (!p || p.missing || !p.extract || /may (?:also )?refer to/.test(p.extract.slice(0, 400))) return null;
|
| 54 |
+
return { title: p.title, url: "https://en.wikipedia.org/wiki/" + encodeURIComponent(p.title.replace(/ /g, "_")),
|
| 55 |
+
text: p.extract.slice(0, 200000) };
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
async function articles(topic) {
|
| 59 |
+
const want = stems(topic);
|
| 60 |
+
if (!want.length) return [];
|
| 61 |
+
const out = [];
|
| 62 |
+
const seen = new Set();
|
| 63 |
+
// 1. the topic's own article: the page with that name, or the one its name leads to ("Black holes" -> "Black hole")
|
| 64 |
+
const own = await page(topic);
|
| 65 |
+
if (own) { out.push(own); seen.add(own.title); }
|
| 66 |
+
// 2. search results whose title ends with the topic, so the topic is what the article is about ("List of black
|
| 67 |
+
// holes", "Supermassive black hole"; not "Black Holes and Revelations", not "Black Hole (film)"); if none, the
|
| 68 |
+
// old rule: titles that name every word of the topic
|
| 69 |
+
const s = await wiki({ action: "query", list: "search", srsearch: topic, srlimit: "10", srnamespace: "0" });
|
| 70 |
+
const found = ((s && s.query && s.query.search) || []).map((x) => x.title).filter((t) => !seen.has(t));
|
| 71 |
+
const endsWith = (t) => { const ts = stems(t); return ts.length >= want.length && want.every((w, i) => ts[ts.length - want.length + i] === w); };
|
| 72 |
+
let pick = found.filter(endsWith);
|
| 73 |
+
if (!pick.length && !out.length) pick = found.filter((t) => { const ts = new Set(stems(t)); return want.every((w) => ts.has(w)); });
|
| 74 |
+
for (const t of pick) {
|
| 75 |
+
if (out.length >= ARTICLES_PER_TOPIC) break;
|
| 76 |
+
const p = await page(t);
|
| 77 |
+
if (p && !seen.has(p.title)) { out.push(p); seen.add(p.title); }
|
| 78 |
+
}
|
| 79 |
+
return out;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
// stored as parts "<key>#0", "<key>#1", ... with "<key>" = {"chunks": n, "size": bytes}, and streamed back in order.
|
| 83 |
+
async function storedFile(env, ctx, key, type) {
|
| 84 |
+
const meta = await env.UPDATES.get(key, { type: "json" });
|
| 85 |
+
if (!meta || !meta.chunks) return null;
|
| 86 |
+
const { readable, writable } = new TransformStream();
|
| 87 |
+
const pump = (async () => {
|
| 88 |
+
const w = writable.getWriter();
|
| 89 |
+
try {
|
| 90 |
+
for (let i = 0; i < meta.chunks; i++) {
|
| 91 |
+
const part = await env.UPDATES.get(key + "#" + i, { type: "arrayBuffer" });
|
| 92 |
+
if (!part) throw new Error("missing part");
|
| 93 |
+
await w.write(new Uint8Array(part));
|
| 94 |
+
}
|
| 95 |
+
await w.close();
|
| 96 |
+
} catch (e) {
|
| 97 |
+
await w.abort(e);
|
| 98 |
+
}
|
| 99 |
+
})();
|
| 100 |
+
ctx.waitUntil(pump);
|
| 101 |
+
return new Response(readable, { headers: { "Content-Type": type, "Content-Length": String(meta.size), "Cache-Control": "public, max-age=86400" } });
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
export default {
|
| 105 |
+
async fetch(request, env, ctx) {
|
| 106 |
+
const path = new URL(request.url).pathname;
|
| 107 |
+
if (request.method === "GET" && path === "/latest") {
|
| 108 |
+
const text = await env.UPDATES.get("latest.json");
|
| 109 |
+
return text ? new Response(text, { headers: { "Content-Type": "application/json", "Cache-Control": "public, max-age=600" } })
|
| 110 |
+
: json({ error: "no update yet" }, 404);
|
| 111 |
+
}
|
| 112 |
+
const m = path.match(/^\/update\/(\d{4}-\d{2}-\d{2})\/([A-Za-z0-9_.-]+)$/);
|
| 113 |
+
if (request.method === "GET" && m) {
|
| 114 |
+
const r = await storedFile(env, ctx, m[1] + "/" + m[2], "application/octet-stream");
|
| 115 |
+
return r || json({ error: "no such file" }, 404);
|
| 116 |
+
}
|
| 117 |
+
if (request.method === "POST" && path === "/topic") {
|
| 118 |
+
let body;
|
| 119 |
+
try { body = await request.json(); } catch (e) { return json({ error: "send {\"q\": [topics]}" }, 400); }
|
| 120 |
+
const q = Array.isArray(body && body.q) ? body.q : [];
|
| 121 |
+
if (!q.length || q.length > MAX_TOPICS || q.some((t) => typeof t !== "string" || !t.trim() || t.length > MAX_TOPIC_CHARS)) {
|
| 122 |
+
return json({ error: "1 to 6 topics of at most 80 characters" }, 400);
|
| 123 |
+
}
|
| 124 |
+
const results = {};
|
| 125 |
+
for (const t of q) results[t] = await articles(t);
|
| 126 |
+
return json({ results });
|
| 127 |
+
}
|
| 128 |
+
return json({ error: "not found" }, 404);
|
| 129 |
+
},
|
| 130 |
+
};
|