{"id":21721041,"url":"https://github.com/huggingface/smollm","last_synced_at":"2025-10-14T15:30:21.009Z","repository":{"id":263665839,"uuid":"883143171","full_name":"huggingface/smollm","owner":"huggingface","description":"Everything about the SmolLM and SmolVLM family of models ","archived":false,"fork":false,"pushed_at":"2025-07-11T10:49:47.000Z","size":1789,"stargazers_count":2910,"open_issues_count":35,"forks_count":187,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-07-18T07:45:31.845Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://huggingface.co/HuggingFaceTB","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huggingface.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-04T13:01:54.000Z","updated_at":"2025-07-18T07:33:42.000Z","dependencies_parsed_at":"2024-11-19T19:52:56.489Z","dependency_job_id":"046dc952-9238-43af-b65c-0f38a858d9e8","html_url":"https://github.com/huggingface/smollm","commit_stats":null,"previous_names":["huggingface/smollm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/huggingface/smollm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fsmollm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fsmollm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fsmollm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fsmollm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huggingface","download_url":"https://codeload.github.com/huggingface/smollm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fsmollm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265801583,"owners_count":23830438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-26T02:03:13.611Z","updated_at":"2025-10-14T15:30:20.990Z","avatar_url":"https://github.com/huggingface.png","language":"Python","funding_links":[],"categories":["🧠 SOTA 2024-2025: Mobile LLMs \u0026 Multimodal","A01_文本生成_文本对话","Miscellaneous","Python","Small language models (SLM)","HuggingFace SmolLM (v2 Oct. 2024)","Mobile-First LLMs"],"sub_categories":["🤖 On-Device Large Language Models","大语言对话模型及数据"],"readme":"# Smol Models 🤏\n\nWelcome to Smol Models, a family of efficient and lightweight AI models from Hugging Face. Our mission is to create fully open powerful yet compact models, for text and vision, that can run effectively on-device while maintaining strong performance.\n\n## [NEW] SmolLM3 (Language Model)\n![image](https://github.com/user-attachments/assets/2bf61ea2-8d2e-426b-ba40-0242d34325d2)\n\nOur 3B model outperforms Llama 3.2 3B and Qwen2.5 3B while staying competitive with larger 4B alternatives (Qwen3 \u0026 Gemma3). Beyond the performance numbers, we're sharing exactly how we built it using public datasets and training frameworks.\n\nRessources:\n- [SmolLM3-Base](https://hf.co/HuggingFaceTB/SmolLM3-3B-Base)\n- [SmolLM3](https://hf.co/HuggingFaceTB/SmolLM3-3B)\n- [blog](https://hf.co/blog/smollm3)\n\nSummary:\n- **3B model** trained on 11T tokens, SoTA at the 3B scale and competitive with 4B models\n- **Fully open model**, open weights + full training details including public data mixture and training configs\n- **Instruct model** with **dual mode reasoning,** supporting think/no_think modes\n- **Multilingual support** for 6 languages: English, French, Spanish, German, Italian, and Portuguese\n- **Long context** up to 128k with NoPE and using YaRN\n\n![image](https://github.com/user-attachments/assets/f1b76d3b-af2b-4218-91b3-4ce815bdf0a8)\n\n## 👁️ SmolVLM (Vision Language Model)\n[SmolVLM](https://huggingface.co/HuggingFaceTB/SmolVLM-Instruct) is our compact multimodal model that can:\n- Process both images and text and perform tasks like visual QA, image description, and visual storytelling\n- Handle multiple images in a single conversation\n- Run efficiently on-device\n\n## Repository Structure\n```\nsmollm/\n├── text/               # SmolLM3/2/1 related code and resources\n├── vision/            # SmolVLM related code and resources\n└── tools/             # Shared utilities and inference tools\n    ├── smol_tools/    # Lightweight AI-powered tools\n    ├── smollm_local_inference/\n    └── smolvlm_local_inference/\n```\n\n## Getting Started\n\n### SmolLM3\n```python\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\nmodel_name = \"HuggingFaceTB/SmolLM3-3B\"\ndevice = \"cuda\"  # for GPU usage or \"cpu\" for CPU usage\n\n# load the tokenizer and the model\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_name,\n).to(device)\n\n# prepare the model input\nprompt = \"Give me a brief explanation of gravity in simple terms.\"\nmessages_think = [\n    {\"role\": \"user\", \"content\": prompt}\n]\n\ntext = tokenizer.apply_chat_template(\n    messages_think,\n    tokenize=False,\n    add_generation_prompt=True,\n)\nmodel_inputs = tokenizer([text], return_tensors=\"pt\").to(model.device)\n\n# Generate the output\ngenerated_ids = model.generate(**model_inputs, max_new_tokens=32768)\n\n# Get and decode the output\noutput_ids = generated_ids[0][len(model_inputs.input_ids[0]) :]\nprint(tokenizer.decode(output_ids, skip_special_tokens=True))\n```\n\n### SmolVLM\n```python\nfrom transformers import AutoProcessor, AutoModelForVision2Seq\n\nprocessor = AutoProcessor.from_pretrained(\"HuggingFaceTB/SmolVLM-Instruct\")\nmodel = AutoModelForVision2Seq.from_pretrained(\"HuggingFaceTB/SmolVLM-Instruct\")\n\nmessages = [\n    {\n        \"role\": \"user\",\n        \"content\": [\n            {\"type\": \"image\"},\n            {\"type\": \"text\", \"text\": \"What's in this image?\"}\n        ]\n    }\n]\n```\n\n## Ecosystem\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://cdn-uploads.huggingface.co/production/uploads/61c141342aac764ce1654e43/RvHjdlRT5gGQt5mJuhXH9.png\" width=\"700\"/\u003e\n\u003c/div\u003e\n\n## Resources\n\n### Documentation\n- [SmolLM3 Documentation](text/README.md)\n- [SmolLM2 paper](https://arxiv.org/abs/2502.02737v1)\n- [SmolVLM Documentation](vision/README.md)\n- [Local Inference Guide](tools/README.md)\n\n### Pretrained Models\n- [SmolLM3 Models Collection](https://huggingface.co/collections/HuggingFaceTB/smollm3-686d33c1fdffe8e635317e23)\n- [SmolLM2 Models Collection](https://huggingface.co/collections/HuggingFaceTB/smollm2-6723884218bcda64b34d7db9)\n- [SmolVLM Model](https://huggingface.co/HuggingFaceTB/SmolVLM-Instruct)\n\n### Datasets\n- [SmolLM3 Pretraining dataset](https://huggingface.co/collections/HuggingFaceTB/smollm3-pretraining-datasets-685a7353fdc01aecde51b1d9)\n- [SmolTalk](https://huggingface.co/datasets/HuggingFaceTB/smoltalk) - Our instruction-tuning dataset\n- [FineMath](https://huggingface.co/datasets/HuggingFaceTB/finemath) - Mathematics pretraining dataset\n- [FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) - Educational content pretraining dataset\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuggingface%2Fsmollm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuggingface%2Fsmollm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuggingface%2Fsmollm/lists"}