Instructions to use maxhugger/nushell-lfm3-1.7b-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use maxhugger/nushell-lfm3-1.7b-onnx with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'maxhugger/nushell-lfm3-1.7b-onnx');
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
- Code, notebook and how everything was made: maxtheman/nushell-lfm
- LoRA adapter (MLX): maxhugger/nushell-lfm3-1.7b-lora
- ONNX build for the browser: maxhugger/nushell-lfm3-1.7b-onnx
- Dataset: maxhugger/nushell-tool-calls
- Demo in the browser: nushell-lfm-demo
- Nushell in WebAssembly on its own: nu-wasm
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
Model tree for maxhugger/nushell-lfm3-1.7b-onnx
Base model
LiquidAI/LFM3-1.7B-Base