About

  • Note(1) 2026-10-26: Ternary-Bonsai-2-4B-Q2_0.llamafile uploaded as Ternary-Bonsai-2-4B-Q2_0.llamafile.exe, to simplify running it on Windows.
    • NB: It is not unlikely (see note(2) below) that Windows will do everything in its power to prevent one from running its binary; while it was made in good faith, please make your own judgement, run antivirus scans, try it in a VM first, etc etc -- the author ran the file on a few platforms before uploading, but takes no responsibility for any consequences of running this -- if it kills all your kittens, it's on you and please don't come back complaining.
  • Note(2) 2026-10-26: apparently, VirusTotal does not like the llamafiles and marks them "suspicious". There's not much I can do there, I guess -- by the looks of it, it also slaps the same stamp on Mozilla AI' own llamafiles. So let us wait untill the other scanners try it; until then -- feel free to e.g. ClamAV scan them after download, and/or also feel free to redo it yourself and observe the same reaction from the scanners.
    • Also, a prevous test have shown that only one of all those 75 engines (named "SecureAge") marks this binary as "malicious", and its comment says "Acronis (Static ML)" -- whatever that means. Well, the binary does have an embedded LLM (which is like the whole point here), so may be this is what causes this misunderstanding.

A llamafile is a universal (APE) single-file executable, which is based on llama.cpp-built binaries. It contains an embedded LLM model and can provide a console and/or a web interface to chat with it.

  • "and/or" here has a literal meaning -- one can either run a console chat (--chat), or a web server (--server), or -- by default -- both.
  • NB(1): by default the web server attempts to listen on all available interfaces -- run it as --host 127.0.0.1 to make it private to your system only!
    • (this does not seem to be the case anymore)
  • NB(2): there's also a cli completion interface (--cli), if you wish -- check the docs!

How to use:

Building references:

Default arguments:

For example, one might want to try these:

temperature=0.6, top_p=0.95, top_k=20, min_p=0.0, presence_penalty=0.0, repetition_penalty=1.0

// recommended (unsloth) for coding in thinking mode:
--ctx-size 16384 --temp 0.6 --top-p 0.95  --top-k 20  --min-p 0.00 \
    --chat-template-kwargs '{"enable_thinking":true}'

// recommended (unsloth) for reasoning tasks:
--ctx-size 16384 --temp 1.0  --top-p 0.95 --top-k 20  --min-p 0.00 \

To enable "thinking mode" (slower but better results):

--chat-template-kwargs '{"enable_thinking":true}'

Extra recommendations -- try the following if generation falls into an endless loop:

presence_penalty = 0.0 to 1.5

Quirks:

For some quirks and workarounds (like how to make this run on WSL), see the second link above; in particular, if you are seeing a message like this:

Cannot open assembly '...': File does not contain a valid CIL image.

The reason might be that you have wine installed and it tries to run the executable (and fails). There are workarounds available -- see above; one simple way to bypass this and make llamafiles work on a Unix system (e.g. Linux and/or MacOS X) is to run them as shell scripts (yes, they are shell scripts):

sh /path/to/llamafile -h # and if you can now see the help output, then likely it just worked )
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for thread13/Ternary-Bonsai-2-4B-llamafile

Finetuned
Qwen/Qwen3.5-4B
Finetuned
(1)
this model

Collection including thread13/Ternary-Bonsai-2-4B-llamafile