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 lines9101112131415161718197 unmodified lines2728293031323334357 unmodified lines434445464748498 unmodified lines58596061626364656667686970715 unmodified lines777879808182838 unmodified lines92939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561574 unmodified lines1621631641658 unmodified lines- onnx- transformers.jsbase_model:- HuggingFaceTB/SmolLM2-135M---# SmolLM27 unmodified lines## Model SummarySmolLM2 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.02737SmolLM2 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"device = "cuda" # for GPU usage or "cpu" for CPU usagetokenizer = AutoTokenizer.from_pretrained(checkpoint)8 unmodified linesprint(tokenizer.decode(outputs[0]))```### Chat in TRLYou 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 cpu```### Transformers.js```bashnpm i @huggingface/transformers5 unmodified lines// Create a text generation pipelineconst generator = await pipeline("text-generation","HuggingFaceTB/SmolLM2-135M-Instruct",);// Define the list of messages8 unmodified lines// "The capital of France is Paris."```## EvaluationIn 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.## Base 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 |## Instruction model| 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 |## LimitationsSmolLM2 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### Model- **Architecture:** Transformer decoder- **Pretraining tokens:** 2T- **Precision:** bfloat16### Hardware- **GPUs:** 64 H100### Software- **Training Framework:** [nanotron](https://github.com/huggingface/nanotron/tree/main)## 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 linesprimaryClass={cs.CL},url={https://arxiv.org/abs/2502.02737},}```8 unmodified lines9101112131415161718197 unmodified lines27282930313233343536377 unmodified lines454647484950518 unmodified lines606162636465666768697071727374755 unmodified lines818283848586878 unmodified lines969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551564 unmodified lines1611621631648 unmodified lines- onnx- transformers.jsbase_model:- Dimonomi/BWork-LLM---# BWork-LLM7 unmodified lines## Model SummaryBWork-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.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 = "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 TRLYou can also use the TRL CLI to chat with the model from the terminal:```bashpip install trltrl chat --model_name_or_path Dimonomi/BWork-LLM --device cpu```Transformers.js```bashnpm i @huggingface/transformers5 unmodified lines// Create a text generation pipelineconst generator = await pipeline("text-generation","Dimonomi/BWork-LLM",);// Define the list of messages8 unmodified lines// "The capital of France is Paris."```EvaluationIn 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 modelMetrics 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.0Instruction 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.4LimitationsBWork-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.TrainingModel路 Architecture: Transformer decoder路 Pretraining tokens: 2T路 Precision: bfloat16Hardware路 GPUs: 64 H100Software路 Training Framework: nanotronLicenseApache 2.0Citation```bash@misc{allal2025smollm2smolgoesbig,title={SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model},4 unmodified linesprimaryClass={cs.CL},url={https://arxiv.org/abs/2502.02737},}```
README.md+51-52