Views
No views yet

wget https://huggingface.co/FM-1976/SmolLM2-360M-it-llamafile/resolve/main/SmolLM2-360M-portable.llamafile
chmod +x SmolLM2-360M-portable.llamafile
./SmolLM2-360M-portable.llamafileSmolLM2-360M-portable.llamafile to SmolLM2-360M-portable.exehttp://127.0.0.1:8080/ and also exposed to your internal Network.http://localhost:8080/v1/stats and /context to see runtime status
information. You can change the system prompt by passing the -p "new system prompt" flag. You can press CTRL-C to interrupt the model.
Finally CTRL-D may be used to exit.--server mode is provided, that
will open a tab with a chatbot and completion interface in your browser.
For additional help on how it may be used, pass the --help flag. The
server also has an OpenAI API compatible completions endpoint that can
be accessed via Python using the openai pip package.When you launch the executable the oepnAI API server is started automatically--cli flag. For additional help on how it
may be used, pass the --help flag..args file1-m
2SmolLM2-360M-Instruct.Q8_0.gguf
3--host
40.0.0.0
5-c
68192
7...llamafile-0.9.2.exe
zipalign-0.9.2.exe<|im_start|>system
{system_prompt}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistantapply_chat_template to show you how to load the tokenizer and model and how to generate contents.1# Chat with an intelligent assistant in your terminal
2from openai import OpenAI
3import sys
4
5# Point to the local server
6client = OpenAI(base_url="http://localhost:8080/v1", api_key="not-needed")
7history = [
8 {"role": "system", "content": "You are SMOLLM2-PORTABLE, an intelligent assistant. You always provide well-reasoned answers that are both correct and helpful. Always reply in the language of the instructions."},
9 {"role": "user", "content": "Hello, introduce yourself to someone opening this program for the first time. Be concise."},
10]
11print("\033[92;1m")
12while True:
13 userinput = ""
14 completion = client.chat.completions.create(
15 model="local-model", # this field is currently unused
16 messages=history,
17 temperature=0.3,
18 frequency_penalty = 1.4,
19 max_tokens = 600,
20 stream=True,
21 )
22
23 new_message = {"role": "assistant", "content": ""}
24
25 for chunk in completion:
26 if chunk.choices[0].delta.content:
27 print(chunk.choices[0].delta.content, end="", flush=True)
28 new_message["content"] += chunk.choices[0].delta.content
29
30 history.append(new_message)
31
32 print("\033[1;30m") #dark grey
33 print("Enter your text (end input with Ctrl+D on Unix or Ctrl+Z on Windows) - type quit! to exit the chatroom:")
34 print("\033[91;1m") #red
35 lines = sys.stdin.readlines()
36 for line in lines:
37 userinput += line + "\n"
38 if "quit!" in lines[0].lower():
39 print("\033[0mBYE BYE!")
40 break
41 history = [
42 {"role": "system", "content": "You are an intelligent assistant. You always provide well-reasoned answers that are both correct and helpful."},
43 ]
44 history.append({"role": "user", "content": userinput})
45 print("\033[92;1m")
46-c 0 flag. That's big
enough for a small book. If you want to be able to have a conversation
with your book, you can use the -f book.txt flag.| Metrics | SmolLM2-360M | Qwen2.5-0.5B | SmolLM-360M |
|---|---|---|---|
| HellaSwag | 54.5 | 51.2 | 51.8 |
| ARC (Average) | 53.0 | 45.4 | 50.1 |
| PIQA | 71.7 | 69.9 | 71.6 |
| MMLU (cloze) | 35.8 | 33.7 | 34.4 |
| CommonsenseQA | 38.0 | 31.6 | 35.3 |
| TriviaQA | 16.9 | 4.3 | 9.1 |
| Winogrande | 52.5 | 54.1 | 52.8 |
| OpenBookQA | 37.4 | 37.4 | 37.2 |
| GSM8K (5-shot) | 3.2 | 33.4 | 1.6 |
| Metric | SmolLM2-360M-Instruct | Qwen2.5-0.5B-Instruct | SmolLM-360M-Instruct |
|---|---|---|---|
| IFEval (Average prompt/inst) | 41.0 | 31.6 | 19.8 |
| MT-Bench | 3.66 | 4.16 | 3.37 |
| HellaSwag | 52.1 | 48.0 | 47.9 |
| ARC (Average) | 43.7 | 37.3 | 38.8 |
| PIQA | 70.8 | 67.2 | 69.4 |
| MMLU (cloze) | 32.8 | 31.7 | 30.6 |
| BBH (3-shot) | 27.3 | 30.7 | 24.4 |
| GSM8K (5-shot) | 7.43 | 26.8 | 1.36 |
1@misc{allal2025smollm2smolgoesbig,
2 title={SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model},
3 author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Gabriel Martín Blázquez and Guilherme Penedo and Lewis Tunstall and Andrés Marafioti and Hynek Kydlíček and Agustín Piqueres Lajarín and Vaibhav Srivastav and Joshua Lochner and Caleb Fahlgren and Xuan-Son Nguyen and Clémentine Fourrier and Ben Burtenshaw and Hugo Larcher and Haojun Zhao and Cyril Zakka and Mathieu Morlon and Colin Raffel and Leandro von Werra and Thomas Wolf},
4 year={2025},
5 eprint={2502.02737},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2502.02737},
9}