Spaces:
Running
Running
update
Browse files22 unmodified lines232425262627282935 unmodified lines6566676869707172152 unmodified lines225226227226227228229228229230231232233231232234235236237235236238239240238241242240241243244245246247146 unmodified lines3943953963943953973983994004018 unmodified lines41041141241041341441541657 unmodified lines47447547647447747847948077 unmodified lines55855956055855956056156256356456556622 unmodified lines<p align="center"><sub>Real time on an RTX 4080, nothing edited: Qwen 2.5 Coder 7B (Q8_0) writing each answer. How fast depends on your card β mostly its memory bandwidth β so a newer card is quicker and a smaller one slower.</sub></p>
<p align="center"><img src="screenshots/pipeline.gif" width="900" alt="One 3D part through Inline Studio, the Graph, the Planner and the Fabricator" /></p><p align="center"><sub>From a sentence to a print-ready part, in four real screenshots: the model writes the CAD script in Inline Studio β it becomes nodes in the Graph β the model drills a screw hole when asked, in the Planner β the Fabricator signs it off.</sub></p><p align="center"><sub>From a sentence to a print-ready part, in four real screenshots: the model writes the CAD script in Inline Studio β it becomes nodes in the Graph β you click the base and the model drills a screw hole there, in the Planner β the Fabricator signs it off.</sub></p>
---
35 unmodified lines
<p align="center"><img src="screenshots/first-run.png" width="900" alt="Leviathan's welcome card on first run, with the graphics-card check" /></p>
**Windows may stop the installer first.** The installer isn't code-signed yet, so Windows SmartScreen can say *"Windows protected your PC"* when you run it. Click **More info**, then **Run anyway**. The warning means the installer is new to Windows and unsigned; it doesn't mean anything was found in it.
The 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.
The three steps are:152 unmodified lines<p align="center"><img src="screenshots/studio-scan.png" width="900" alt="Tensor Scan listing Qwen 2.5 Coder 7B's 339 tensors with their shapes, types and statistics" /></p>
**πΉ Merge GGUF**Model merging in a window: [mergekit](https://github.com/arcee-ai/mergekit)'s core methods β Linear, SLERP, TIES, DARE and Add difference (task arithmetic) β run straight on `.gguf` files. No Python, no YAML config, and no converting back to safetensors first. It 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.Model merging in a window: [mergekit](https://github.com/arcee-ai/mergekit)'s core methods β Linear, SLERP, TIES, DARE and Add difference (task arithmetic) β run straight on `.gguf` files. No Python, no YAML config, and no converting back to safetensors first. It combines two to four fine-tunes of the same base model (**+ Add model** for a third and fourth) 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** β blend the models (*Weight of A* with two; a *Weight* per model with three or four, used as shares).- **SLERP** β blend two models along the arc between them (*Weight of A*). Two models only: add a third and it switches to Linear and says so.- **TIES** and **DARE** β combine what each fine-tune changed relative to their shared **base model** (*Density* or *Drop*, and *Strength*; with three or four, each model's *Weight* counts in the vote and the mean). Without a base model, Model A is treated as the base.- **Add difference** β A + Strength Γ (B β base), and with more models the weighted sum of each one's change: carries what fine-tuning changed in the others over to A. Needs the base model.
<p align="center"><img src="screenshots/studio-merge.png" width="900" alt="Merge GGUF: Qwen 2.5 Coder 7B and cad0, its CAD fine-tune, checked for a TIES merge" /></p><p align="center"><sub>Qwen 2.5 Coder 7B and cad0, a CAD fine-tune of the same model, checked for a TIES merge: they fit, and the F16 result would be about 14.2 GB. Nothing is written until you press Merge.</sub></p><p align="center"><img src="screenshots/studio-merge.png" width="900" alt="Merge GGUF with four models, A to D, each with its own Weight (1, 2, 1, 1), checked for a Linear merge" /></p><p align="center"><sub>Four models in one merge, each with its own Weight (1, 2, 1, 1), checked for a Linear merge: they fit, and the F16 result would be about 2.0 GB. The four here are one model, TinyLlama 1.1B, at four quantizations, standing in for four fine-tunes to fill the rows. Nothing is written until you press Merge.</sub></p>
**Preview β see what a merge does before you write it.** Merging usually means writing a 15 GB file first and finding out afterwards whether it works. **Preview** answers before anything is written, in two steps:- **The weights, in seconds** β how far apart the two models are, layer by layer, and a short list of what to watch in plain words. It catches a trap that can break a merge outright: normalisation channels switched off in one model and on in the other, which any blend switches partly back on.- **The result, measured** β Model A, Model B and the merge (at your setting, two neighbouring settings, and with A's norm weights kept when that trap shows up) each read real text, and Preview scores how surprised each one is: a shorter bar is better, with a plain verdict β better than both, between the two, about the same, worse than both, or likely broken. The merged weights it scores come from the same code that writes the file, so the forecast is the merge you would get. It runs on the CPU, about a minute per billion parameters, for Llama- and Qwen-shaped models (the weight comparison works for any pair Merge accepts). Point **Preview text** at a file of your own to score the kind of writing you care about.- **The weights, in seconds** β how far apart the models are (each one against Model A), layer by layer, and a short list of what to watch in plain words. It catches a trap that can break a merge outright: normalisation channels switched off in one model and on in the other, which any blend switches partly back on.- **The result, measured** β every model you put in and the merge (at your setting, two neighbouring settings, and with A's norm weights kept when that trap shows up) each read real text, and Preview scores how surprised each one is: a shorter bar is better, with a plain verdict β better than all of them, among them, about the same, worse than all of them, or likely broken. The merged weights it scores come from the same code that writes the file, so the forecast is the merge you would get. It runs on the CPU, about a minute per billion parameters, for Llama- and Qwen-shaped models (the weight comparison works for any models Merge accepts). Point **Preview text** at a file of your own to score the kind of writing you care about.
**Keep Model A's norm weights** copies those small normalisation weights from Model A instead of blending them; Preview shows when that matters.**Keep Model A's norm weights** copies those small normalisation weights from Model A instead of blending them; Preview shows when that matters. A real case: blended 50/50, Qwen 2.5 Coder 7B and cad0, its own CAD fine-tune, look like an easy pair β but Preview finds 1,390 of layer 1's normalisation channels switched off in Qwen and on in cad0, and measures the blend as likely broken, 5.3Γ more surprised by the text than Qwen (and the same at 25 % and 75 %). Keeping Qwen's norm weights avoids the collapse, though that blend still scores worse than either model. All of that before a byte is written.
<p align="center"><img src="screenshots/studio-merge-preview.png" width="900" alt="Merge Preview for Qwen 2.5 Coder 7B blended 50/50 with cad0: a verdict of likely broken, bars for each model and setting, a per-layer chart with layer 1 flagged, and the list of what to watch" /></p><p align="center"><sub>Qwen 2.5 Coder 7B blended 50/50 with cad0, its own CAD fine-tune: Preview finds 1,390 of layer 1's normalisation channels switched off in Qwen and on in cad0, and measures the blend as likely broken β 5.3Γ more surprised by the text than Qwen, and the same at 25 % and 75 %. Keeping Qwen's norm weights avoids the collapse, but that blend still scores worse than either model. Nothing was written.</sub></p><p align="center"><img src="screenshots/studio-merge-preview.png" width="900" alt="Merge Preview for four models blended 20/40/20/20: a bar for each model and for the merge, a per-layer chart of how far the models differ, and what to watch" /></p><p align="center"><sub>The four models from the picture above, blended 20 / 40 / 20 / 20: Preview scores each one on real text β the Q2_K file's damage shows (0.913 bits per byte against 0.837β0.849) β and the merge lands among them, 0.6 % behind Model A, so writing it would buy nothing. Nothing was written.</sub></p>
**πΉ 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.146 unmodified lines
*A real 3D modelling engine, built from scratch β parametric, watertight, and in true-to-life scale.*
<p align="center"><img src="screenshots/planner.gif" width="900" alt="Asking the model in the Planner for a screw hole through the base; the edit lands as a history step" /></p><p align="center"><sub>Real time: asked in plain words for a screw hole through the base, the model's edit lands as step 2 in the history β Undo takes it back.</sub></p><p align="center"><img src="screenshots/planner.gif" width="900" alt="The base's top face clicked in the Planner, then the model asked for a screw hole through it; the edit lands as a history step" /></p><p align="center"><sub>Real time: the base's top face clicked, then a screw hole asked for in plain words β the model's edit lands as step 2 in the history, and Undo takes it back.</sub></p>
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.
8 unmodified lines
**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 by instruction β a model that knows where it is.** Bottom right sits a chat with the model you've picked β shown as chips above it, the same pick Inline Studio and the Graph use, so the model you chose in one tab is the model in the next β or **β ANI**, answering from your knowledge banks. The old trap with models and 3D tools is that the model never knows what it's looking at, so it guesses; the Planner hands it the part instead β its real size in millimetres, how it was made, every face and hole measured from the part itself (each with an id, so the model can place a hole, slot or boss just by naming the face, and Leviathan works out the coordinates), and any face you've picked. Ask *"a 6 mm hole through the middle"* or *"a 10 mm lip around the top"* and the model answers in the CAD library's own language, against the part as it stands β `result = part - cylinder(h=20, d=6).move(40, 30, -1)` β which Leviathan runs in the same locked-down runner as everything else and lands as **one step in the history**: βΆ Undo takes it back. If its script fails, the error goes back to it once to repair; anything outside the safe CAD subset never runs at all; and an answer to a question changes nothing. It works on its own **Token budget** in [Settings].**And by instruction β a model that knows where it is.** Bottom right sits a chat with the model you've picked β shown as chips above it, the same pick Inline Studio and the Graph use, so the model you chose in one tab is the model in the next β or **β ANI**, answering from your knowledge banks. The old trap with models and 3D tools is that the model never knows what it's looking at, so it guesses; the Planner hands it the part instead β its real size in millimetres, how it was made, every face and hole measured from the part itself (each with an id, so the model can place a hole, slot or boss just by naming the face, and Leviathan works out the coordinates), and any face you've picked. With a small model, click the face you mean first: asked for a 5 mm screw hole "through the middle of this face" with the base's top picked, Qwen 2.5 Coder 7B got it right 20 times in 20 across two phone stands; asked for the same hole "through the middle of the base" with nothing picked, 10 in 10 on one stand and 2 in 10 on the other β working out *which* face you mean is the hard part for a 7B. Ask *"a 6 mm hole through the middle"* or *"a 10 mm lip around the top"* and the model answers in the CAD library's own language, against the part as it stands β `result = part - cylinder(h=20, d=6).move(40, 30, -1)` β which Leviathan runs in the same locked-down runner as everything else and lands as **one step in the history**: βΆ Undo takes it back. If its script fails, the error goes back to it once to repair; anything outside the safe CAD subset never runs at all; and an answer to a question changes nothing. It works on its own **Token budget** in [Settings].
That closes the loop Leviathan is built around: **you type, a model designs it β in the Graph or right here β it becomes a watertight part, and the [Fabricator] proves it printable and writes the 3MF/STL a printer takes.** When the Fabricator flags something, **β Ask the model to fix it** brings the part back here with the findings, and the model's fix arrives as one more undoable step. You say what you want; a model builds it β and then makes it real.
57 unmodified lines**πΉ 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*.- **π£ ANI background voice** β on by default. ANI speaks through your loaded chat model for free; with nothing loaded she can *also* use a small model of yours, set in the field below it, as her voice β freed the instant you mount a model. 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.77 unmodified lines**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.- **A small model of yours can stand in when nothing is loaded.** Leviathan ships no model of its own; you bring yours. So that ANI can still answer when you *haven't* mounted a chat model, you can point **Settings β ANI β ANI binder** at a small `.lev` of your own (a 1B ~1 GB or a 3B ~2 GB is plenty), and it becomes her voice in that moment. **The instant you load a chat 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.** The binder speaks *only* from the knowledge ANI retrieved, held to it by a grounding check: a reply that strays from what she found is dropped, and you get the retrieved text instead. The knowledge is ANI's; the binder just gives it a mouth.- **Entirely optional, and off-switchable.** Leave the binder field blank and nothing extra ever loads. 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:
leviathan-readme.md+22-19