Bonsai-27B-GGUF
lmstudio-community · Kit
A GGUF conversion of the 27B Bonsai model for LM Studio, with a 3.80 GB Q1_0 language file and a 0.93 GB BF16 vision projector. Tested for text, vision and par…
Chats, rewrites and summarizes text and can call functions, in a compact 1.7B model small enough to run on-device. The instruction-tuned SmolLM2 from HuggingFaceTB, for developers who want a small English model.
SmolLM2-1.7B-Instruct is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install transformers
SmolLM2-1.7B-Instruct is the instruction-tuned 1.7B model in SmolLM2, a family of compact language models from HuggingFaceTB that comes in 135M, 360M and 1.7B sizes. The family is small enough for on-device use. This instruct version also handles text rewriting, summarization and function calling.
Developers and hobbyists who want a small English chat model that runs on a laptop, in a terminal or in a browser. The weights carry the Apache 2.0 license.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Software | App developers | Run a small chat model on a device or in the browser | A browser demo built with Transformers.js |
| Productivity | Writers | Rewrite or summarize short texts locally | Shortening a paragraph before sending it |
| Education | Students | Learn how small language models are trained and run | Chatting from the terminal with the TRL command |
If you need strong grade-school math, another model may serve you better, because the card's base-model table puts Qwen2.5-1.5B well ahead on GSM8K.
| Use case | Who | What they get back |
|---|---|---|
| Local chat | Everyday users | Short answers from a model on your own device |
| Text rewriting | Writers | A reworded version of your text |
| Function calling | App developers | Replies that name a function to call |
pip install transformers
pip install -U huggingface_hub hf download HuggingFaceTB/SmolLM2-1.7B-Instruct
In Python you load the tokenizer and model, wrap a message in the chat template and generate a reply.
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "HuggingFaceTB/SmolLM2-1.7B-Instruct"
device = "cuda" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
# for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
messages = [{"role": "user", "content": "What is the capital of France."}]
input_text=tokenizer.apply_chat_template(messages, tokenize=False)
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs, max_new_tokens=50, temperature=0.2, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0]))To chat from the terminal on a CPU, install trl and run its chat command.
pip install trl trl chat --model_name_or_path HuggingFaceTB/SmolLM2-1.7B-Instruct --device cpu
In JavaScript, the Transformers.js package builds a text generation pipeline.
npm i @huggingface/transformers
import { pipeline } from "@huggingface/transformers";
// Create a text generation pipeline
const generator = await pipeline(
"text-generation",
"HuggingFaceTB/SmolLM2-1.7B-Instruct",
);
// Define the list of messages
const messages = [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Tell me a joke." },
];
// Generate a response
const output = await generator(messages, { max_new_tokens: 128 });
console.log(output[0].generated_text.at(-1).content);| Tool | What it does |
|---|---|
| transformers | Loads and runs the model in Python |
| trl chat | Opens a terminal chat with the model |
| Transformers.js | Runs the model from JavaScript with a text generation pipeline |
You send the Python script the message "What is the capital of France." It prints the decoded reply, with generation stopped after 50 new tokens.
A first small thing to try is the terminal chat command, since it needs no code. Type a question and read the reply.
The 1.7B model was trained on 11 trillion tokens drawn from FineWeb-Edu, DCLM, The Stack and newly curated math and coding sets. The instruct version came from supervised fine-tuning on public and curated data, followed by Direct Preference Optimization with UltraFeedback. Function calling and rewriting come from datasets made by Argilla.
Chats, rewrites and summarizes text and can call functions, in a compact 1.7B model small enough to run on-device. The instruction-tuned SmolLM2 from HuggingFaceTB, for developers who want a small English model.
Made by HuggingFaceTB on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: SmolLM2-1.7B-Instruct is the instruction-tuned 1.7B model in SmolLM2, a family of compact language models from HuggingFaceTB that comes in 135M, 360M and 1.7B sizes. The family is small enough for on-device use. This instruct version also handles text rewriting, summarization and function calling.
Who it suits: Developers and hobbyists who want a small English chat model that runs on a laptop, in a terminal or in a browser. The weights carry the Apache 2.0 license.
Industry | Who uses it | How they use it | Example
Software | App developers | Run a small chat model on a device or in the browser | A browser demo built with Transformers.js
Productivity | Writers | Rewrite or summarize short texts locally | Shortening a paragraph before sending it
Education | Students | Learn how small language models are trained and run | Chatting from the terminal with the TRL command
If you need strong grade-school math, another model may serve you better, because the card's base-model table puts Qwen2.5-1.5B well ahead on GSM8K.
Where to use it:
Use case | Who | What they get back
Local chat | Everyday users | Short answers from a model on your own device
Text rewriting | Writers | A reworded version of your text
Function calling | App developers | Replies that name a function to call
How to set it up:
pip install transformers
pip install -U huggingface_hub
hf download HuggingFaceTB/SmolLM2-1.7B-Instruct
How to use it: In Python you load the tokenizer and model, wrap a message in the chat template and generate a reply.
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "HuggingFaceTB/SmolLM2-1.7B-Instruct"
device = "cuda" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
# for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)
messages = [{"role": "user", "content": "What is the capital of France."}]
input_text=tokenizer.apply_chat_template(messages, tokenize=False)
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs, max_new_tokens=50, temperature=0.2, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0]))
To chat from the terminal on a CPU, install trl and run its chat command.
pip install trl
trl chat --model_name_or_path HuggingFaceTB/SmolLM2-1.7B-Instruct --device cpu
In JavaScript, the Transformers.js package builds a text generation pipeline.
npm i @huggingface/transformers
import { pipeline } from "@huggingface/transformers";
// Create a text generation pipeline
const generator = await pipeline(
"text-generation",
"HuggingFaceTB/SmolLM2-1.7B-Instruct",
);
// Define the list of messages
const messages = [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Tell me a joke." },
];
// Generate a response
const output = await generator(messages, { max_new_tokens: 128 });
console.log(output[0].generated_text.at(-1).content);
Tool | What it does
transformers | Loads and runs the model in Python
trl chat | Opens a terminal chat with the model
Transformers.js | Runs the model from JavaScript with a text generation pipeline
Example: You send the Python script the message "What is the capital of France." It prints the decoded reply, with generation stopped after 50 new tokens.
For newcomers and experts: A first small thing to try is the terminal chat command, since it needs no code. Type a question and read the reply.
The 1.7B model was trained on 11 trillion tokens drawn from FineWeb-Edu, DCLM, The Stack and newly curated math and coding sets. The instruct version came from supervised fine-tuning on public and curated data, followed by Direct Preference Optimization with UltraFeedback. Function calling and rewriting come from datasets made by Argilla.
Pre-train on 11 trillion tokens
Supervised fine-tune on instructions
Tune with Direct Preference Optimization
Load it with transformers
Chat or call functions
Good to know:
Title: HellaSwag scores of the base models
SmolLM2-1.7B: 68.7
Qwen2.5-1.5B: 66.4
SmolLM1-1.7B: 62.9
Llama-1B: 61.2
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download HuggingFaceTB/SmolLM2-1.7B-Instruct
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 6 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| SmolLM2-1.7B-Instruct This page | 267,519 | 772 | 1.7B | apache-2.0 | |
| SmolLM2-135M-InstructShares tensorboard · transformers.js · llama | 841,106 | 474 | 135M | apache-2.0 | |
| SmolLM2-360M-InstructShares tensorboard · transformers.js · llama | 221,273 | 244 | 362M | apache-2.0 | |
| Distil-Whisper distil-large-v3Shares tensorboard · transformers.js · onnx | 754,155 | 386 | 756M | mit | |
| nomic-embed-text-v1.5Shares transformers.js · onnx · transformers | 11,809,681 | 994 | 137M | apache-2.0 | |
| OpenAI Privacy FilterShares transformers.js · onnx · transformers | 102,911 | 1,831 | 1.4B | apache-2.0 |
Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.
lmstudio-community · Kit
A GGUF conversion of the 27B Bonsai model for LM Studio, with a 3.80 GB Q1_0 language file and a 0.93 GB BF16 vision projector. Tested for text, vision and par…
LibertAIDAI · Kit
Runs DeepSeek-V4.1-Flash-1017 as a 2.9 bits-per-weight EXL3 quantization, a 196 GiB copy for people serving large models on their own hardware. Perplexity stay…
facebook · Kit
Generates short music clips from a text description or an audio prompt, in the small checkpoint of facebook's MusicGen. It suits developers and music hobbyists…
alpindale · Kit
Tags every character of C source code for syntax highlighting with a tiny neural network of about 984 weights, run through a small C program. For developers an…
prithivMLmods · Kit
Try a set of LoRAs for the FLUX.2 Klein image model in a Gradio app that runs in your browser or on your own computer. Made for people who make or test AI imag…
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…