Instructions to use justinbalexander/LFM2-8B-A1B-STQ2.0-patchset with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use justinbalexander/LFM2-8B-A1B-STQ2.0-patchset with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16 # Run inference directly in the terminal: llama cli -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16 # Run inference directly in the terminal: llama cli -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16 # Run inference directly in the terminal: ./llama-cli -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
Use Docker
docker model run hf.co/justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
- Llama new
- LM Studio
- Jan
- Ollama
How to use justinbalexander/LFM2-8B-A1B-STQ2.0-patchset with Ollama:
ollama run hf.co/justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
- Unsloth Desktop
- Pi
How to use justinbalexander/LFM2-8B-A1B-STQ2.0-patchset with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use justinbalexander/LFM2-8B-A1B-STQ2.0-patchset with Docker Model Runner:
docker model run hf.co/justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
- Lemonade
How to use justinbalexander/LFM2-8B-A1B-STQ2.0-patchset with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
Run and chat with the model
lemonade run user.LFM2-8B-A1B-STQ2.0-patchset-F16
List all available models
lemonade list
- Hermes Agent
How to use justinbalexander/LFM2-8B-A1B-STQ2.0-patchset with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use justinbalexander/LFM2-8B-A1B-STQ2.0-patchset with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "justinbalexander/LFM2-8B-A1B-STQ2.0-patchset:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
LFM2-8B-A1B STQ2.0 patchset
Simulated quantization builds of LiquidAI/LFM2-8B-A1B, used to measure what
the STQ encoder formats do to model quality before any quantization kernel or
storage format is committed.
Files
| file | format | weight coding | expert tensors patched | sha256-16 |
|---|---|---|---|---|
SIM-LV7-f16.gguf |
levels7 | 7 uniform levels, 3 bits | 66 | 0f32f3e36b48e5bd |
SIM-STQ2_0-f16.gguf |
stq2_0 | 4-lane groups, one forced zero, 2.0 bpw | 66 | f0e1dbfb21f4796d |
manifests/levels7.recipe.json |
levels7 | the build inputs for this format | โ | โ |
manifests/stq2_0.recipe.json |
stq2_0 | the build inputs for this format | โ | โ |
Both model files are 16,685,562,560 bytes.
What a SIM file is
A SIM file is an F16 container whose expert tensors hold the format's reconstructed values. The builder reads each expert tensor, applies the format's own encoder, applies its decoder, and writes the result back as F16.
- Patched: the 66 expert tensors,
blk.2toblk.23, namelyffn_gate_exps.weight,ffn_down_exps.weightandffn_up_exps.weightโ 22 layers x 3 tensors, 32 experts per layer. - Untouched: the other 190 tensors. Attention, embeddings, norms and the output head stay F16 or F32.
The source model holds 256 tensors. The file size does not change: F16 in, F16 out.
Why we build them this way
- The measurement belongs to the format. The file runs on the standard F16 code path. No new kernel takes part, so a change in perplexity or in a prompt battery comes from the format's arithmetic alone.
- The arithmetic is exact. The builder applies the same encode then decode pair that a real deployment applies. Nothing is approximated or modelled by a stand-in.
- The tensor scope matches the deployment. A deployment of these formats quantizes only the expert bank and leaves attention at F16. A SIM file has the same scope, so the measurement isolates the part of the model that the format exists to compress.
- The cost is low. A build takes about 8 to 30 minutes and needs no quantization kernel. A format can therefore be judged before storage work is committed to it.
What a SIM file is not
- Not a size result. The file is 16.7 GB because storage stays F16.
- Not a whole-model quantization. Attention is not quantized.
- Not a deployable quantized model.
Framing rule. Report a result from these files as "expert bank at N bpw + F16 attention". Never as a whole-model result. A comparison against Q4_K_M needs the same note, because Q4_K_M quantizes attention as well.
The two formats
levels7 (LV7)
- 7 uniform levels:
-d, -2d/3, -d/3, 0, +d/3, +2d/3, +d - 3 bits per weight
- one scale per 256 weights, fitted by least squares and weighted by the importance matrix
- encoder:
quantize_row_levels7_im
stq2_0 (STQ2.0)
- one group of 4 lanes is coded in one byte
- exactly one lane in the group is forced to zero (the
3:4layout) - the other three lanes take
{+/-d/2, +/-d} - 4 x 4^3 = 256 patterns per group, so 2.0 bpw
- one scale per 256 weights; the zero lane is chosen by incremental cost
- encoder:
quantize_row_stq2_0_im
Recipe
Each format records its inputs:
{
"mode": "levels7",
"source_gguf": "models/LFM2-8B-A1B-F16.gguf",
"source_sha1mib": "f7a0eca7197c29b8",
"imatrix": "models/lfm2_q4_400.imatrix",
"imatrix_sha1mib": "00a64d607c40ef36",
"encoder_lib": "tests_stq/libenc.so",
"encoders_used": {"all": "quantize_row_levels7_im"},
"tensors_patched": 66,
"created_utc": "..."
}
modeselects the encoder in the builder.source_sha1mibis the SHA-256 of the first MiB of the source GGUF.imatrixsupplies the per-weight importance that the scale fit and the zero placement use.tensors_patchedcounts the expert tensors rewritten. It is 66 in every build here.
Rebuild
Toolchain: github.com/justinbalexander/llama.cpp, branch stq1_0-cpu-moe.
- Build the encoder library
tests_stq/libenc.sofrom that branch. - Run the builder:
python3 tests_stq/patch_c.py <source.gguf> <out.gguf> <imatrix> <mode> - Compare the SHA-256 of the output with the value in the table.
The SHA-256 is the identity of a published file. A rebuild reproduces it only when the encoder commit, the source model and the importance matrix are the same.
Artifacts
Large artifacts live in this repository, not on a laptop and not on a rented
pod. Pods are deleted and local disks are limited. The model files here were
uploaded from a GPU pod by pod_upload.py, which uses
HfApi.upload_large_folder.
- Downloads last month
- 28
16-bit
Model tree for justinbalexander/LFM2-8B-A1B-STQ2.0-patchset
Base model
LiquidAI/LFM2-8B-A1B