Instructions to use Zual/Triolet-1.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Zual/Triolet-1.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Zual/Triolet-1.7B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Zual/Triolet-1.7B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Zual/Triolet-1.7B", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - MLX
How to use Zual/Triolet-1.7B with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("Zual/Triolet-1.7B") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Zual/Triolet-1.7B 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 Zual/Triolet-1.7B:BF16 # Run inference directly in the terminal: llama cli -hf Zual/Triolet-1.7B:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Zual/Triolet-1.7B:BF16 # Run inference directly in the terminal: llama cli -hf Zual/Triolet-1.7B:BF16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Zual/Triolet-1.7B:BF16 # Run inference directly in the terminal: ./build/bin/llama cli -hf Zual/Triolet-1.7B:BF16
Use Docker
docker model run hf.co/Zual/Triolet-1.7B:BF16
- Llama new
- LM Studio
- Jan
- vLLM
How to use Zual/Triolet-1.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Zual/Triolet-1.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zual/Triolet-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Zual/Triolet-1.7B:BF16
- SGLang
How to use Zual/Triolet-1.7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Zual/Triolet-1.7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zual/Triolet-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Zual/Triolet-1.7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zual/Triolet-1.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Zual/Triolet-1.7B with Ollama:
ollama run hf.co/Zual/Triolet-1.7B:BF16
- Unsloth Desktop
- Pi
How to use Zual/Triolet-1.7B with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Zual/Triolet-1.7B"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Zual/Triolet-1.7B" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Zual/Triolet-1.7B with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Zual/Triolet-1.7B"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Zual/Triolet-1.7B" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zual/Triolet-1.7B", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use Zual/Triolet-1.7B with Docker Model Runner:
docker model run hf.co/Zual/Triolet-1.7B:BF16
- Lemonade
How to use Zual/Triolet-1.7B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Zual/Triolet-1.7B:BF16
Run and chat with the model
lemonade run user.Triolet-1.7B-BF16
List all available models
lemonade list
- Hermes Agent
How to use Zual/Triolet-1.7B with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Zual/Triolet-1.7B"
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 Zual/Triolet-1.7B
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Zual/Triolet-1.7B with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Zual/Triolet-1.7B"
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 "Zual/Triolet-1.7B" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Triolet 1.7B
A 1.7B reasoning model with ternary weights (−1, 0, +1) that runs entirely in your browser: 355 MB, no server, works offline, 20.7 tokens/s on an iPhone 11.
Try it in your browser · Article (English) · Article (français) · Source code (engine and page) · Technical details
Triolet 1.7B is LiquidAI/LFM3-1.7B distilled into ternary weights at LISN (Université Paris-Saclay, CNRS). It keeps most of its teacher's quality at about a tenth of its size, and scores higher than the larger Ternary-Bonsai-2-2B on all ten benchmarks we ran (on two of them, by less than one standard error), and far above Ternary-Bonsai-1.7B and BitNet b1.58 2B.
Results
Same protocol for every model: EvalScope + vLLM, thinking on, temperature 0.6, top-p 0.95, up to 32,768 generated tokens, final answer graded. Standard errors in parentheses.
| Benchmark | Triolet 1.7B | Ternary-Bonsai-2-2B | Ternary-Bonsai-1.7B | BitNet b1.58 2B ² | LFM3-1.7B (BF16) |
|---|---|---|---|---|---|
| IFEval | 92.1 (1.2) | 87.4 | 73.0 | 53.0 | 94.6 |
| IFBench | 55.7 (3.0) | 48.2 | 19.1 | 12.4 | 68.4 |
| Multi-IF (turn 1, strict) | 88.1 (0.5) | 82.8 | 64.6 | n/a | 91.7 |
| GSM8K | 90.1 (0.8) | 81.7 | 65.3 | 70.4 | 93.5 |
| MATH-500 | 83.6 (1.7) | 78.4 | 51.6 | 42.6 | 97.0 |
| MMLU-Redux | 70.3 (0.6) | 67.9 | 53.7 | 46.1 | 79.8 |
| MuSR | 59.7 (1.8) | 59.0 | 47.8 | 37.8 | 61.2 |
| GPQA Diamond | 38.9 (3.5) | 36.9 | 30.3 | 23.2 | 61.1 |
| LiveCodeBench v6 | 27.4 (3.4) | 18.3 | 9.1 | 3.4 | 54.9 |
| Mean of the nine | 67.3 | 62.3 | 46.1 | 36.2² | 78.0 |
| HumanEval+ ¹ | 89.0 (2.4) | 51.8 | 44.5 | 34.1 | 91.5 |
¹ Scored with the same script for all models and kept out of the mean: our audit found fragments of 7 HumanEval+ reference solutions in training prompts. Browser engine check: on 304 GSM8K, MATH-500 and IFEval questions put to both, the int8 browser engine solves as many as the BF16 reference (265 each; −5.5 / +6.3 / +2.1 points, none significant). Contamination audit, second-seed run and browser-engine fidelity are in TECHNICAL.md.
² BitNet b1.58 2B was run with llama.cpp at its native 4,096-token context without thinking; Multi-IF dialogues do not fit, so its mean covers eight benchmarks. Ternary-Bonsai-1.7B was capped at 30,720 generated tokens (32,768-token context). Chart sizes are the authors' distributed files (Q2_0 for Bonsai, i2_s for BitNet); accuracy is the BF16 reference checkpoint for Triolet.
Files
| File | Size | Use |
|---|---|---|
model.safetensors |
3.46 GB | Dense BF16, Transformers / vLLM |
engine/Triolet-1.7B-QW35.bin + engine/tokenizer-lfm3-80k.bin |
354.5 MB + 3.9 MB | C/WebAssembly browser engine, int8 activations (guide) |
GGUF/ |
0.86–3.47 GB | llama.cpp: BF16, Q2_0 and PTQ1_0 (guide) |
MLX/ |
0.92 GB | Apple MLX (guide) |
Quick start
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "Zual/Triolet-1.7B"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16)
messages = [{"role": "user", "content": "What is a triangle? Answer in one sentence."}]
inputs = tokenizer.apply_chat_template(messages, return_dict=True, return_tensors="pt",
add_generation_prompt=True, enable_thinking=False).to(model.device)
output = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(output[0, inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
vllm serve Zual/Triolet-1.7B --trust-remote-code --dtype bfloat16 # vLLM ≥ 0.34
For reasoning tasks, set enable_thinking=True and allow a few thousand new tokens.
Frugal by design
- To run: one 355 MB download, about 500 MB of memory in the browser, no server. It runs on a laptop or a phone — 20.7 tokens/s on an iPhone 11 (2019) — and keeps working offline.
- To train: 572 H100 GPU-hours for the final recipe (89 to generate the teacher's answers, 483 for the ternary distillation on 16 GPUs for about 30 hours); about 1,440 including preliminary experiments and evaluations. That is at most 0.4 MWh for the GPUs (700 W each), roughly 20 kg CO2e on the French grid, or 1,100–1,700 USD at public cloud prices. Pre-training of the base model by Liquid AI is not included.
How it was made
Quantization-aware distillation: the ternary student learns to match LFM3-1.7B's next-token distribution over its complete long reasoning traces, with simulated int8 activations. 900,000 prompts (code, maths, science, instructions, long documents; training splits only), 18.4 billion tokens, 16 H100 GPUs on the Jean Zay supercomputer (IDRIS, GENCI). Each projection is stored as trits with one FP16 scale per 128 weights, behind a block Hadamard rotation; the tied embedding is ternary too.
This work was granted access to the HPC resources of IDRIS under the allocation 2026-A0201017402 made by GENCI.
Limitations
- On long coding problems the reasoning can run out of budget (47% unfinished on LiveCodeBench, versus 26% for Ternary-Bonsai-2-2B); on MATH-500 it finishes more often (8% versus 18%).
- Like any small model it can state false facts; the browser demo can search Wikipedia to check.
- Long contexts, languages other than French and English, and tool use were not evaluated.
License
Weights under the LFM Open License v1.0 inherited from LFM3-1.7B: open weights, not an open-source license; commercial use is limited to entities under USD 10 million in annual revenue. LFM3-1.7B was created by Liquid AI, Inc.; the ternary training, vocabulary pruning and release formats are modifications by LISN, described in NOTICE.
Citation
@misc{pommeret2026triolet,
title = {Triolet 1.7B: a ternary language model that runs in the browser},
author = {Pommeret, Luc},
year = {2026},
organization = {LISN, Universit{\'e} Paris-Saclay, CNRS},
howpublished = {\url{https://huggingface.co/Zual/Triolet-1.7B}}
}
- Downloads last month
- -
Quantized
Model tree for Zual/Triolet-1.7B
Evaluation results
- Prompt-level strict accuracy (%) on IFEvalself-reported92.100
- Prompt-level strict accuracy (%) on IFBenchself-reported55.700
- Strict accuracy, turn 1 (%) on Multi-IF (turn 1 strict)self-reported88.100
- Accuracy (%) on GSM8Kself-reported90.100
- Accuracy (%) on MATH-500self-reported83.600
- Accuracy (%) on MMLU-Reduxself-reported70.300
- Accuracy (%) on MuSRself-reported59.700
- Accuracy (Diamond) (%) on GPQA Diamondself-reported38.900
