Instructions to use Lythri/Lythri-7B-A4B-Q4_0_8-GGUF 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 Lythri/Lythri-7B-A4B-Q4_0_8-GGUF 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 Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0 # Run inference directly in the terminal: llama cli -hf Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0 # Run inference directly in the terminal: llama cli -hf Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
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 Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0 # Run inference directly in the terminal: ./llama-cli -hf Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
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 Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
Use Docker
docker model run hf.co/Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
- LM Studio
- Jan
- vLLM
How to use Lythri/Lythri-7B-A4B-Q4_0_8-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lythri/Lythri-7B-A4B-Q4_0_8-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lythri/Lythri-7B-A4B-Q4_0_8-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
- Ollama
How to use Lythri/Lythri-7B-A4B-Q4_0_8-GGUF with Ollama:
ollama run hf.co/Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
- Unsloth Desktop
- Pi
How to use Lythri/Lythri-7B-A4B-Q4_0_8-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
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": "Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Lythri/Lythri-7B-A4B-Q4_0_8-GGUF with Docker Model Runner:
docker model run hf.co/Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
- Lemonade
How to use Lythri/Lythri-7B-A4B-Q4_0_8-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
Run and chat with the model
lemonade run user.Lythri-7B-A4B-Q4_0_8-GGUF-Q4_0
List all available models
lemonade list
- Hermes Agent
How to use Lythri/Lythri-7B-A4B-Q4_0_8-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
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 Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Lythri/Lythri-7B-A4B-Q4_0_8-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0
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 "Lythri/Lythri-7B-A4B-Q4_0_8-GGUF:Q4_0" \ --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"
Lythri-7B-A4B-Q4_0_8-GGUF
This repository contains the Q4_0_8 quantization of Lythri-7B-A4B. Q4_0_8 is a mixed-precision quantization proposed in the Lythri technical report: critical tensors (attention projections, ffn_down, PLE gates) are kept at Q8_0 while the remaining tensors use Q4_0. Both formats support native SIMD dot-product acceleration, delivering Q6_K-level quality with 1.16–1.76× faster prefill on models ≥4B.
For model details, evaluation results and limitations, see the original model card.
Why Q4_0_8
Lythri models are highly sensitive to quantization. Standard 4-bit formats (Q4_0, Q4_K_M) cause noticeable quality loss, while Q6_K preserves quality but is slower due to its multi-level scale structure. Q4_0_8 provides a middle ground:
| Q4_0 | Q6_K | Q4_0_8 | |
|---|---|---|---|
| Quality | ✗ Degraded | ✓ Good | ✓ Near Q6_K |
| HW Accel | ✓ Yes | ✗ No | ✓ Yes |
| Speed | Fast | Slow | Fast |
Usage
llama.cpp
llama-cli -hf Lythri/Lythri-7B-A4B-Q4_0_8-GGUF -m <file>.gguf --temp 0.7 --top-p 0.9 --top-k 64 --repeat-penalty 1.05
Ollama
ollama run hf.co/Lythri/Lythri-7B-A4B-Q4_0_8-GGUF
LM Studio
Search for Lythri/Lythri-7B-A4B-Q4_0_8-GGUF in the model browser and download.
Q4_0_8 Quantization Guide
Q4_0_8 uses Q4_0 as the base type and overrides critical tensors to Q8_0, achieving Q6_K-level quality with 1.16–1.76× faster prefill via native SIMD dot-product acceleration.
Build llama.cpp
git clone --depth 1 https://github.com/ggerganov/llama.cpp
cd llama.cpp
pip install gguf
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc) --target llama-quantize
Convert & Quantize
# Step 1: Convert HF model to F16 GGUF
python3 convert_hf_to_gguf.py /path/to/model \
--outfile model-F16.gguf --outtype f16
# Step 2: Quantize with Q4_0_8 rules
# Standard Transformer (all architectures):
build/bin/llama-quantize \
--tensor-type "attn_q=q8_0" \
--tensor-type "attn_k=q8_0" \
--tensor-type "attn_v=q8_0" \
--tensor-type "attn_output=q8_0" \
--tensor-type "ffn_down=q8_0" \
model-F16.gguf model-Q4_0_8.gguf q4_0
# For FFN+PLE architectures (e.g. Gemma 4 E2B/E4B), add:
# --tensor-type "inp_gate=q8_0"
# --tensor-type "proj=q8_0"
Tensor Assignment Rules
| Tensor | Quant | Rationale |
|---|---|---|
attn_q, attn_k |
Q8_0 | Softmax sensitivity |
attn_v, attn_output |
Q8_0 | Residual stream writer |
ffn_down |
Q8_0 | Residual stream writer |
ffn_gate, ffn_up |
Q4_0 | Layer-internal, SiLU-attenuated |
inp_gate* |
Q8_0 | Sub-network activation control |
proj* |
Q8_0 | AltUp residual projection |
*Extended rules for FFN+PLE architectures only.
Citation
@techreport{li2026lythri,
title = {Lythri Technical Report},
author = {Li, Jiawen},
year = {2026},
institution = {Zenodo},
doi = {10.5281/zenodo.23179311},
url = {https://doi.org/10.5281/zenodo.23179311}
}
License
Lythri is built on Gemma 4 and is released under the Apache License 2.0.
- Downloads last month
- 247
4-bit