Mindket

SmolLM2-1.7B-Instruct

Newversion 1 · updated

Overview

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.

At a glance

You need
  • Python, or Node for the JavaScript route
  • The transformers package, or trl, or the Transformers.js package, depending on how you run it
  • Room for the weights, about 3.4 GB in BF16, or about 856 MB at 4-bit as an estimate
Runs in
  • Python with the transformers library, on a GPU or a CPU
  • A terminal, through the TRL chat command
  • JavaScript, through Transformers.js
  • Windows, macOS or Linux with Python, for downloading the files
Start with
pip install transformers

Platform

WindowsOperating system
macOSOperating system
LinuxOperating system

About

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.

IndustryWho uses itHow they use itExample
SoftwareApp developersRun a small chat model on a device or in the browserA browser demo built with Transformers.js
ProductivityWritersRewrite or summarize short texts locallyShortening a paragraph before sending it
EducationStudentsLearn how small language models are trained and runChatting 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

  • Python with the transformers library, on a GPU or a CPU
  • A terminal, through the TRL chat command
  • JavaScript, through Transformers.js
  • Windows, macOS or Linux with Python, for downloading the files
Use caseWhoWhat they get back
Local chatEveryday usersShort answers from a model on your own device
Text rewritingWritersA reworded version of your text
Function callingApp developersReplies that name a function to call

How to set it up

  • Python, or Node for the JavaScript route
  • The transformers package, or trl, or the Transformers.js package, depending on how you run it
  • Room for the weights, about 3.4 GB in BF16, or about 856 MB at 4-bit as an estimate
  1. Install Python and the transformers package with the first block below.
  2. Optionally copy the model files with Hugging Face's two commands in the second block.
  3. For terminal chat, install trl, and for JavaScript, install the Transformers.js package.
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);
ToolWhat it does
transformersLoads and runs the model in Python
trl chatOpens a terminal chat with the model
Transformers.jsRuns 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.

  1. Pre-train on 11 trillion tokens
  2. Supervised fine-tune on instructions
  3. Tune with Direct Preference Optimization
  4. Load it with transformers
  5. Chat or call functions

Good to know

  • License: Apache 2.0
  • Cost to run: none named
  • Data it reaches: the download fetches files from Hugging Face, and the source names nothing else
  • Language: English
  • The card's scores were run zero-shot with lighteval unless it says otherwise
HellaSwag scores of the base models
SmolLM2-1.7B68.7
Qwen2.5-1.5B66.4
SmolLM1-1.7B62.9
Llama-1B61.2

README and files

README

SmolLM2-1.7B-Instruct

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.

About

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:

  • Python with the transformers library, on a GPU or a CPU
  • A terminal, through the TRL chat command
  • JavaScript, through Transformers.js
  • Windows, macOS or Linux with Python, for downloading the files
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:

  • Python, or Node for the JavaScript route
  • The transformers package, or trl, or the Transformers.js package, depending on how you run it
  • Room for the weights, about 3.4 GB in BF16, or about 856 MB at 4-bit as an estimate
  1. Install Python and the transformers package with the first block below.
  2. Optionally copy the model files with Hugging Face's two commands in the second block.
  3. For terminal chat, install trl, and for JavaScript, install the Transformers.js package.
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:

  • License: Apache 2.0
  • Cost to run: none named
  • Data it reaches: the download fetches files from Hugging Face, and the source names nothing else
  • Language: English
  • The card's scores were run zero-shot with lighteval unless it says otherwise
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

On Hugging Face, 13 November 2026

  • Task: text generation
  • Library: transformers
  • Parameters: 1.7B
  • Weights: about 3.4 GB in BF16; about 856 MB at 4-bit (estimate)
  • Formats: Safetensors
  • Downloads in the last 30 days: 267,519
  • Likes: 772
  • License: apache-2.0
  • Languages: en
  • Based on: HuggingFaceTB/SmolLM2-1.7B
  • Quantized versions: 131
  • Fine-tunes: 168
  • Tags: transformers, tensorboard, onnx, safetensors, llama, text-generation, transformers.js, conversational

Links

Get the model

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.

Files
README.md  6 KB

1 file, 6 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-13

Compare with similar

Listed Hugging Face models in the same category that share the most tags with this one.

ProductDownloads, last 30 daysLikesParametersLicenseLast change
SmolLM2-1.7B-Instruct This page267,5197721.7Bapache-2.0
SmolLM2-135M-InstructShares tensorboard · transformers.js · llama841,106474135Mapache-2.0
SmolLM2-360M-InstructShares tensorboard · transformers.js · llama221,273244362Mapache-2.0
Distil-Whisper distil-large-v3Shares tensorboard · transformers.js · onnx754,155386756Mmit
nomic-embed-text-v1.5Shares transformers.js · onnx · transformers11,809,681994137Mapache-2.0
OpenAI Privacy FilterShares transformers.js · onnx · transformers102,9111,8311.4Bapache-2.0
Numbers as Mindket last read them, on 2026-11-13.

Reviews

No ratings yet

Write a review

No reviews yet.

What people say

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.

Searched

More from Mindket

See all from Mindket

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…

New

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…

New

MusicGen Small

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…

New

Similar in Developer

See all in Developer

Lexnet

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…

New

FLUX.2 Klein LoRA Studio

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…

New

anaksor-ocr

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…

New