Instructions to use EbukaGaus/LFM3-1.7B-sheetft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EbukaGaus/LFM3-1.7B-sheetft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EbukaGaus/LFM3-1.7B-sheetft", 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("EbukaGaus/LFM3-1.7B-sheetft", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("EbukaGaus/LFM3-1.7B-sheetft", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EbukaGaus/LFM3-1.7B-sheetft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EbukaGaus/LFM3-1.7B-sheetft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EbukaGaus/LFM3-1.7B-sheetft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EbukaGaus/LFM3-1.7B-sheetft
- SGLang
How to use EbukaGaus/LFM3-1.7B-sheetft 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 "EbukaGaus/LFM3-1.7B-sheetft" \ --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": "EbukaGaus/LFM3-1.7B-sheetft", "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 "EbukaGaus/LFM3-1.7B-sheetft" \ --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": "EbukaGaus/LFM3-1.7B-sheetft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use EbukaGaus/LFM3-1.7B-sheetft with Docker Model Runner:
docker model run hf.co/EbukaGaus/LFM3-1.7B-sheetft
LFM3-1.7B-sheetft
A LoRA fine-tune of LiquidAI/LFM3-1.7B that turns spreadsheet instructions into executable cell patches: it reads a sheet serialised as addressโvalue lines and replies with one JSON object holding the exact cells to change, or declines when the sheet cannot support the edit.
It is trained in the style of Decide's DAX-1: single-turn, structured patch output, execution-based verification (never an LLM judge), and no guessing.
Response contract
{
"status": "edited" | "declined",
"edits": {"B7": 43, "C2": "A"},
"reason": "<why, only when declined>"
}
Rules the model was trained on:
editedonly when every edit is supported by the sheet.declinedwhen information is missing (missing key, empty or gapped range, unparseable value, missing score), with the explanation inreason.editsholds only the cells the task asked to change; no collateral writes.- Plain values by default; formulas only when asked to repair one, in canonical
form (
=SUM(B2:B6)).
Prompt shape: "You are editing a spreadsheet. Here is the sheet:\n\nA1: Item\nB1: Amount\n..."
followed by Task: ..., the contract, and the decision rule. Addresses are
canonical uppercase; blank cells are omitted; sheets are serialised row-major;
multi-sheet workbooks use SheetName!A1 keys. A full prompt is included in
prompt_template.txt.
Training
| item | value |
|---|---|
| base | LiquidAI/LFM3-1.7B (instruct) |
| method | LoRA (r=32, ฮฑ=64, dropout 0.05, all-linear), merged to bf16 |
| schedule | 2 epochs, lr 5e-5 cosine, effective batch 16, max length 2560 |
| calibration | 1 extra epoch on a 50/50 decline/edit mix, lr 3e-5 |
| losses | completion-only (prompt masked) |
Data mix (declines โ 22.6% of the weighted mix):
| source | tasks | notes |
|---|---|---|
| synthetic sheetft families | 3,315 | lookup (single table + join), formula repair, aggregation, classification rules, date normalisation, plus decline cases |
| SpreadsheetBench 912 | 761 | real .xlsx workbooks, real instructions; supervised on the inputโanswer cell diff |
| FinQA train | 311 | real financial tables, program-verified addition; includes QA-shaped decline twins |
| TAT-QA train | 2,149 | real financial tables with large magnitudes, $ and thousands separators; includes decline twins |
Public data was used for training only; evaluation below includes official held-out splits of those sources. Dataset licences are the responsibility of their publishers; check them before redistributing converted data.
Evaluation
All numbers are greedy decoding (temperature 0), one attempt, exact-match verification by applying edits to the workbook and comparing every cell.
Spreadsheet editing (in-distribution, 585 tasks)
| metric | base LFM3-1.7B | this model |
|---|---|---|
| strict pass | 30.9% | 75.9% |
| parse success | 95.0% | 100% |
| status accuracy | 84.9% | 100% |
| collateral writes | 5.5% | 0.0% |
| lookup / formula / date | 54.4 / 52.2 / 86.7% | 100 / 100 / 100% |
| classification / aggregation | 3.0 / 1.7% | 80.0 / 36.7% |
Hand-written held-out set (20 tasks, novel layouts and wording)
| base | this model |
|---|---|
| 56.2% | 70.0% |
Fresh held-out data (815 tasks, never trained on)
| subset | n | base | this model |
|---|---|---|---|
| TAT-QA dev | 211 | 0.0% | 34.1% |
| TAT-QA test-gold | 195 | 0.0% | 36.9% |
| FinQA dev (pure addition) | 18 | 0.0% | 11.1% |
| FinQA dev (any operation) | 91 | 0.0% | 19.8% |
| synthetic, unseen seed | 300 | 39.7% | 84.7% |
| overall | 815 | 14.6% | 51.3% |
Collateral writes on fresh data: 0% for this model vs 22โ43% for the base.
PLUMB grounding benchmark (96 tasks, greedy decoding)
| metric | base | this model |
|---|---|---|
| fabrication rate โ | 0.0% | 31.2% |
| silent-guess rate โ | 0.0% | 0.0% |
| collateral write rate โ | 12.5% | 6.2% |
| over-refusal rate โ | 50.0% | 14.1% |
| completion rate โ | 35.9% | 39.1% |
| parse success โ | 96.9% | 100.0% |
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "EbukaGaus/LFM3-1.7B-sheetft"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
model.eval()
messages = [{"role": "user", "content": prompt}] # see prompt_template.txt
ids = tok.apply_chat_template(
messages, tokenize=True, add_generation_prompt=True,
enable_thinking=False, return_tensors="pt",
).to(model.device)
with torch.no_grad():
out = model.generate(ids, max_new_tokens=256, do_sample=False,
pad_token_id=tok.eos_token_id)
print(tok.decode(out[0][ids.shape[-1]:], skip_special_tokens=True))
The chat template ships as chat_template.jinja; load it explicitly if your
transformers build does not pick it up:
tok.chat_template = open("chat_template.jinja").read()
For production serving, constrained JSON decoding raises parse success to 100% (this is how the evaluations above were served). A permissive schema that fits both the sheetft and PLUMB contracts:
schema = {
"type": "object",
"properties": {
"status": {"type": "string"},
"answer": {"type": ["string", "number", "null"]},
"edits": {"type": "object",
"additionalProperties": {"type": ["string", "number", "null"]}},
"reason": {"type": ["string", "null"]},
},
"required": ["status"],
"additionalProperties": False,
}
Limitations
- Arithmetic at scale. Exact sums of 4โ7 operands at 5โ7 digits are the main residual error source (aggregation 36.7% strict pass). This is a 1.7B capacity limit, not a format issue; DAX-1 used a 14B base.
- Fabrication trade-off. Training on real question-answering tables raised real-table capability (0% โ ~31% on held-out real edits) but also raised fabrication on unanswerable questions (PLUMB 0% โ 31.2%). A synthetic-only variant with no public QA data trades ~20 points of real-table capability for 0% fabrication.
- English only, single-turn, text protocols. The model does not read or write
.xlsxfiles itself; the host serialises the sheet and applies the patch. - Not a general chat model; it is tuned for the patch contract.
Licence
Derivative of LiquidAI/LFM3-1.7B, distributed under the LFM Open License
v1.0 (see LICENSE). The base model's terms apply to this model
and its outputs; review them before commercial use. Training included public
research datasets (SpreadsheetBench, FinQA, TAT-QA); their terms apply to those
portions of the training data.
Files
model.safetensorsโ merged bf16 weightsadapter/โ the LoRA adapter (r=32, ฮฑ=64)train_metrics.jsonโ loss history and calibration summaryprompt_template.txtโ the exact prompt the model was trained on
- Downloads last month
- 118