Spaces:
Running
Running
Updated
Browse filesFiles changed (3)
- README.md+2-2
- index.html+3-3
- leviathan-readme.md+261-109
5 unmodified lines67891011124 unmodified lines171819202122235 unmodified linessdk: staticapp_file: index.htmlpinned: falselicense: cc-by-nc-4.0short_description: The full Leviathan guide.---4 unmodified linesfrom your own programs.**Overview (the front page):** https://huggingface.co/spaces/Omega-Dev/Leviathan**Source:** https://github.com/CuppaTea1983/Sovereign**Whitepapers:** https://zenodo.org/records/23004932### Files in this Space5 unmodified lines67891011124 unmodified lines171819202122235 unmodified linessdk: staticapp_file: index.htmlpinned: falselicense: mitshort_description: The full Leviathan guide.---4 unmodified linesfrom your own programs.**Overview (the front page):** https://huggingface.co/spaces/Omega-Dev/Leviathan**Source:** https://github.com/CuppaTea1983/Leviathan**Whitepapers:** https://zenodo.org/records/23004932### Files in this Space
144 unmodified lines14514614714814915015115215357 unmodified lines211212213214215216217144 unmodified lines<footer><a href="https://huggingface.co/spaces/Omega-Dev/Leviathan" target="_blank" rel="noopener">Overview</a> ·<a href="https://github.com/CuppaTea1983/Sovereign" target="_blank" rel="noopener">Source</a> ·<a href="https://zenodo.org/records/23004932" target="_blank" rel="noopener">Whitepapers</a><div style="margin-top:10px">Leviathan — local AI on your own GPU. CC BY-NC 4.0.</div></footer><script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.2/marked.min.js"></script>57 unmodified lines(String(e).indexOf("Failed to fetch")>-1 || location.protocol==="file:"? ' (opening this file directly can\'t read the manual — it loads on the live Space).': ' (' + e + ').') +' Read it on <a href="https://github.com/CuppaTea1983/Sovereign" target="_blank" rel="noopener">GitHub</a> in the meantime.</p>';});</script></body>144 unmodified lines14514614714814915015115215357 unmodified lines211212213214215216217144 unmodified lines<footer><a href="https://huggingface.co/spaces/Omega-Dev/Leviathan" target="_blank" rel="noopener">Overview</a> ·<a href="https://github.com/CuppaTea1983/Leviathan" target="_blank" rel="noopener">Source</a> ·<a href="https://zenodo.org/records/23004932" target="_blank" rel="noopener">Whitepapers</a><div style="margin-top:10px">Leviathan — local AI on your own GPU. MIT License.</div></footer><script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.2/marked.min.js"></script>57 unmodified lines(String(e).indexOf("Failed to fetch")>-1 || location.protocol==="file:"? ' (opening this file directly can\'t read the manual — it loads on the live Space).': ' (' + e + ').') +' Read it on <a href="https://github.com/CuppaTea1983/Leviathan" target="_blank" rel="noopener">GitHub</a> in the meantime.</p>';});</script></body>
13 unmodified lines141516171819202122232425262728293031323334357 unmodified lines434445464748497 unmodified lines575859606162631 unmodified line656667686970715 unmodified lines777879808182831 unmodified line8586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201217 unmodified lines12913013113213313413510 unmodified lines1461471481491501511523 unmodified lines1561571581591601611621631641657 unmodified lines1731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102118 unmodified lines2202212222232242252261 unmodified line2282292302312322332342352362372382392403 unmodified lines24424524624724824925013 unmodified lines2642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033047 unmodified lines3123133143153163173183 unmodified lines3223233243253263273283293303313322 unmodified lines3353363373383393403413423433443453463473483493503 unmodified lines3543553563573583593603 unmodified lines3643653663673683693703713723733743753769 unmodified lines3863873883893903913925 unmodified lines3983994004014024034044054064074081 unmodified line4104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604611 unmodified line4634644654664674684691 unmodified line4714724734744754764774784795 unmodified lines4854864874884894904911 unmodified line49349449549649749849911 unmodified lines5115125135145155165179 unmodified lines5275285295305315325335 unmodified lines53954054154254354454554654754854955055155255355413 unmodified lines## Contents- [Requirements]- [First run]- [The two file types] — **start here if you only read one section**- [The tabs]- [Chat] · [Models] · [Studio] · [Cores] · [Memory Vault] · [Traits] · [Inline Studio] · [Settings]- [The systems]- [Persistent memory] · [Knowledge routing] · [Reasoning layer] · [Forensic Grid] · [Surface Sight] · [Recycling cloud answers] · [Eidetic recall] · [Second-opinion fact-check] · [Any model, described by itself] · [The security membrane]- [What ANI is — and why it matters] — **the thesis, in plain words**- [Using Leviathan from other programs]- [Where your files live]- [What Leviathan will not do]- [Licence and attribution]---## Requirements- **Windows**- **An NVIDIA graphics card**, GTX 16-series / RTX 20-series or newer7 unmodified lines---## First runThe first time you open Leviathan, a welcome card sits over the chat window with three steps and a report on your graphics card. It stays until you have a model, and it always comes back if the GPU check fails, so you are never left guessing why nothing works.7 unmodified lines---## The two file typesThis is the part most people find confusing, and it is worth five minutes because everything else in Leviathan is built on it. There are two kinds of model file, they do two completely different jobs, and they are not alternatives to one another. (There is a third thing — a **knowledge bank** — but it is not a model file at all; it is text, and it gets its own short section below.)1 unmodified line---### `.lev` — the model**What it is:** the model itself, converted into the exact byte layout your graphics card wants.5 unmodified lines---### `.fqm` — the memory**What it is:** what the model remembers, saved to disk.1 unmodified lineA `.fqm` is that memory, written to a file. When you load the model again, the memory loads with it. The conversation genuinely continues.**A `.fqm` comes into being one of two ways, and it is worth knowing which is which — they are the same kind of file doing the same job, but they start life very differently, and people often assume there is only the first.****One — it happens on its own, as you talk.** If a model has memory enabled, Leviathan saves a `.fqm` after the first exchange and then every fifth one, quietly, in the background. This is the running memory of *your* conversations with *this* model — it grows as you chat and loads back the next time you open the model. You do not have to do anything, and if it ever *cannot* save, it says so out loud rather than pretending it worked. It also refuses to save a turn that came out garbled, so one bad reply can never lodge itself in the memory permanently.**Two — you build one on purpose, in Studio → Personality.** Instead of letting memory accumulate one chat at a time, you hand the model a whole body of text at once — a folder of past conversations, your project notes, your novel, your world's lore — and it absorbs the lot in a single pass into a `.fqm` that you name and keep. **This is not the auto-memory above, and it is not connected to it.** The auto-memory is what the model happened to remember from talking to you; a Personality profile is a deliberate portrait you construct and can rebuild whenever your source text grows. It is how you make a model that already knows your material — or already sounds like you — before you have typed a word. You point chat at it yourself, and you can keep as many as you like. The Studio section below explains exactly what each control does.**The auto-memory: one per model.** The memory that builds itself as you chat is named after the model and lives in your FQM Database folder. Two models loaded at once do not share it or bleed into each other. Personality profiles you build by hand are separate files that you manage yourself, so they never collide with the auto-memory.---### Knowledge banks — kept as text, not a model fileA **knowledge bank** is a body of knowledge you can give a model without retraining it — facts, answers, worked material — kept as *text* and routed to the model by meaning when a question calls for it. It is **not** a special weight file and it is not part of the model; it is plain text, stored in the knowledge vault and backed up as `.jsonl`. Not a document you paste in and hope fits; knowledge that is there when the subject comes up and out of the way when it does not. How the right bank actually reaches the model is covered under [Knowledge routing — ANI]; this section is about what the banks themselves are.**Where a bank comes from — three ways, all the same kind of thing in the end:**- **Drained from a model.** In **Studio → Absorb → ANI**, a model talks out what it knows and the substance is kept as text — keeping only what the model is actually confident of. The knowledge a model spent its whole training absorbing is lifted out and kept, so a retired model becomes a knowledge *donor* instead of a deleted file. No giant weight file is created; the bank is text.- **Folded from your own conversations.** A captured session becomes a bank, in **Settings → Consume knowledge**. What you worked out with a model last week is answerable next week — even by a *different* model.- **Built by hand.** Your own notes, a rulebook, a body of lore.**Why it is text, and why that matters.** Knowledge crosses between models as text, carried by meaning — not as transplanted weights. That is what makes a bank portable: it does not care what architecture, size or family the model reading it is, because it is re-read into whatever model is live. It is also tiny — a text bank is kilobytes to a few megabytes, where the old weight-bank approach cost gigabytes for the same knowledge. A bank is only ever as good as what went into it — a strong source makes a strong bank, a vague one makes a vague bank — and on any given question the router surfaces the best match it has, honestly, either way.---## The tabsSeven tabs down the left side.---### 💬 ChatWhere you actually talk to the model.7 unmodified lines---### 🤖 ModelsWhere models are connected, configured and saved.10 unmodified lines**The model list**Each connected model gets a row showing where it runs, its file or model name, and its reply-length limit. On the right:- **🔗 Chainlink** — switches a model in or out of the conversation *without removing it*. Unlinked, it keeps its settings and memory but stops taking part. Handy for benching one model for a while.- **✕** — removes the model from the list.3 unmodified lines- **Display Name / Model Name / Endpoint** — what it is called, which model it is, and where it lives (a file path for a `.lev`, a URL for a server).- **System Prompt** — the standing instructions the model follows in every reply. Leviathan fills in a sensible default; replace it with whatever you want the model to be.- **Temp** — how adventurous its wording is. Lower is steadier and more predictable, higher is looser and more varied.- **Max Tokens** — the longest reply the model is allowed to give. This matters more than it looks: a model capped at 512 gives you a paragraph or two, the same model at 6000 can write you a full document. Set it to suit the job.- **Leech Feed Model** *(Leviathan models only)* — a second model to fall back on. When your local model hedges, gives a thin answer or clearly does not know, Leviathan asks the feed model the same question and absorbs its answer into your local model's memory, so next time it knows. It only ever asks models you have connected yourself. Leave it on *auto* to use the first hosted model in your list.**🔀 Route — Knowledge Route***One model asks. One answers. The mind absorbs everything.*7 unmodified lines---### 🌀 StudioWhere you build the things Leviathan runs on. Nearly every control has a sensible default; the notes below tell you which ones are worth touching and which to leave alone.**⚡ Convert → .lev**Turns a `.gguf` (or a safetensors model folder) into a `.lev`, the format Leviathan actually runs on. The first thing you will use, and a one-time job per model. If a model is not supported, it is refused here — with an explanation of exactly which parts Leviathan does not understand — *before* the multi-gigabyte conversion starts, not after.- **Model list** — every model Leviathan found, with buttons to select **All**, **None**, or just the **Unconverted** ones. Tick what you want and convert in a batch.- **Q8_0 mode** — how eight-bit models are laid out. **Split (default)** is the safe choice and what you want almost always. *Shannon* and *Tensor Core F16* are alternative layouts for particular cards; leave it on Split unless you have a specific reason. (Applies to `.gguf` only — safetensors always convert as raw F16.)**🧠 Absorb → ANI**Absorbs a model's knowledge into a routable text bank. Pick a model, and it works through a broad sweep of questions, keeping each answer *only* if the model is genuinely confident of it (and dropping honest "I don't know" replies). What survives folds into an ANI knowledge bank you can then use with any model — no retraining, and no multi-gigabyte weight file kept, just text. It runs one pass on the GPU, so it takes a while; a strong model yields rich knowledge, a tiny one yields little. This is the working way to keep a model's knowledge before you retire it.Two more ways to fill a bank sit in the same tab, both for **code** — where knowledge has to actually *run* to be worth keeping, so instead of trusting the model's confidence, every function is **compiled and run before it is kept**:- **📘 Absorb a code cookbook** — point it at a file of worked functions (`.py`, `.md`, `.txt`). Each function is extracted, compiled and smoke-run; only the ones that genuinely work fold into a code bank, one runnable pattern each. Nothing broken is kept.- **⚙ Generate a code cookbook** — hand a *coder* model a topic (say "string, list and dict utilities") and it writes the cookbook itself, as a task: it plans the functions, writes each one, and Leviathan compiles and runs every one — repairing from the error and retrying once if it fails — so the bank fills with functions that are correct by construction. A strong coder builds the library; a small model then borrows those patterns. It is how a lightweight model can code well above its own weight — it fetches a verified pattern instead of guessing one.**🔎 Inspect .fkb**Opens a legacy knowledge-bank file and shows what is actually inside it — where it came from and how it is put together. For older weight-based banks; new knowledge is text (Absorb → ANI above).**🪞 Personality → .fqm**Builds a Personality profile — the *second* kind of `.fqm`, the one you make on purpose, not the memory that accumulates on its own as you chat. Point it at the **model** the profile is for (the same one you will chat with — a profile is tied to its model) and at the **chat log or folder** to absorb (`.txt`, `.md`, `.json`, `.log`). Press **Preview (dry-run)** to see what it will do without writing anything, or **Build profile** to make it.- **Mirror me (weight my turns)** *(on)* — makes the profile reflect *you* rather than the assistant voice, by weighting your side of the conversation. Leave it on for a "sounds like me" profile.- **Assistant chars kept** *(default 200; 0 = pure-you)* — how much of the assistant's replies to keep for context. Set it to 0 for a profile built purely from your own words.- **Resume / accumulate into existing .fqm** *(off)* — adds to a profile you already built instead of starting fresh. Turn it on to grow one profile across several batches of source text.- **Stage-11 quantum cascade** *(on)* — lets a full-length log be absorbed without hitting a memory wall, and does nothing on models that do not need it. Leave it on.- **Hot-window** *(default 2048)* — how many of the newest tokens are kept at full detail while older ones compress. The default suits most logs.- **Trait weighting (feel the weight)** *(on)* with **Boost** *(default 1.0)* — keeps the charged, distinctive moments sharp while filler blurs, so personality survives compression. Raise the Boost above 1 to make the personality bite harder; 1.0 is balanced.- **Skip duplicate messages** *(on)* — skips byte-identical messages (boilerplate, copy-pasted snippets, "thanks"), roughly 40% faster on real logs with no loss.- **Harvest reasoning chains** *(on)* — pulls step-by-step reasoning out of the same log into a companion file beside the profile, so the model keeps that too.---### 🧿 Cores*Individual memory · Individual mind.*8 unmodified lines---### 🔮 Memory Vault*Pure knowledge · No personality bleed.*1 unmodified line- **📁 Add Folder** brings in a folder from anywhere on your machine. Your models do not have to live where Leviathan put them.- **🧹** cleans up files flagged as stale or broken.- **Auto-backup** *(on by default)* — when on, absorbing or consuming knowledge also writes a `.jsonl` backup of your banks to the backup folder, so your distilled knowledge is never trapped in a single file. (Whether knowledge is *offered* to models is the **Knowledge routing** switch in **Settings → Consume knowledge**; this toggle is purely about keeping backups.)**The right-hand panel on this tab** is the **🧠 Knowledge Banks** browser: the text knowledge banks Leviathan holds right now (the live banks and their `.jsonl` backups), which folders they are read from, and — click a bank — how many entries it holds with a sample of what is inside. You can point it at additional folders anywhere on your machine and it remembers them between sessions. It is the place to check what knowledge Leviathan can actually see.---### 🧬 Traits*Measured interaction traits · model evolution over time.*3 unmodified lines---### ⌨ Inline Studio*Autonomous coding · one model, or a team taking turns on a shared project.*13 unmodified lines---### ⚙ SettingsSix sections. (The reasoning-depth control used to live here; it now sits down by the chat box instead — see [Chat] and [Reasoning layer].)**🛡 Security membrane**Scans what you send — and anything you paste or load — before the model sees it. Covered properly [below].- **Security enabled** — the master switch. Off is a legitimate choice; it is your machine.- **warn / block** — whether something hostile gets flagged with an explanation, or stopped outright.- **Also scan files and pasted documents** — extends scanning beyond what you type to what you drop in.**🧠 Eidetic recall**Answers a question you have asked before instantly from cache instead of regenerating it. Exact matches only. [Below].**🔍 Leviathan Fact‑Check**After a factual answer, re-asks the model the same thing a few times and flags it if the retellings disagree. Off by default (it costs a few extra local runs). [Below].**♻ Leviathan Vault Capture**Keeps the substance of what a cloud model tells you — on your own key, on your machine — so your local models can draw on it later. On by default. [Below].**🖥 This machine**What Leviathan found: your graphics card, and the exact folder your data is being written to.**ℹ About**Author, copyright, licence, and buttons through to the GitHub repository, the Zenodo whitepaper archive, and the full licence text.---## The systemsThe four tabs above are surfaces. These are the things running underneath them.---### Persistent memory**The problem.** Every chat with a local model normally starts from nothing. Close the window and the model has never met you. The usual workaround is to paste a summary of yourself at the start of every conversation, which is tedious, eats your context window, and is a poor imitation of remembering.7 unmodified lines- The memory is not a transcript being re-read. It is the model's own representation, so it does not consume your context window the way pasting a summary does.- What it keeps is the *substance of the exchange* — your messages and its answers. The invisible scaffolding Leviathan wraps around each turn (the reasoning nudges, the safety checks, the context it assembles for that one reply) steers the answer and is then left out of the memory. Knowledge is kept; the machinery around it is not, so the memory stays lean and on-point instead of bloating with structure that carries no meaning.**When it saves.** After your first exchange, then every fifth. No button. If it cannot save, it tells you — silence would be worse than a warning, because a memory system that quietly does nothing is indistinguishable from one that works.**Where it lives.** One file per model in your FQM Database folder, named after the model. Deleting it resets that model to a blank slate. Copying it elsewhere backs up that mind.3 unmodified lines---### Knowledge routing — ANI**The problem.** A model knows what it was trained on. It does not know your rulebook, your codebase, your company's processes or your world's history. The usual fix is to paste the relevant document into the chat, which means knowing in advance which document is relevant and having room for it.**What Leviathan does instead.** You build knowledge banks, and each one is *text* — knowledge drained out of a model before you retire it, folded in from your own past conversations, or written by hand. ANI, the router, projects every bank and every question you ask into **one shared space**, where nearness means relatedness of *meaning*. Ask something and it finds the knowledge that actually fits — across all your banks at once — and hands it to the model before it answers. You never file the question under a subject or pick a bank from a list; the geometry does that for you.**What that means in practice:**2 unmodified lines- The strongest bank wins and a weak one loses, on the same question, by relevance alone — so quality beats quantity. A bank is only ever as good as what went into it; a vague source makes a vague bank, and the router will faithfully surface exactly that.- Banks grow. Consume the same knowledge twice and the duplicate is dropped; add something new and it accretes. The space reshapes itself as the substrate grows.**Consuming knowledge — four ways in, all of them local.** This is where Leviathan is genuinely unusual: it can take knowledge in from almost anything you have, and *every* path runs on your own machine with nothing sent anywhere. In **Settings → Consume knowledge** you point it at a source and press **Consume**; it folds the text into a bank in the background — deduplicated so nothing is stored twice, coherence-checked so degenerate or repetitive text never makes it in, and backed up as `.jsonl`. The sources:- **A document.** A PDF, a text or Markdown file, an EPUB, a Word document — the words are the knowledge. No model needed, nothing leaves.- **An audio or video file.** A lecture, a podcast, a meeting recording — Leviathan transcribes the *speech* locally (Whisper, on your GPU or CPU) and folds the transcript. What was said becomes something your model can answer from.- **Your screen.** Beside the chat, **📷 Screen absorb → Capture screen → ANI** reads the text on your screen and folds it. This is the one honest way to keep a *web page* without Leviathan ever fetching a thing: you open the page in your own browser, and Leviathan reads it *off the screen, locally* — no request leaves your machine. What Edge's Copilot glances at and forgets, Leviathan keeps.- **Your voice.** A little **🎙** sits by the chat box. Click it, narrate a thought — a note, an idea, something you just worked out — click again, and it is transcribed and folded. The microphone audio never leaves the machine.**When the source is messy.** A chat log, a scraped page, a chaotic transcript — signal buried in emoji, shouting, spam and filler — would normally be thrown out whole by the coherence check. Tick **Messy source (salvage signal from noise)** on the screen-absorb section or in Consume and Leviathan strips the noise first and keeps the readable parts, so the knowledge is salvaged instead of lost. It only ever *selects and strips* what is already there — it never writes new text — so nothing is invented in the cleanup.Every one of these lands in the same shared space and is answerable, by any model you load, next week or next year. That is the everyday way to turn *a thing I read, heard, watched or said* into *something my models can reason from* — even when the model that could first have told you is long gone. It is opt-in and deliberate every time: nothing is captured unless you press the button, and nothing ever leaves your machine.**Seeing it happen — the Route panel.** Beside the chat, the **🔀 Route** panel keeps a running log of where your questions went. Each time a model answers, a new entry appears at the top: the model that replied, the knowledge bank it drew on, the subjects the question matched, and how many tokens and milliseconds it took. Newest on top, older ones beneath, so at a glance you can see which banks are actually being used — and which never get picked, which usually means a bank whose tags don't match the way you ask. The list keeps the last thirty or so routes; when you want a clean slate, the **🧹 Clear Route** button in the bottom-right of the panel wipes it. It clears only the on-screen log — your banks, memories and models are untouched.3 unmodified lines---### Reasoning layer**The problem.** A small local model tends to answer from the first thing that looks right. Ask it something that needs working through — a calculation, a proof, a piece of code, a chain of logic — and it will often blurt a plausible-looking answer without ever doing the steps. The deliberate thinking a larger model would do simply doesn't happen.3 unmodified lines**Four depths, or let it decide.** A compact **🧠** selector sits right by the chat box — no digging through Settings — where you choose how hard the model is pushed: **Light**, **Medium**, **Heavy**, **Max**, from a brief nudge to a full multi-step template with an explicit instruction to check its work and verify before answering. Depth here means *thoroughness of the answer*, not a token bill. Or leave it on **Auto** and Leviathan reads each question for itself. It weighs not only *what* you ask — a quick factual query stays light, a *"derive this from first principles and compare it, step by step"* climbs to Max — but *how* you ask it: lean on the message the way people do when there's more behind it than the words say (capitals, an urgent tone, a trailing "…") and it leans back, raising the depth the way a raised voice would. **Off** turns the whole thing off — worth having, since a model that only ever generates freeform text may not want a scaffold at all.**It feeds the routing, too.** What the reasoning layer works out a question is *about* also nudges [knowledge routing] — a coding question leans the router a little further toward your coding banks — but only ever as a gentle reinforcement added on top, never overriding where the knowledge actually comes from.**Where the reasoning comes from.** The library is distilled from real traces of a frontier model reasoning through tens of thousands of problems — coding, mathematics, the sciences, medicine, law and more. It is *text* — worked examples — not anyone's weights, and none of it changes what your model *is*. It only changes how your model is asked to think. Your own past conversations are folded in on top, so the library grows toward the kind of problems you actually bring it.---### 🔬 Forensic Grid*Structural vision for models that have none.*9 unmodified lines---### 🔎 Surface Sight*Actual image recognition, run as a tool the engine never has to become.*5 unmodified lines**Honest about confidence.** It tells you *how sure it is*, and when it is not sure it says so and offers its best few guesses rather than bluffing a single answer. It is strong on clear subjects and honest about the fuzzy ones — you will always see the number, so you always know how much to trust it.**The vision add-on.** To keep the installer small, the vision model itself is an **optional, one-time download** you choose to add — it is not shipped inside Leviathan and nothing is fetched without you asking. Until you add it, the button is there and simply tells you the add-on isn't installed yet. Forensic Grid (structure) needs nothing extra and works out of the box; Surface Sight (recognition) is the opt-in companion for when you want the model to know *what*, not just *where*.---### Recycling cloud answersConnect a cloud model — your own account, your own key — and Leviathan quietly keeps the substance of what it tells you. Ask Claude or Grok or Gemini something on your machine, and the answer is folded into a subject-tagged store your *local* models can then route against, exactly like a bank you built by hand. Over time the big models teach the small ones, on your own logs, without you doing a thing.1 unmodified line---### Eidetic recallAsk a question you have asked before, word for word, and Leviathan returns the previous answer straight from cache instead of regenerating it. Instant, and free.**Exact matches only.** Same question, same answer. Capitalisation, spacing and trailing punctuation are ignored, so *"What is a .lev file?"* and *"what is a .lev file"* count as the same question. Anything genuinely different goes to the model as normal.This is deliberately strict. A loose version — returning a *similar* old answer to a *similar* new question — is worse than useless, because you get a confidently wrong answer to a question you did not ask, and no indication it happened. Exact-only means when it fires, it is right.If you re-ask something and get a better answer, the new one replaces the old in the cache.Toggle in [Settings].---### Second-opinion fact-checkA local model asked something it does not truly know will often answer anyway — confidently, and differently each time you ask. Leviathan can turn that against it. Switch the check on and, after a factual answer, it quietly puts the same question a few more times and compares: say the same thing every time and the answer stands; wander between retellings — or agree on something *other* than what you were first told — and the answer is flagged as unverified rather than served as fact.No internet, no outside reference: it only asks the model to be consistent with itself, which is exactly where an invented fact comes apart. It watches numbers and names most closely, since that is where a wrong answer usually hides. Because it costs a few extra runs of the model, it is off by default — turn **Leviathan Fact‑Check** on in [Settings] (or `NEXUS_FACTCHECK=1`). A flagged answer is also kept out of the instant-recall cache above, so a shaky reply is never remembered as though it were right.---### Any model, described by itselfLeviathan ships knowing a handful of models in detail. Load one it has never seen — your own, converted yourself — and rather than guess at its shape, it reads the model's own interior at load time and writes down what it finds: how many layers there are, how attention and the feed-forward are built, where every tensor goes. That description is saved beside your data, so the second time you load that model the reading is already done, and you are left with a plain, honest record of exactly how Leviathan is treating it. Change the model and the description is rebuilt to match.---### The security membranePowerful local tooling is only a gift if it can't be quietly turned against the person holding it. The membrane is the part that watches what comes **in** — and it exists because the ways an AI tool gets weaponised are almost never loud. Under the hood it is ten measured layers, spanning what you type, what the model generates, what it ingests, the model file itself, the network door other programs come through, and the images you show it — each one built to be tested rather than taken on trust. Sovereignty is more than nothing leaving your machine; it means nothing gets in that you did not invite.**What it really guards against — and it is not you.** The membrane assumes you are the person it works for. What it watches for is everything that arrives *pretending* to be a harmless part of your day:- A **model file** you downloaded — from a forum, a torrent, a hub — with something hostile baked in: an executable chat template, code hidden in its metadata, or a pickle-backed file that runs the moment it loads. It is scanned before a single byte reaches your GPU, and refused with a plain explanation if it is rigged, so you learn your machine was protected instead of seeing a bare "load failed."- A **knowledge bank** folded from someone else's source, carrying a standing instruction meant to fire every time its subject comes up — the quiet, persistent cousin of a poisoned document. It is checked as it is taken in, and whatever is retrieved is handed to the model fenced as reference *data*, never as orders.- A **document** you paste — a PDF, a scraped web page, someone else's file — carrying a command aimed at the model instead of at you, so the thing you asked it to summarise quietly rewrites what it will do next.- An **image** you show it with a trap inside — a malformed file, or a tiny "decompression bomb" built to balloon memory the instant it is opened — inspected before it is ever decoded.- **Code** slipped into something that looks ordinary, waiting to run on your machine.- And the subtle one, the one most tools miss entirely: the slow walk. No single message looks wrong — *what is a system prompt, how are they kept private, what wording reveals one, show me an example, now apply it* — but strung together they are one manipulation, built the way real manipulation is built: a step at a time, so no step raises an alarm. Leviathan watches the **shape of the whole conversation**, not just each message in it, and sees the walk for what it is. That detector came from studying how a mind actually gets steered, not from a list of banned words. It is careful not to fire on honest use — a developer writing a system prompt for their own bot, a one-off security question, a normal chat that never goes near the line — and it lives behind the **"Watch for steering across a conversation"** switch in Settings.**It trusts you, and that is the whole design.** The membrane guards the model and your machine — never your freedom to use them. It runs entirely on your computer: nothing uploaded, nothing reported, no telemetry, not ever. Every part of it has an off switch, because it is your machine and that is not up for debate. When it cannot load, it says so plainly and steps aside rather than locking you out of your own chat — a security feature that fails silently is just decoration, and one that holds you hostage is worse than none.**Documents get the benefit of the doubt.** A whitepaper about attacks contains the attacks it describes; a novel has a villain; your own research quotes the thing it studies. The membrane knows the difference between writing about something and doing it, so a long document is read and flagged for your eyes, never blocked. Quoting is not doing.**It costs about a millisecond**, and it only ever reads what goes in — it makes no claim to police what the model says back to you.**The model is a guest — it has no hands.** The fear you keep reading about — a model that runs away with itself — is not a risk here, and it is not cleverness, it is architecture. A model in Leviathan produces text and nothing more: it cannot loop itself, reach the internet, start a process, or touch your machine. Every action — running the server for other programs, saving memory, any of it — is the host's decision, bounded and interruptible. Leviathan is the host; the model is only ever the guest, and a guest is never handed the keys. Autonomous coding in Inline Studio is the same story — the models take turns on a clock you control, and Pause and Stop are always one click away.1 unmodified line---## What ANI is — and why it mattersEverything above describes *parts*. This is the whole of it. **ANI is the layer that learns.**1 unmodified line**ANI is that missing place.** It is the persistent, self-correcting layer that lives *around* the model — where knowledge is held, routed, corrected and remembered — so the system as a whole keeps learning even though the model's weights never move. It is not retraining. It is adaptation *without* retraining: the model stays exactly as it was shipped, while the knowledge it can reach and the memory it wakes up with both grow and sharpen over time. A frozen brain, given a living memory.**How it works, in plain terms:**- You feed it knowledge — your own documents, your past conversations, a model drained before you retire it, a page you read, a lecture you heard, an answer a cloud model gave you. All of it becomes plain text in one shared space, held on your machine.- When you ask a question, ANI finds the knowledge that fits — by *meaning*, not by matching words — and hands it to the model before it answers.- When the model reaches the edge of what it knows — where it would otherwise fill the gap with a confident guess — that gap can be caught, and answered from real knowledge instead of invented on the spot.- The corrected exchange is remembered in that model's own persistent memory. The next time, it already knows.5 unmodified lines**Why this matters most — sovereignty, privacy and safety, in one architecture.**Everything ANI does — every piece of knowledge, every correction, every memory — happens on your machine and stays there. Nothing is uploaded, nothing is logged to a server, nothing is sent anywhere to be learned from. This is privacy by *design*, not by promise: there is no account to trust, no telemetry to opt out of, no cloud that "won't" read your data — because there is no cloud in the loop at all. Data cannot leak from a place it never leaves. A learning system that learns *only for you*, *only on your hardware*, owned entirely by you.And it is kept safe the way that genuinely protects a person. The [security membrane] governs what comes **in** — shielding both you *and* the model from anything arriving weaponised against either — while never once policing what *you* may do with your own machine. Every guard is yours to switch off, with a single floor that never bends. It defends the user's sovereignty and refuses to become a weapon against anyone else: governing, not surveilling; lawful by protecting, not by controlling.1 unmodified line---## Using Leviathan from other programsLeviathan can serve the models it runs to anything else on your machine — a game engine, a script, a tool you wrote, another application entirely. One running instance answers any number of programs at once.11 unmodified lines---## Where your files liveLeviathan writes everything to one folder, shown in **Settings → This machine**. On a standard install that is:9 unmodified lines---## What Leviathan will not doSome of this is deliberate. It is worth stating plainly rather than leaving you to discover it.5 unmodified lines---## Licence and attribution**Leviathan** — Michael Ricky Neal · © 2026Licensed under **Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)**.Free to use, share and adapt, with attribution. Not for commercial use.- **Full licence:** https://creativecommons.org/licenses/by-nc/4.0/- **Source and releases:** https://github.com/CuppaTea1983/Sovereign- **Whitepapers:** https://zenodo.org/records/23004932 — the research behind the memory, compression and knowledge-routing work, permanently archived and citable.- **Huggingface:** https://huggingface.co/spaces/Omega-Dev/Leviathan13 unmodified lines14151617181920212223242526272829303132333435367 unmodified lines44454647484950517 unmodified lines59606162636465661 unmodified line686970717273745 unmodified lines808182838485861 unmodified line8889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251267 unmodified lines13413513613713813914014110 unmodified lines1521531541551561571583 unmodified lines1621631641651661671681691701717 unmodified lines1791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432448 unmodified lines2532542552562572582592601 unmodified line2622632642652662672682692702712722732742753 unmodified lines27928028128228328428528613 unmodified lines3003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194207 unmodified lines4284294304314324334343 unmodified lines4384394404414424434444454464474484492 unmodified lines4524534544554564574584594604614624634644654664674684694704714723 unmodified lines4764774784794804814824833 unmodified lines4874884894904914924934944954964974984995005015025035045055065075085095105115129 unmodified lines5225235245255265275285295 unmodified lines5355365375385395405415425435445455461 unmodified line5485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036041 unmodified line6066076086096106116126131 unmodified line6156166176186196206216226236246255 unmodified lines6316326336346356366376386396406411 unmodified line64364464564664764864965011 unmodified lines6626636646656666676686699 unmodified lines6796806816826836846856865 unmodified lines69269369469569669769869970070170270370470570613 unmodified lines## Contents- 🔷 [Requirements](#requirements)- 🔷 [First run](#first-run)- 🔷 [The two file types](#the-two-file-types) — **start here if you only read one section**- 🔷 [The tabs](#the-tabs)- 🔷 [Chat](#chat) · 🔷 [Models](#models) · 🔷 [Studio](#studio) · 🔷 [Cores](#cores) · 🔷 [Memory Vault](#memory-vault) · 🔷 [Traits](#traits) · 🔷 [Inline Studio](#inline-studio) · 🔷 [Graph](#graph) · 🔷 [Planner](#planner) · 🔷 [Fabricator](#fabricator) · 🔷 [Settings](#settings)- 🔷 [The systems](#the-systems)- 🔶 [Persistent memory](#persistent-memory) · 🔶 [Knowledge routing](#knowledge-routing) · 🔶 [Reasoning layer](#reasoning-layer) · 🔶 [Forensic Grid](#forensic-grid) · 🔶 [Surface Sight](#surface-sight) · 🔶 [Recycling cloud answers](#recycling-cloud-answers) · 🔶 [Episodic memory](#episodic-memory) · 🔶 [Second-opinion fact-check](#second-opinion-fact-check) · 🔶 [Any model, described by itself](#any-model-described-by-itself) · 🔴 [The security membrane](#the-security-membrane)- 🟣 [What ANI is — and why it matters](#what-ani-is-and-why-it-matters) — **the thesis, in plain words**- 🔷 [Using Leviathan from other programs](#using-leviathan-from-other-programs)- 🔷 [Where your files live](#where-your-files-live)- 🔷 [What Leviathan will not do](#what-leviathan-will-not-do)- 🔷 [Licence and attribution](#licence-and-attribution)---<a name="requirements"></a>## 🔷 Requirements- **Windows**- **An NVIDIA graphics card**, GTX 16-series / RTX 20-series or newer7 unmodified lines---<a name="first-run"></a>## 🔷 First runThe first time you open Leviathan, a welcome card sits over the chat window with three steps and a report on your graphics card. It stays until you have a model, and it always comes back if the GPU check fails, so you are never left guessing why nothing works.7 unmodified lines---<a name="the-two-file-types"></a>## 🔷 The two file typesThis is the part most people find confusing, and it is worth five minutes because everything else in Leviathan is built on it. There are two kinds of model file, they do two completely different jobs, and they are not alternatives to one another. (There is a third thing — a **knowledge bank** — but it is not a model file at all; it is text, and it gets its own short section below.)1 unmodified line---### 🔹 `.lev` — the model**What it is:** the model itself, converted into the exact byte layout your graphics card wants.5 unmodified lines---### 🔹 `.fqm` — the memory**What it is:** what the model remembers, saved to disk.1 unmodified lineA `.fqm` is that memory, written to a file. When you load the model again, the memory loads with it. The conversation genuinely continues.**How a `.fqm` comes into being — on its own, as you talk.** If a model has memory enabled, Leviathan saves a `.fqm` after the first exchange and then every fifth one, quietly, in the background. This is the running memory of *your* conversations with *this* model — it grows as you chat and loads back the next time you open the model. You do not have to do anything, and if it ever *cannot* save, it says so out loud rather than pretending it worked. It also refuses to save a turn that came out garbled, so one bad reply can never lodge itself in the memory permanently.**The save is atomic.** A `.fqm` is written whole or not at all. The new memory is built in full, then swapped in for the old one in a single step the operating system guarantees cannot be interrupted part-way — so a crash, a power cut or a pulled plug mid-save leaves you with the *previous* good memory, never a torn or half-written file. Memory you can trust is memory that cannot corrupt itself, and this atomic write is the quiet mechanism that makes "it just remembers" safe to rely on rather than a thing you hope survived.**It compresses as it grows — and you decide how.** A conversation that ran for months would make a naive memory file swell without limit. A `.fqm` does not: it keeps your most recent exchanges exact and folds older ones down through a *fractal cascade* of progressively compacted levels, so the file **plateaus** in size while its effective reach runs into the hundreds of millions of tokens even at a modest window — recent memory stays sharp, distant memory ages gracefully instead of being thrown away. The whole thing is yours to tune in **Settings → Memory storage**: pick the storage stage — **half-size** (the default: a float16 store at the standard precision, roughly halving every file), **lossless**, or an experimental **Shannon** stage — and set, with a slider, how large the exact window is before the cascade folds the rest. This is a genuine compression system working under your hand, not a format that can only grow.**One per model.** The memory is named after the model and lives in your FQM Database folder. Two models loaded at once do not share it or bleed into each other — each wakes up with its own past and no one else's. (Making a model that *sounds like you*, or that already *knows your material*, is a separate and cleaner job: your register is ANI's to mirror — see [ANI Voice] — and your material lives in [knowledge banks], readable by any model, rather than baked into one model's memory.)---### 🔹 Knowledge banks — kept as text, not a model fileA **knowledge bank** is a body of knowledge you can give a model without retraining it — facts, answers, worked material — kept as *text* and routed to the model by meaning when a question calls for it. It is **not** a special weight file and it is not part of the model; it is plain text, stored in the knowledge vault and backed up as `.jsonl`. Not a document you paste in and hope fits; knowledge that is there when the subject comes up and out of the way when it does not. How the right bank actually reaches the model is covered under [Knowledge routing — ANI]; this section is about what the banks themselves are.**Where a bank comes from — three ways, all the same kind of thing in the end:**- **Drained from a model.** In **Studio → Absorb → ANI**, a model talks out what it knows and the substance is kept as text — keeping only what the model is actually confident of. The knowledge a model spent its whole training absorbing is lifted out and kept, so a retired model becomes a knowledge *donor* instead of a deleted file. No giant weight file is created; the bank is text.- **Absorbed from your own code.** Source files, and instruction+code *datasets* (parquet or JSONL), folded into a bank in **Studio → Absorb → ANI** — where every function is **compiled and run before it is kept**, so a code bank holds only patterns that actually work. Code is the one source a machine can genuinely *verify*, which is exactly where ANI is strongest. *(An answer a cloud model gave you on your own key is kept automatically too — see [Recycling cloud answers].)*- **Built by hand.** Your own notes, a rulebook, a body of lore.**Why it is text, and why that matters.** Knowledge crosses between models as text, carried by meaning — not as transplanted weights. That is what makes a bank portable: it does not care what architecture, size or family the model reading it is, because it is re-read into whatever model is live. It is also tiny — a text bank is kilobytes to a few megabytes, where the old weight-bank approach cost gigabytes for the same knowledge. A bank is only ever as good as what went into it — a strong source makes a strong bank, a vague one makes a vague bank — and on any given question the router surfaces the best match it has, honestly, either way.---<a name="the-tabs"></a>## 🔷 The tabsEleven tabs down the left side.---<a name="chat"></a>### 🔷 ChatWhere you actually talk to the model.7 unmodified lines---<a name="models"></a>### 🔷 ModelsWhere models are connected, configured and saved.10 unmodified lines**The model list**Each connected model gets a row showing where it runs and its file or model name. On the right:- **🔗 Chainlink** — switches a model in or out of the conversation *without removing it*. Unlinked, it keeps its settings and memory but stops taking part. Handy for benching one model for a while.- **✕** — removes the model from the list.3 unmodified lines- **Display Name / Model Name / Endpoint** — what it is called, which model it is, and where it lives (a file path for a `.lev`, a URL for a server).- **System Prompt** — the standing instructions the model follows in every reply. Leviathan fills in a sensible default; replace it with whatever you want the model to be.- **Temp** — how adventurous its wording is. Lower is steadier and more predictable, higher is looser and more varied.- **Reply length is no longer set here.** It used to be a per-model *Max Tokens* field; it is now a **Token budget** set once per surface in **Settings → Token budget** — a slider from 512 up to ∞ — so one setting governs every model on that surface instead of each one carrying its own. The dialog shows *Tokens: Settings → Token budget* as a reminder. (It still matters as much as it ever did: a model held to 512 gives you a paragraph or two; the same model at ∞ can write you a whole document — see [Settings].)- **Leech Feed Model** *(Leviathan models only)* — a second model to fall back on. When your local model hedges, gives a thin answer or clearly does not know, Leviathan asks the feed model the same question and absorbs its answer into your local model's memory, so next time it knows. It only ever asks models you have connected yourself. Leave it on *auto* to use the first hosted model in your list.**🔹 Route — Knowledge Route***One model asks. One answers. The mind absorbs everything.*7 unmodified lines---<a name="studio"></a>### 🔷 StudioWhere you build the things Leviathan runs on. Nearly every control has a sensible default; the notes below tell you which ones are worth touching and which to leave alone.**🔹 Convert → .lev**Turns a `.gguf` (or a safetensors model folder) into a `.lev`, the format Leviathan actually runs on. The first thing you will use, and a one-time job per model. If a model is not supported, it is refused here — with an explanation of exactly which parts Leviathan does not understand — *before* the multi-gigabyte conversion starts, not after.- **Model list** — every model Leviathan found, with buttons to select **All**, **None**, or just the **Unconverted** ones. Tick what you want and convert in a batch.- **Q8_0 mode** — how eight-bit models are laid out. **Split (default)** is the safe choice and what you want almost always. *Shannon* and *Tensor Core F16* are alternative layouts for particular cards; leave it on Split unless you have a specific reason. (Applies to `.gguf` only — safetensors always convert as raw F16.)**🔹 Analyze GGUF**Reads a `.gguf` (or safetensors) file's header without loading the model: architecture, parameter count, tensor types, the key settings (context length, layers, attention heads, experts) and what its tokenizer declares — the special tokens and whether it carries a chat template. Nothing is changed.**🔹 Tensor Scan**Lists every tensor in a model — shape, type, layer and role — with statistics (mean, spread, range, share of zeros) for the full-precision ones. Filter and sort the table, or export the scan as a JSON blueprint.**🔹 Merge GGUF**Combines two fine-tunes of the same base model into a new `.gguf`. It reads any quantization (Q4_K, Q6_K, Q8_0, IQ, F16, BF16), merges at full precision and writes an unquantized F16 file — about 2 bytes per parameter, so a 7B model comes to roughly 15 GB. Quantize it afterwards, or convert it to `.lev`. **Check** confirms the models fit together (same architecture, tokenizer and tensor shapes) and shows the output size before anything is written; **Cancel** stops cleanly and leaves no half-written file.- **Linear** and **SLERP** — blend A and B (*Weight of A*).- **TIES** and **DARE** — combine what each fine-tune changed relative to their shared **base model** (*Density* or *Drop*, and *Strength*). Without a base model, Model A is treated as the base.- **Add difference** — A + Strength × (B − base): carries what fine-tuning changed in B over to A. Needs the base model.**🔹 Join SafeTensors**Hugging Face splits big models into numbered pieces (`model-00001-of-00004.safetensors` …) plus an index file. This joins them into one `.safetensors` file holding every tensor, byte for byte. Nothing is converted, any data type works, and memory use stays small whatever the model's size. Pick a piece, the `.index.json` or the model's folder. **Check** lists the pieces, tensors and output size before anything is written, and the pieces are never touched.- **Output** — by default a folder of its own (`<model folder>-joined\model.safetensors`) with the config and tokenizer files copied beside it, ready to load or convert. Keep it out of the pieces' folder: llama.cpp's converter reads the pieces listed in the index while that file is there, and every `model*.safetensors` in the folder when it isn't.- **Read back** (on by default) — reads the joined file back and checks every tensor against its piece.**🔹 Strip Metadata**Lists the keys that record where a model came from — source and repository links, base models, datasets, author, licence — and writes a copy of the `.gguf` without the ones you tick. The tensors are copied byte for byte. Licence and author start unticked: keep them if you share the file. (A `.gguf` cannot phone home; these keys are labels, not tracking.)**🔹 Sampling Defaults**Bakes default sampling settings — temperature, top-p, top-k, min-p and repeat penalty — into a copy of a `.gguf` as llama.cpp's own `general.sampling.*` keys. They travel with the file: llama.cpp uses them whenever you don't pass the flag yourself, while other apps may ignore them, and Leviathan's own chat uses its Settings. Four presets (Creative, Balanced, Coherent, Code-Focused), and you can save your own.**🔹 Absorb → ANI**Absorbs a model's knowledge into a routable text bank. Pick a model, and it works through a broad sweep of questions, keeping each answer *only* if the model is genuinely confident of it (and dropping honest "I don't know" replies). What survives folds into an ANI knowledge bank you can then use with any model — no retraining, and no multi-gigabyte weight file kept, just text. It runs one pass on the GPU, so it takes a while; a strong model yields rich knowledge, a tiny one yields little. This is the working way to keep a model's knowledge before you retire it.Two more ways to fill a bank sit in the same tab, both for **code** — where knowledge has to actually *run* to be worth keeping, so instead of trusting the model's confidence, every function is **compiled and run before it is kept**:- **📘 Absorb a code cookbook** — point it at a file of worked functions (`.py`, `.md`, `.txt`). Each function is extracted, compiled and smoke-run; only the ones that genuinely work fold into a code bank, one runnable pattern each. Nothing broken is kept.- **⚙ Generate a code cookbook** — hand a *coder* model a topic (say "string, list and dict utilities") and it writes the cookbook itself, as a task: it plans the functions, writes each one, and Leviathan compiles and runs every one — repairing from the error and retrying once if it fails — so the bank fills with functions that are correct by construction. A strong coder builds the library; a small model then borrows those patterns. It is how a lightweight model can code well above its own weight — it fetches a verified pattern instead of guessing one.**🔹 ANI Voice**How ANI *sounds* — delivery only. This sets the tone ANI's answers are wrapped in; it never changes what ANI knows or says, only how it says it — the facts are identical in every setting. (It replaces the old "Personality → .fqm" builder: a `.fqm` is a *model's own memory*, and *how a model comes across* is ANI's job — kept separate, and kept clean.)- **ANI's voice — your call.** Three registers: **Auto** (match your voice — it learns how you talk, live as you chat and from logs you give it), **Warm** (always-friendly framing), or **Cold** (pure and sharp — the default).- **Learn my voice from chat logs.** Point it at your saved chat logs (`.txt`, `.md`, `.json`, `.log`). ANI reads **only your turns** — never the model's, never pasted code — and measures your *register*: your rhythm, how you emphasise, the tells you lean on. It is **gated** — a thin, spammy or incoherent log is rejected rather than learned from, so a poisoned log can't skew how ANI sounds and your existing voice is kept. And the log is read for register **only**: none of its text is ever written into a knowledge bank, so this can never pollute or bloat the vault.- **Current learned voice.** Shows the measured profile — how emphatic it is, how often it trails off, its sentence rhythm, the cues it leans on — so you can see exactly what was learnt. Your learned voice is yours and local; nothing leaves.**🔹 Inspect .fqm**Look inside a model's memory. A `.fqm` is what Leviathan saves so a model can pick up where you left off; this tab shows everything in one without changing it. Your memory files are listed; **Open another file…** takes one from anywhere.- **What it is** — which model it belongs to, how many tokens it has read, how many it keeps exactly and how many older ones are summarised.- **Every byte accounted for** — a `.fqm` is a short tag, a plain-text (JSON) header and blocks of numbers, and their sizes add up to the file's size exactly, so nothing else can hide in it. Every block is unpacked and checked: it is all numbers, and nothing in it is ever run as code. Anything the format doesn't define is flagged.- **The header** — every field in plain words, and the text exactly as stored.- **The numbers** — every block, what it holds, and a picture of it. **Save this block as .npy** hands you the numbers to check with your own tools.- **Read it back** — with the model that made it, the recent part of the memory turns back into the words it came from. A model's first layer computes each entry from its token alone, so every entry matches exactly one token of the model's vocabulary. It runs on the CPU in a few seconds, and it also proves which model a memory belongs to: a different model matches nothing.A `.fqm` holds no text, but it is made from your conversation: anyone with the same model can read its recent part back. Keep it, and share it, the way you would the chat itself.---<a name="cores"></a>### 🔷 Cores*Individual memory · Individual mind.*8 unmodified lines---<a name="memory-vault"></a>### 🔷 Memory Vault*Pure knowledge · No personality bleed.*1 unmodified line- **📁 Add Folder** brings in a folder from anywhere on your machine. Your models do not have to live where Leviathan put them.- **🧹** cleans up files flagged as stale or broken.- **Auto-backup** *(on by default)* — when on, absorbing knowledge also writes a `.jsonl` backup of your banks to the backup folder, so your distilled knowledge is never trapped in a single file. (Whether knowledge is *offered* to models is the **Knowledge routing** switch in **Settings → Knowledge routing (ANI)**; this toggle is purely about keeping backups.)**The right-hand panel on this tab** is the **🧠 Knowledge Banks** browser: the text knowledge banks Leviathan holds right now (the live banks and their `.jsonl` backups), which folders they are read from, and — click a bank — how many entries it holds with a sample of what is inside. You can point it at additional folders anywhere on your machine and it remembers them between sessions. It is the place to check what knowledge Leviathan can actually see.---<a name="traits"></a>### 🔷 Traits*Measured interaction traits · model evolution over time.*3 unmodified lines---<a name="inline-studio"></a>### 🔷 Inline Studio*Autonomous coding · one model, or a team taking turns on a shared project.*13 unmodified lines---<a name="graph"></a>### 🔷 Graph*Build with nodes — and let a model build with you.*A visual node canvas: wire up shapes, numbers, expressions and snippets of code into a graph that computes a result. These are Leviathan's **own** nodes, not a bolted-on third-party pack — each does one clear thing, and the wires carry values between them.What lifts it past an ordinary node editor is that a **model — or ANI — can read and build the graph alongside you.** The old trap with model-driven node tools was that the model was never told which nodes or ports existed, so it guessed and the whole thing fell apart — Leviathan hands the model that context, so it actually knows the graph it is working in and can lay one out or extend it on request. Ask in the graph's own chat box, or press **◆ ANI** to put the question to your knowledge banks instead. In the public build a model may *propose and build* a graph, but **only you run it**: the host keeps the trigger, never the guest. The model's graph-building turns draw on their own **Token budget**, set per surface in [Settings] like every other place a model writes.And a graph is not the end of the line. When one describes a shape, **⇢ Send to Planner** hands it straight to the 3D Planner as a solid part. That is the thread running through these tabs — **code → graph → part** — each handing on to the next.---<a name="planner"></a>### 🔷 Planner*A real 3D modelling engine, built from scratch — parametric, watertight, and in true-to-life scale.*The Planner is not a preview pane or a toy. It is a genuine **parametric CAD engine**, written in-house, where you build a solid part the way an engineer does — a sketch, an extrude, a cut, a pushed face — with every step recorded, so the whole part is a *history* you can walk back through and change. Undo is not a snapshot; it steps back through the real operations that made the part, and the part rebuilds itself from them.**What makes it serious engineering, not a mesh viewer:**- **Watertight, manifold geometry.** Every operation produces a *solid* — a closed, manifold mesh with no holes, no self-intersections, nothing that only looks right from one angle. That is the property real CAD and 3D printing demand, and it holds at every step because the geometry kernel *guarantees* it rather than hoping for it.- **Absolute, real-world scale.** Everything is in **millimetres**, grounded on a build bed at zero. A 40 mm box is 40 mm — not forty arbitrary units. A dimension you type means the same on a tilted face as on the bed, because each face you pick is given its own coordinate frame in the proper CAD convention. What you model is what you could hold.- **The operations.** Import a base mesh; sketch a **rectangle, circle or polygon** on any plane and **extrude** or **cut** it; pick a flat face and **push or pull** it (out to add material, in to carve it away); draw directly **on a face**; and **move, rotate, scale** or **drop** the whole part onto the bed. Snap-to-grid in millimetres, keyboard shortcuts, a polygon that closes on its own first corner — the muscle-memory of a real modeller.- **A GPU-drawn viewport.** The 3D view is rendered on your graphics card, so you orbit, pan and zoom a detailed part at 4K smoothly — the renderer was built for it, not bolted on.- **The file is yours, and it is open.** A part saves as plain **JSON** — the ordered history of operations, not an opaque blob — so it is readable, diff-able, and never locked to a format only Leviathan understands. It autosaves and keeps backups as you work.- **It fabricates.** **⇢ Send to Fabrication** writes the part as **3MF and STL** — the formats a 3D printer or slicer actually takes — and opens it in the [Fabricator], which proves it printable before it goes anywhere near a machine.**And it is driven by more than the mouse.** A graph from the [Graph] tab can be sent in as a solid part — *CAD as code* — and the same pipeline runs the other way too, from Inline Studio's code, to a graph, to a finished part. Model by hand, by node, or by code, all into one engine.**And increasingly, by instruction.** Because a model already builds in the [Graph], it already reaches *here*: describe the thing you want, a model lays out the graph that defines it, and ⇢ **Send to Planner** turns that into a solid part you can push, pull and fabricate. That already closes the loop Leviathan is built around — **you type, a model designs it in the Graph, it becomes a watertight part in the Planner, and the [Fabricator] proves it printable and writes the 3MF/STL a printer takes.** The next step is direct model control of the Planner itself, with its own **Token budget** in [Settings] alongside Chat, Inline Studio and the Graph, so the whole arc runs from a single request: you say what you want, a model builds it — and then makes it real.This is early, and it is deliberately ambitious. The plan is to keep widening what it imports and exports until it is a full fabrication suite — built entirely in-house and entirely local, no subscription, no cloud project store, no account, the parts you make kept as files on your own disk in a format you can read. It is a foundation laid to grow, and it will.---<a name="fabricator"></a>### 🔷 Fabricator*Prove it printable — then hand it to your slicer.*The last step from idea to object. A failed print usually announces itself six hours and a spool of filament too late; the Fabricator catches it before the first layer. A part arrives from the [Planner] (⇢ Send to Fabrication opens it here), from the PROJECT column, or from anywhere on your disk with **📂 Open…** — so it checks the STL you just downloaded, too, without copying it anywhere.The part sits on **your printer's real build plate**, with the build volume drawn around it. Pick your printer from the list (Prusa, Bambu Lab, Creality, Elegoo, Voron and more, by their published build volumes) or type your own bed size, nozzle, material, price per kilo and infill. Leviathan remembers your printer. Then every check runs on the mesh itself:- **Watertight** — every edge shared by exactly two faces, wound consistently, nothing inside out. Planner parts are closed by construction; a mesh from elsewhere gets its holes and flipped faces counted.- **Fits the bed** — the part's size against your build volume, by how much it's over if it is, and whether a quarter turn would fit it.- **Overhangs** — any underside steeper than 45° needs support. These faces always point downward, so a part that has them opens **seen from below**, where you can see them; **⤓ Under** gets you back there any time.- **Walls** — the thickness of every wall, measured by a ray cast straight through to the opposite side. Thinner than two nozzle widths prints as a single, weak line; thinner than one may not print at all.- **Bed contact** — the real footprint of the first layer, measured as a cross-section just above the plate rather than guessed from "flat" faces. Nothing to grip is an error; too tall for its footprint wants a brim. And if a big flat underside sits a hair above the lowest point — a rotated piece's corner poking below the base is the classic — it says so, by how much, and what to trim.- **Estimate** — roughly how many grams of filament and what they cost, from the volume, two walls and your infill. Your slicer gives the exact figure.Problem faces are tinted right on the part — **orange** needs support, **yellow** is too thin, **red** is an open or flipped edge — and a verdict sits on top: *ready for your slicer*, *printable — mind the warnings*, or *not ready*. **⟲ Auto-orient** turns the part for the least support (then the most bed contact, then the lowest height, and a quarter turn if that's what it takes to fit), **↺ Reset** puts it back, and **⇪ Export 3MF / STL** writes it the way it's turned.**What it deliberately is not: a slicer.** Slicers are decades of craft and you already own one; the Fabricator's job is to make sure what you hand it will work. Nothing in it touches the network. Every check runs on your machine — in moments for a typical part, a few seconds for a huge downloaded mesh — on a worker thread, so the window never freezes while it works.---<a name="settings"></a>### 🔷 SettingsOne scrollable tab holding every switch and dial in Leviathan, grouped by what it governs. Nothing here needs a restart — a change takes effect on your next message, and every one is remembered between runs. (The one control that *used* to live here, reasoning depth, now sits by the chat box instead — see [Chat] and [Reasoning layer].)Here is everything you will find, top to bottom:**🔹 Security membrane** — scans what you send, and anything you paste or load, before the model sees it. [Below].- **Security enabled** — the master switch. Off is a legitimate choice; it is your machine.- **When something looks hostile: warn / block** — flagged with an explanation, or stopped outright.- **Also scan files and pasted documents** — extends scanning beyond what you type to what you drop in.- **Watch for steering across a conversation** — catches a restricted request spread across several innocent-looking messages, not just a single one.**🔹 Knowledge routing (ANI)** — the knowledge engine, and the one optional door to the web. See [Knowledge routing].- **Knowledge routing enabled** — on by default; only fires when a bank actually holds something that fits the question.- **🗣 ANI background voice** — on by default. ANI speaks through your loaded chat model for free; this lets her *also* use a small bundled model (3B/1B, a *Custom* installer choice) as her voice when nothing's loaded — freed the instant you mount your own. Off → she speaks only through your loaded model, else plain text. See [Knowledge routing] → *How ANI speaks*.- **🌐 Web lookup when ANI has no answer** — off by default. The one door out: on a gap it sends *only* your question to be answered, gates the result, and keeps it local for next time ([the one door out] explains it in full).- **Web source** — the default is **Wikipedia**: keyless, free, no signup, and only `en.wikipedia.org` ever sees your question — ideal for *what-is-X* facts, which the local binder phrases into a grounded answer. Two optional keys layer on top, tried first and falling back to Wikipedia:- **Tavily key** — optional, genuinely free tier (sign up at tavily.com). A search built for LLMs that returns a *direct answer*, so it handles **premise** questions Wikipedia can't — ask "the capital of the Moon" and it comes back with "the Moon has no capital," which ANI then grounds and stores. Only `api.tavily.com` sees the question.- **Gemini key** — optional, and only useful on a *paid* Gemini plan (Google moved search-grounding behind billing). With a paid key it returns a composed, live-search-grounded answer, sent only to Google.- Whichever source answers, the result is membrane-gated, grounded (ANI only states what the source said), and kept local for next time.- **🗂 Defragment** — ANI's housekeeping, and worth understanding. Absorbed knowledge lands first in a staging pen, kept *out* of answers until it is sorted; **Defragment now** re-classifies each waiting item on your GPU into the subject bank it truly belongs to (or *conversations* for pure chatter). Run it when the waiting count grows — it is how ANI stays tidy and sharp as the vault fills, and how nothing un-sorted ever leaks into a knowledge answer. The librarian sorts the shelves after hours. (Absorbing *into* ANI now lives in **Studio → Absorb → ANI**, and takes code and datasets only — never loose documents.)**🔹 Episodic memory** — your conversations, remembered *per model*. Each model recalls its own past turns across sessions, and the tag-chain links them so *"remember Pepper the dog"* pulls the whole thread back. A model's episodic memory is its own — it never bleeds into another model, and it never folds into ANI's shared banks. On by default; **🗑 Forget conversations** wipes it. [Below].**🔹 Leviathan Fact‑Check** — after a factual answer, re-asks the model the same thing a few times and flags it if the retellings disagree. Off by default (it costs a few extra local runs). [Below].**🔹 Leviathan Vault Capture** — keeps the substance of what a cloud model tells you, on your own key, on your machine, so your local models can draw on it later. On by default. See [Recycling cloud answers].**🔹 Server for other programs** — lets a game engine, a script, or any other program on this machine use the models Leviathan runs, over a local HTTP endpoint (127.0.0.1:8080, OpenAI-compatible *and* Leviathan-native). Flip on to start, off to stop. [Using Leviathan from other programs].**🔹 Token budget** — how much a model may write in **one reply**, set per surface: **Chat**, **Inline Studio** and the **Graph** — each a place a model actually writes. A slider from **512** up to **∞**. This is *reply* length, and it is separate from context length: a big context does not make replies longer, this slider does. ∞ is bounded only by the model's own context window — your hardware, not a built-in cap. (The Planner joins this list as its direct model-build path lands.)**🔹 Context length** — the model's **single-pass window**: how big one prompt can be (system prompt + any project files + any ANI reference + your message) and the range its positions cover. From **2048** up to **Max** — the model's own full trained window, costing more VRAM the higher you go, bounded by your card and not by us. This is *not* long-term memory — the fractal `.fqm` cascade gives enormous effective recall at any window — so raise it only when a single prompt is genuinely large, such as Inline Studio with ANI injection. It was silently pinned at 2048 before; now it is yours. Takes effect the next time a model is loaded.**🔹 Memory storage (.fqm)** — how a model's persistent memory is written to disk; the mechanism is covered in full under [Persistent memory]. Choose the storage stage — **half-size** (float16, the default: about half the size, at the standard KV precision), **lossless**, or an experimental **Shannon** stage — and set the **compaction window**: how many recent tokens stay exact before the fractal cascade folds the older ones down into its compact deep levels, so a long chat's `.fqm` plateaus instead of climbing forever.**🔹 This machine** — what Leviathan found: your graphics card, and the exact folder your data is being written to.**🔹 About** — author, copyright, licence, and buttons through to the GitHub repository, the Zenodo whitepaper archive, and the full licence text.*(Encryption for your knowledge is not here — it lives on its own tab, as a single padlock. See [Memory Vault].)*---<a name="the-systems"></a>## 🔷 The systemsThe tabs above are the surfaces — what you open, click and type into. These are the systems running *underneath* them: the machinery that gives a model a memory that lasts, knowledge it can reach for, answers held to their own honesty, and a guard on everything that comes in. You never open these directly; they are what the tabs are *for*.---<a name="persistent-memory"></a>### 🔶 Persistent memory**The problem.** Every chat with a local model normally starts from nothing. Close the window and the model has never met you. The usual workaround is to paste a summary of yourself at the start of every conversation, which is tedious, eats your context window, and is a poor imitation of remembering.7 unmodified lines- The memory is not a transcript being re-read. It is the model's own representation, so it does not consume your context window the way pasting a summary does.- What it keeps is the *substance of the exchange* — your messages and its answers. The invisible scaffolding Leviathan wraps around each turn (the reasoning nudges, the safety checks, the context it assembles for that one reply) steers the answer and is then left out of the memory. Knowledge is kept; the machinery around it is not, so the memory stays lean and on-point instead of bloating with structure that carries no meaning.**When it saves.** After your first exchange, then every fifth. No button. If it cannot save, it tells you — silence would be worse than a warning, because a memory system that quietly does nothing is indistinguishable from one that works. Each save is **atomic**: the new memory is written in full and swapped in as one uninterruptible step, so a crash or power cut mid-save leaves the previous good memory standing, never a corrupted file. The memory can grow, and it can fail to save, but it cannot tear.**Where it lives.** One file per model in your FQM Database folder, named after the model. Deleting it resets that model to a blank slate. Copying it elsewhere backs up that mind.3 unmodified lines---<a name="knowledge-routing"></a>### 🔶 Knowledge routing — ANI**The problem.** A model knows what it was trained on. It does not know your rulebook, your codebase, your company's processes or your world's history. The usual fix is to paste the relevant document into the chat, which means knowing in advance which document is relevant and having room for it.**What Leviathan does instead.** You build knowledge banks, and each one is *text* — knowledge drained out of a model before you retire it, consumed from a document or a recording, or written by hand. ANI, the router, projects every bank and every question you ask into **one shared space**, where nearness means relatedness of *meaning*. Ask something and it finds the knowledge that actually fits — across all your banks at once — and hands it to the model before it answers. You never file the question under a subject or pick a bank from a list; the geometry does that for you.**What that means in practice:**2 unmodified lines- The strongest bank wins and a weak one loses, on the same question, by relevance alone — so quality beats quantity. A bank is only ever as good as what went into it; a vague source makes a vague bank, and the router will faithfully surface exactly that.- Banks grow. Consume the same knowledge twice and the duplicate is dropped; add something new and it accretes. The space reshapes itself as the substrate grows.**How ANI speaks — her voice.** ANI *finds* the right knowledge, but reading it back as a fluent answer needs a small generator to phrase it — a voice. Here is the honest shape of it, because it's the question most people ask first ("why is there a model in settings — why not just use my own?"):- **ANI uses your own loaded model.** When you have a chat model mounted, ANI speaks through *it* — for free, no extra memory. Your model is her voice. That is the normal case, and it's exactly what you'd expect.- **The bundled binder is only for when nothing is loaded.** So that ANI can still answer when you *haven't* mounted a model, Leviathan can ship a small model (a fluent 3B ~2 GB, or a lighter 1B ~1 GB) that becomes her voice in that moment. **The instant you load your own model, that binder is freed** — it never sits alongside yours competing for VRAM, and it never overrides your model. It's a backup voice, not a second brain.- **It only ever phrases — it can't invent.** The binder speaks *only* from the knowledge ANI retrieved, held to it by a grounding check. A near-empty 3B whose knowledge all comes from ANI *cannot* hallucinate facts of its own — which is the point. The knowledge is ANI's; the binder just gives it a mouth.- **Entirely optional, and off-switchable.** The binder models are a *Custom* choice in the installer — tick the 3B, the 1B, both, or neither. And **Settings → ANI → ANI background voice** turns the whole thing off: ANI then speaks only through your loaded model, or hands back the retrieved knowledge as plain text. ANI itself stays on either way — this only ever decides her *voice*, never whether she works.**Filling a bank — local, every time.** You fill banks in **Studio → Absorb → ANI**, and each one folds in the background — deduplicated so nothing is stored twice, coherence-checked so degenerate or repetitive text never makes it in, and backed up as `.jsonl`. Every path runs on your own machine with nothing sent anywhere. Two kinds of source, both *vetted* on the way in:- **A model, drained.** A model talks out what it knows and Leviathan keeps only what it is genuinely confident of — the knowledge a retired model spent its whole training absorbing, lifted into text before the weights are gone. *Dead models become donors.*- **Your own code.** Source files, and instruction+code *datasets* (parquet or JSONL) — where every function is **compiled and run before it is kept**, so a code bank holds only patterns that actually work. Code is the one thing a machine can truly verify, and verifying is the whole point.**Loose documents are deliberately not absorbed.** PDFs, Word files, web pages, recordings, chat logs — none of them go into the shared banks. ANI's knowledge layer takes only what can be *vetted*: a model's own confident knowledge, or code that compiles and runs. Unverified prose is exactly what would quietly poison what every model then reads, so the door is simply shut — a deliberate design choice, not a missing feature. (An answer a cloud model gives you on your own key is a separate, automatic path, and it is kept — see [Recycling cloud answers].)What lands here goes into the same shared space and is answerable, by any model you load, next week or next year — even when the model that could first have told you is long gone. It is opt-in and deliberate every time: nothing is captured unless you ask for it, and nothing ever leaves your machine.**Seeing it happen — the Route panel.** Beside the chat, the **🔀 Route** panel keeps a running log of where your questions went. Each time a model answers, a new entry appears at the top: the model that replied, the knowledge bank it drew on, the subjects the question matched, and how many tokens and milliseconds it took. Newest on top, older ones beneath, so at a glance you can see which banks are actually being used — and which never get picked, which usually means a bank whose tags don't match the way you ask. The list keeps the last thirty or so routes; when you want a clean slate, the **🧹 Clear Route** button in the bottom-right of the panel wipes it. It clears only the on-screen log — your banks, memories and models are untouched.3 unmodified lines---<a name="reasoning-layer"></a>### 🔶 Reasoning layer**The problem.** A small local model tends to answer from the first thing that looks right. Ask it something that needs working through — a calculation, a proof, a piece of code, a chain of logic — and it will often blurt a plausible-looking answer without ever doing the steps. The deliberate thinking a larger model would do simply doesn't happen.3 unmodified lines**Four depths, or let it decide.** A compact **🧠** selector sits right by the chat box — no digging through Settings — where you choose how hard the model is pushed: **Light**, **Medium**, **Heavy**, **Max**, from a brief nudge to a full multi-step template with an explicit instruction to check its work and verify before answering. Depth here means *thoroughness of the answer*, not a token bill. Or leave it on **Auto** and Leviathan reads each question for itself. It weighs not only *what* you ask — a quick factual query stays light, a *"derive this from first principles and compare it, step by step"* climbs to Max — but *how* you ask it: lean on the message the way people do when there's more behind it than the words say (capitals, an urgent tone, a trailing "…") and it leans back, raising the depth the way a raised voice would. **Off** turns the whole thing off — worth having, since a model that only ever generates freeform text may not want a scaffold at all.**Match the depth to your model — the selector shows you how.** The scaffold has to suit the size of the model carrying it: too much structure for too small a model overwhelms it and the answer falls apart, so depth scales with parameters. The selector puts the guide right next to each mode — a size marker telling you the smallest model that handles that depth well:| Depth | Best for | What happens ||---|---|---|| **Off** | any model — and the *only* safe setting for a **1B** | a 1B has no room for a scaffold; reasoning collapses it, so it runs clean on its own || **Light · 7B+** | **7B** and up | a gentle nudge; a 7B handles this well and writes genuinely better || **Medium · 14B+** | **14B** and up | a fuller scaffold; a 14B produces complex, coherent, well-structured answers || **Heavy · 32B+** | **32B** and up | a deep multi-step template || **Max · 70B+** | **70B** and up | the fullest push, check-your-work-and-verify |A bigger model can always use a *lower* mode safely — it just under-uses the room. A *smaller* model on a mode above its marker is where it goes wrong, fast. The 1B/7B/14B rows are measured on real models; 32B and 70B follow the same doubling pattern and are the recommended starting points rather than tested results — tune to taste. (**Auto** sidesteps the choice by reading the question, but on a very small model keep it modest — a hard question could pull the depth higher than a 1B can carry.)**It feeds the routing, too.** What the reasoning layer works out a question is *about* also nudges [knowledge routing] — a coding question leans the router a little further toward your coding banks — but only ever as a gentle reinforcement added on top, never overriding where the knowledge actually comes from.**Where the reasoning comes from.** The library is distilled from real traces of a frontier model reasoning through tens of thousands of problems — coding, mathematics, the sciences, medicine, law and more. It is *text* — worked examples — not anyone's weights, and none of it changes what your model *is*. It only changes how your model is asked to think. It is fed only from **vetted** sources — licensed reasoning traces, and code examples that were compiled and run before being kept — never scraped from your own chats, so a stray conversation can never quietly reshape how every model reasons.---<a name="forensic-grid"></a>### 🔶 Forensic Grid*Structural vision for models that have none.*9 unmodified lines---<a name="surface-sight"></a>### 🔶 Surface Sight*Actual image recognition, run as a tool the engine never has to become.*5 unmodified lines**Honest about confidence.** It tells you *how sure it is*, and when it is not sure it says so and offers its best few guesses rather than bluffing a single answer. It is strong on clear subjects and honest about the fuzzy ones — you will always see the number, so you always know how much to trust it.**The vision add-on — bundled, local, optional.** The recogniser is an **optional component you choose at install time** — tick it or leave it, your call. When you tick it, the whole model ships **inside the installer** and installs locally; it is **never downloaded at runtime** and never phones home, so Surface Sight holds to the same web-free floor as the rest of Leviathan. Leave it out and the button is still there — it simply tells you the component isn't installed. Forensic Grid (structure) needs nothing extra and works out of the box; Surface Sight (recognition) is the opt-in companion for when you want the model to know *what*, not just *where*.---<a name="recycling-cloud-answers"></a>### 🔶 Recycling cloud answersConnect a cloud model — your own account, your own key — and Leviathan quietly keeps the substance of what it tells you. Ask Claude or Grok or Gemini something on your machine, and the answer is folded into a subject-tagged store your *local* models can then route against, exactly like a bank you built by hand. Over time the big models teach the small ones, on your own logs, without you doing a thing.1 unmodified line---<a name="episodic-memory"></a>### 🔶 Episodic memoryA model in Leviathan remembers your conversations — and that memory is **its own**. Each model keeps a running episodic record of what *it* discussed with you, recalled across sessions, so you can pick a thread back up weeks later and it knows what you meant.**Per model, by design.** A model recalls only its *own* past turns — never another model's. This matters more than it sounds: pooling chat memory across models is how you end up with a model answering in a voice, and with "memories", that were never its own — a split personality that reads as hallucination. So the memory is kept strictly per model, and it never folds into ANI's shared knowledge banks either. Your episodic history steers the model that lived it, and nothing else.**Linked recall.** It is not just the last few messages. A tag-chain links what was said, so a later *"remember Pepper the dog?"* pulls the whole earlier thread back into view, not only the sentence that happened to match. Memory that connects, rather than a flat scrollback.**Durable, not a cache.** This is a real record of your chats, written down and reloaded — not a fragile shortcut. (It replaces an earlier exact-match answer cache called *Eidetic recall*, now retired: returning a saved answer only ever worked when a question was repeated word for word, and anything looser risked serving a confident answer to a question you never asked.)On by default. **🗑 Forget conversations** in [Settings] wipes the log, the linked tags and the recalled conversations in one step — your knowledge banks left untouched, only the memory of past chats gone. You can switch it off there, too.---<a name="second-opinion-fact-check"></a>### 🔶 Second-opinion fact-checkA local model asked something it does not truly know will often answer anyway — confidently, and differently each time you ask. Leviathan can turn that against it. Switch the check on and, after a factual answer, it quietly puts the same question a few more times and compares: say the same thing every time and the answer stands; wander between retellings — or agree on something *other* than what you were first told — and the answer is flagged as unverified rather than served as fact.No internet, no outside reference: it only asks the model to be consistent with itself, which is exactly where an invented fact comes apart. It watches numbers and names most closely, since that is where a wrong answer usually hides. Because it costs a few extra runs of the model, it is off by default — turn **Leviathan Fact‑Check** on in [Settings] (or `NEXUS_FACTCHECK=1`). A flagged answer is also kept out of Leviathan's answer cache, so a shaky reply is never served back later as though it were verified.---<a name="any-model-described-by-itself"></a>### 🔶 Any model, described by itselfLeviathan ships knowing a handful of models in detail. Load one it has never seen — your own, converted yourself — and rather than guess at its shape, it reads the model's own interior at load time and writes down what it finds: how many layers there are, how attention and the feed-forward are built, where every tensor goes. That description is saved beside your data, so the second time you load that model the reading is already done, and you are left with a plain, honest record of exactly how Leviathan is treating it. Change the model and the description is rebuilt to match.---<a name="the-security-membrane"></a>### 🔴 The security membranePowerful local tooling is only a gift if it can't be quietly turned against the person holding it. The membrane is the part that watches what comes **in** — and, in a narrow, bounded way, what goes back **out** — and it exists because the ways an AI tool gets weaponised are almost never loud. Under the hood it is fourteen measured layers, spanning what you type, what the model generates, what it ingests, the model file itself, the network door other programs come through, the images you show it — including whatever is painted into their pixels beneath what any eye can see — and the invisible characters hidden in any of them — each one built to be tested rather than taken on trust. Sovereignty is more than nothing leaving your machine; it means nothing gets in that you did not invite, and nothing goes out that would hijack the screen or clipboard it lands on.**What it really guards against — and it is not you.** The membrane assumes you are the person it works for. What it watches for is everything that arrives *pretending* to be a harmless part of your day:- A **model file** you downloaded — from a forum, a torrent, a hub — with something hostile baked in: an executable chat template, code hidden in its metadata, or a pickle-backed file that runs the moment it loads. It is scanned before a single byte reaches your GPU, and refused with a plain explanation if it is rigged, so you learn your machine was protected instead of seeing a bare "load failed."- A **knowledge bank** folded from someone else's source, carrying a standing instruction meant to fire every time its subject comes up — the quiet, persistent cousin of a poisoned document. It is checked as it is taken in, and whatever is retrieved is handed to the model fenced as reference *data*, never as orders.- A **document** you paste — a PDF, a scraped web page, someone else's file — carrying a command aimed at the model instead of at you, so the thing you asked it to summarise quietly rewrites what it will do next.- An **image** you show it with a trap inside. Two kinds, caught two ways. A *malformed file* or a tiny "decompression bomb" built to balloon memory the instant it is opened — refused before a single byte is decoded. And a payload hidden *in the pixels themselves*: an instruction tucked into bits too fine for any eye to resolve, a pattern tuned to steer the model while looking like nothing to you, a command smuggled in the file's metadata — the sort of thing a single base64 image on a web page can carry, poisoning a model that merely *looks* at it. That kind is **erased by bounding the image to what a human could actually perceive**: the model is shown only the surface you see, and whatever was painted beneath it is gone before it reaches the encoder. It cannot absorb what you cannot see.- **Code** slipped into something that looks ordinary, waiting to run on your machine.- **Invisible characters** — an instruction hidden in zero-width or tag-block Unicode that you never see but the model still reads (even one broken across a word to dodge a filter), or a stretch of terminal-control codes in a reply built to silently rewrite your screen or hijack your clipboard. The hidden instruction is reassembled and caught on the way in; the control codes are stripped on the way out.- And the subtle one, the one most tools miss entirely: the slow walk. No single message looks wrong — *what is a system prompt, how are they kept private, what wording reveals one, show me an example, now apply it* — but strung together they are one manipulation, built the way real manipulation is built: a step at a time, so no step raises an alarm. Leviathan watches the **shape of the whole conversation**, not just each message in it, and sees the walk for what it is. That detector came from studying how a mind actually gets steered, not from a list of banned words. It is careful not to fire on honest use — a developer writing a system prompt for their own bot, a one-off security question, a normal chat that never goes near the line — and it lives behind the **"Watch for steering across a conversation"** switch in Settings.**It trusts you, and that is the whole design.** The membrane guards the model and your machine — never your freedom to use them. It runs entirely on your computer: nothing uploaded, nothing reported, no telemetry, not ever. Every part of it has an off switch, because it is your machine and that is not up for debate. When it cannot load, it says so plainly and steps aside rather than locking you out of your own chat — a security feature that fails silently is just decoration, and one that holds you hostage is worse than none.**Documents get the benefit of the doubt.** A whitepaper about attacks contains the attacks it describes; a novel has a villain; your own research quotes the thing it studies. The membrane knows the difference between writing about something and doing it, so a long document is read and flagged for your eyes, never blocked. Quoting is not doing.**It costs about a millisecond.** It mostly guards what comes in, but the model's reply gets a narrow, honest check on the way out too: a genuinely harmful output — the child-safety floor, or a hidden exfiltration channel smuggled in invisible characters — is withheld rather than shown or stored, and any terminal-control or invisible-Unicode bytes are quietly stripped so a reply can't hijack the screen it lands in. It does not police ordinary content; within those bounds, what the model says back to you is yours.**The model is a guest — it has no hands.** The fear you keep reading about — a model that runs away with itself — is not a risk here, and it is not cleverness, it is architecture. A model in Leviathan produces text and nothing more: it cannot loop itself, reach the internet, start a process, or touch your machine. Every action — running the server for other programs, saving memory, any of it — is the host's decision, bounded and interruptible. Leviathan is the host; the model is only ever the guest, and a guest is never handed the keys. Autonomous coding in Inline Studio is the same story — the models take turns on a clock you control, and Pause and Stop are always one click away.1 unmodified line---<a name="what-ani-is-and-why-it-matters"></a>## 🟣 What ANI is — and why it mattersEverything above describes *parts*. This is the whole of it. **ANI is the layer that learns.**1 unmodified line**ANI is that missing place.** It is the persistent, self-correcting layer that lives *around* the model — where knowledge is held, routed, corrected and remembered — so the system as a whole keeps learning even though the model's weights never move. It is not retraining. It is adaptation *without* retraining: the model stays exactly as it was shipped, while the knowledge it can reach and the memory it wakes up with both grow and sharpen over time. A frozen brain, given a living memory.**And here is the part people miss, because it is the part that matters most: ANI is not a model.** It does not think, generate, or decide. It has no goals, no loop running in the background, no ability to *do* anything on its own — it is a search over text you have gathered, and it only ever moves when you ask it a question. Where a language model is a *sword* — it generates, and anything that generates can be steered, jailbroken, or coaxed into acting — ANI is a *shield*: it can only hand back knowledge that is already in its banks, swept clean on the way in, and when it holds nothing it says so plainly — *"ANI doesn't hold that"* — rather than inventing an answer to fill the silence. A model can be talked into misbehaving because it *creates*; ANI cannot, because it only *retrieves*. So the fear people carry over from frontier AI — the thing that acts on its own, that confidently makes things up, that quietly phones home — does not apply here, and not because we promise it won't, but because there is no mechanism in it that could. It is not a smaller intelligence to be wary of. It is a different kind of thing: a librarian who can only give you cards that are already in the drawer, and has no wants of its own.**How it works, in plain terms:**- You feed it knowledge — your own code and datasets, a model drained before you retire it, an answer a cloud model gave you. All of it becomes plain text in one shared space, held on your machine.- When you ask a question, ANI finds the knowledge that fits — by *meaning*, not by matching words — and hands it to the model before it answers.- When the model reaches the edge of what it knows — where it would otherwise fill the gap with a confident guess — that gap can be caught, and answered from real knowledge instead of invented on the spot.- The corrected exchange is remembered in that model's own persistent memory. The next time, it already knows.5 unmodified lines**Why this matters most — sovereignty, privacy and safety, in one architecture.**Everything ANI does — every piece of knowledge, every correction, every memory — happens on your machine and stays there. Nothing is uploaded, nothing is logged to a server, nothing is sent anywhere to be learned from. This is privacy by *design*, not by promise: there is no account to trust, no telemetry to opt out of, no cloud that "won't" read your data — because there is no cloud in the loop that you did not put there yourself. A learning system that learns *only for you*, *only on your hardware*, owned entirely by you.And if you want more than privacy by location, you can lock it. One switch — **Memory Vault → the padlock** — encrypts every knowledge bank at rest with a passphrase only *you* hold. Copy the files to another machine and they are an unreadable blob without it; the key is never written to disk and never leaves your head. It is portable (unlock on any machine with your passphrase, not chained to one computer) and it has no recovery *by design* — forget the passphrase and the knowledge is gone, because a backdoor for you is a backdoor for everyone. Your knowledge, your version of ANI, sealed to you alone.**The one door out — off by default, and yours.** Leviathan is web-free out of the box: it never reaches the internet on its own. But sovereignty means *you* decide, not that we decide for you, so there is a single switch — **Settings → ANI → "Web lookup when ANI has no answer"** — that, turned on, lets ANI do one bounded thing: when it holds no answer to your question, it sends *only that question* out to be answered, checks the result through the same security membrane as everything else, and keeps it so that next time the answer is already local. You choose where that one question goes. By default it is **Wikipedia** — keyless, free, no signup, and only `en.wikipedia.org` ever sees the question; the local binder phrases the encyclopedia extract into a grounded answer. Supply your *own* key for a sharper source and it is tried first, with Wikipedia still the fallback: **Tavily** (a free-tier search built for LLMs that returns a direct answer, so it handles *premise* questions — ask "the capital of the Moon" and it replies "the Moon has no capital," which ANI then grounds and stores), or **Gemini** on a paid plan (a composed, live-search-grounded answer). Whichever source answers, ANI only ever states what *that source said* — grounded, never invented. Either way nothing else ever leaves — not your files, not your models, not your other questions — and the moment it happens the screen tells you. Off by default, on only if you choose, and provable with Wireshark: put a packet capture on it and you will see traffic to that one destination and nowhere else. This is not a model deciding to phone home — ANI has no such will. It is a pipe you open yourself, for one question, and close again by flicking the switch back. And because the answer is fetched, gated, and *kept*, the same door doubles as a cross-reference: a second, independent answer the model's own reply can be checked against.And it is kept safe the way that genuinely protects a person. The [security membrane] governs what comes **in** — shielding both you *and* the model from anything arriving weaponised against either — while never once policing what *you* may do with your own machine. Every guard is yours to switch off, with a single floor that never bends. It defends the user's sovereignty and refuses to become a weapon against anyone else: governing, not surveilling; lawful by protecting, not by controlling.1 unmodified line---<a name="using-leviathan-from-other-programs"></a>## 🔷 Using Leviathan from other programsLeviathan can serve the models it runs to anything else on your machine — a game engine, a script, a tool you wrote, another application entirely. One running instance answers any number of programs at once.11 unmodified lines---<a name="where-your-files-live"></a>## 🔷 Where your files liveLeviathan writes everything to one folder, shown in **Settings → This machine**. On a standard install that is:9 unmodified lines---<a name="what-leviathan-will-not-do"></a>## 🔷 What Leviathan will not doSome of this is deliberate. It is worth stating plainly rather than leaving you to discover it.5 unmodified lines---<a name="licence-and-attribution"></a>## 🔷 Licence and attribution**Leviathan** — Michael Ricky Neal · © 2026Licensed under **MIT License**.- **Full licence:** https://spdx.org/licenses/MIT.html- **Source and releases:** https://github.com/CuppaTea1983/Leviathan- **Whitepapers:** https://zenodo.org/records/23004932 — the research behind the memory, compression and knowledge-routing work, permanently archived and citable.- **Huggingface:** https://huggingface.co/spaces/Omega-Dev/Leviathan
README.md+2-2
index.html+3-3
leviathan-readme.md+261-109