Text Generation
Transformers
TensorBoard
ONNX
Safetensors
Transformers.js
English
llama
conversational
text-generation-inference
Run this model with HF Jobs
Run Dimonomi/BWork-LLM on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/Dimonomi/BWork-LLM. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Dimonomi/BWork-LLM on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Dimonomi/BWork-LLM. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use Dimonomi/BWork-LLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dimonomi/BWork-LLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Dimonomi/BWork-LLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Dimonomi/BWork-LLM") model = AutoModelForCausalLM.from_pretrained("Dimonomi/BWork-LLM", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Transformers.js
How to use Dimonomi/BWork-LLM with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'Dimonomi/BWork-LLM'); - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Dimonomi/BWork-LLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Dimonomi/BWork-LLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dimonomi/BWork-LLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Dimonomi/BWork-LLM
- SGLang
How to use Dimonomi/BWork-LLM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Dimonomi/BWork-LLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dimonomi/BWork-LLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Dimonomi/BWork-LLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dimonomi/BWork-LLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Dimonomi/BWork-LLM with Docker Model Runner:
docker model run hf.co/Dimonomi/BWork-LLM
The
Browse filesLllll
8 unmodified lines91011121213141516161718197 unmodified lines272829303031323332343536377 unmodified lines45464746484950518 unmodified lines606162616364656667686569707168727374755 unmodified lines81828380848586878 unmodified lines969798991009697981011021001031041021031041051061071081091101111121051061071081091101111121131141151161171151181191201211221231241251261271171181191201211221231241251261281291301311321331301341351321361371381391341401411361421431381391401441451421461471441481491461501511481521531501511521531541541551564 unmodified lines1611621631651648 unmodified lines- onnx- transformers.jsbase_model:- HuggingFaceTB/SmolLM2-135M- Dimonomi/BWork-LLM---
# SmolLM2# BWork-LLM

7 unmodified lines
## Model Summary
SmolLM2 is a family of compact language models available in three size: 135M, 360M, and 1.7B parameters. They are capable of solving a wide range of tasks while being lightweight enough to run on-device. More details in our paper https://arxiv.org/abs/2502.02737 BWork-LLM is a family of compact language models available in three size: 135M, 360M, and 1.7B parameters. They are capable of solving a wide range of tasks while being lightweight enough to run on-device. More details in our paper https://arxiv.org/abs/2502.02737
**Key Feature:** BWork-LLM has the ability to search for information on the internet through its built-in MCP (Model Context Protocol). When a user asks a question, the model sends a request to `https://yandex.by/search/?text={user_question}&lr=10274&search_source=yaby_desktop_common&src=suggest_`, opens the first 2 search result links, extracts the first 2 paragraphs from each, and passes this retrieved information to the AI for generating an informed response.
SmolLM2 demonstrates significant advances over its predecessor SmolLM1, particularly in instruction following, knowledge, reasoning. The 135M model was trained on 2 trillion tokens using a diverse dataset combination: FineWeb-Edu, DCLM, The Stack, along with new filtered datasets we curated and will release soon. We developed the instruct version through supervised fine-tuning (SFT) using a combination of public datasets and our own curated datasets. We then applied Direct Preference Optimization (DPO) using [UltraFeedback](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized).BWork-LLM demonstrates significant advances over its predecessor SmolLM1, particularly in instruction following, knowledge, reasoning. The 135M model was trained on 2 trillion tokens using a diverse dataset combination: FineWeb-Edu, DCLM, The Stack, along with new filtered datasets we curated and will release soon. We developed the instruct version through supervised fine-tuning (SFT) using a combination of public datasets and our own curated datasets. We then applied Direct Preference Optimization (DPO) using [UltraFeedback](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized).
The instruct model additionally supports tasks such as text rewriting, summarization and function calling (for the 1.7B) thanks to datasets developed by [Argilla](https://huggingface.co/argilla) such as [Synth-APIGen-v0.1](https://huggingface.co/datasets/argilla/Synth-APIGen-v0.1).You can find the SFT dataset here: https://huggingface.co/datasets/HuggingFaceTB/smol-smoltalk and finetuning code at https://github.com/huggingface/alignment-handbook/tree/main/recipes/smollm27 unmodified lines
```pythonfrom transformers import AutoModelForCausalLM, AutoTokenizercheckpoint = "HuggingFaceTB/SmolLM2-135M-Instruct"checkpoint = "Dimonomi/BWork-LLM"
device = "cuda" # for GPU usage or "cpu" for CPU usagetokenizer = AutoTokenizer.from_pretrained(checkpoint)8 unmodified linesprint(tokenizer.decode(outputs[0]))```
### Chat in TRLChat in TRL
You can also use the TRL CLI to chat with the model from the terminal:
```bashpip install trltrl chat --model_name_or_path HuggingFaceTB/SmolLM2-135M-Instruct --device cputrl chat --model_name_or_path Dimonomi/BWork-LLM --device cpu```
### Transformers.jsTransformers.js
```bashnpm i @huggingface/transformers5 unmodified lines// Create a text generation pipelineconst generator = await pipeline( "text-generation", "HuggingFaceTB/SmolLM2-135M-Instruct", "Dimonomi/BWork-LLM",);
// Define the list of messages8 unmodified lines// "The capital of France is Paris."```
Evaluation
## Evaluation
In this section, we report the evaluation results of SmolLM2. All evaluations are zero-shot unless stated otherwise, and we use [lighteval](https://github.com/huggingface/lighteval) to run them.In this section, we report the evaluation results of BWork-LLM. All evaluations are zero-shot unless stated otherwise, and we use lighteval to run them.
## Base pre-trained modelBase pre-trained model
| Metrics | SmolLM2-135M-8k | SmolLM-135M ||:-------------------|:----------------:|:------------:|| HellaSwag | **42.1** | 41.2 || ARC (Average) | **43.9** | 42.4 || PIQA | 68.4 | 68.4 || MMLU (cloze) | **31.5** | 30.2 || CommonsenseQA | **33.9** | 32.7 || TriviaQA | 4.1 | **4.3** || Winogrande | 51.3 | 51.3 || OpenBookQA | **34.6** | 34.0 || GSM8K (5-shot) | **1.4** | 1.0 |Metrics BWork-LLM-135M-8k SmolLM-135MHellaSwag 42.1 41.2ARC (Average) 43.9 42.4PIQA 68.4 68.4MMLU (cloze) 31.5 30.2CommonsenseQA 33.9 32.7TriviaQA 4.1 4.3Winogrande 51.3 51.3OpenBookQA 34.6 34.0GSM8K (5-shot) 1.4 1.0
Instruction model
## Instruction modelMetric BWork-LLM-135M-Instruct SmolLM-135M-InstructIFEval (Average prompt/inst) 29.9 17.2MT-Bench 19.8 16.8HellaSwag 40.9 38.9ARC (Average) 37.3 33.9PIQA 66.3 64.0MMLU (cloze) 29.3 28.3BBH (3-shot) 28.2 25.2GSM8K (5-shot) 1.4 1.4
| Metric | SmolLM2-135M-Instruct | SmolLM-135M-Instruct ||:-----------------------------|:---------------------:|:--------------------:|| IFEval (Average prompt/inst) | **29.9** | 17.2 || MT-Bench | **19.8** | 16.8 || HellaSwag | **40.9** | 38.9 || ARC (Average) | **37.3** | 33.9 || PIQA | **66.3** | 64.0 || MMLU (cloze) | **29.3** | 28.3 || BBH (3-shot) | **28.2** | 25.2 || GSM8K (5-shot) | 1.4 | 1.4 |Limitations
BWork-LLM models primarily understand and generate content in English. They can produce text on a variety of topics, but the generated content may not always be factually accurate, logically consistent, or free from biases present in the training data. These models should be used as assistive tools rather than definitive sources of information. Users should always verify important information and critically evaluate any generated content.
Training
## LimitationsModel
SmolLM2 models primarily understand and generate content in English. They can produce text on a variety of topics, but the generated content may not always be factually accurate, logically consistent, or free from biases present in the training data. These models should be used as assistive tools rather than definitive sources of information. Users should always verify important information and critically evaluate any generated content.路 Architecture: Transformer decoder路 Pretraining tokens: 2T路 Precision: bfloat16
## TrainingHardware
### Model路 GPUs: 64 H100
- **Architecture:** Transformer decoder- **Pretraining tokens:** 2T- **Precision:** bfloat16Software
### Hardware路 Training Framework: nanotron
- **GPUs:** 64 H100License
### SoftwareApache 2.0
- **Training Framework:** [nanotron](https://github.com/huggingface/nanotron/tree/main)Citation
## License
[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
## Citation```bash@misc{allal2025smollm2smolgoesbig, title={SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model}, 4 unmodified lines primaryClass={cs.CL}, url={https://arxiv.org/abs/2502.02737}, }``````README.md+51-52