LFM3 1.7B for Nushell tool calls, 4-bit ONNX

The 4-bit ONNX build of LFM3 1.7B (onnx-community/LFM3-1.7B-ONNX) with the Nushell LoRA added as low-rank branches beside each quantised weight. It is what the browser demo loads with Transformers.js on WebGPU. 1.10 GB.

Under ONNX Runtime it returns the reference value on 22 of 24 held-out requests; the 8-bit MLX model with the same adapter gets the same 22.

import { AutoModelForCausalLM, AutoTokenizer } from "@huggingface/transformers";

const id = "maxhugger/nushell-lfm3-1.7b-onnx";
const tokenizer = await AutoTokenizer.from_pretrained(id);
const model = await AutoModelForCausalLM.from_pretrained(id, { dtype: "q4f16", device: "webgpu" });

The prompt format (system prompt, tool, assistant prefix) is in prompt_format.json of the adapter repository; webgpu-demo/index.html in the code repository builds it.

On all 231 held-out requests Well-formed Runs Returns the reference value 95% interval Seconds per request
LFM3 1.7B with this adapter 100% 98% 92.6% (214) 88.5–95.4% 1.18
gpt-6-luna (reasoning off) 100% 74% 22.1% (51) 17.2–27.9% 2.05
claude-haiku-5-5 100% 90% 13.0% (30) 9.3–17.9% 1.10

The base model, before training, is correct on 8% of the 40 requests it was run on (3 of 40); the adapter gets 95% of those 40. The other models got the same system prompt, tool and user text, with no examples. There is one reference value per request and it is compared exactly, so a call that answers in another shape counts as wrong. Times are not like for like: ours is generation on one Mac with MLX, the others are whole requests to a hosted endpoint.

(Those figures are for the 8-bit MLX model with the adapter.)

Links

Sources

Base model: LiquidAI/LFM3-1.7B. Method: Hu et al., LoRA: Low-Rank Adaptation of Large Language Models, ICLR 2022 (arXiv:2106.09685). Commands and their signatures: Nushell 0.117.0. Sampling weights: the Nushell book and cookbook; NL2Bash (Lin et al., LREC 2018); spignelon/bash_history; Shell Aliases on GitHub (Schröder & Cito, 2022). The full list is in the repository's CITATIONS.md.

Downloads last month
62
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for maxhugger/nushell-lfm3-1.7b-onnx

Quantized
(1)
this model

Dataset used to train maxhugger/nushell-lfm3-1.7b-onnx

Space using maxhugger/nushell-lfm3-1.7b-onnx 1

Paper for maxhugger/nushell-lfm3-1.7b-onnx