Text Generation
Transformers
Safetensors
English
dwarf
bash
shell
linux
cli
code
small-language-model
conversational
custom_code
Instructions to use ThingAI/Dwarf-15M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ThingAI/Dwarf-15M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ThingAI/Dwarf-15M", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ThingAI/Dwarf-15M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ThingAI/Dwarf-15M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ThingAI/Dwarf-15M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThingAI/Dwarf-15M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ThingAI/Dwarf-15M
- SGLang
How to use ThingAI/Dwarf-15M 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 "ThingAI/Dwarf-15M" \ --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": "ThingAI/Dwarf-15M", "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 "ThingAI/Dwarf-15M" \ --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": "ThingAI/Dwarf-15M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ThingAI/Dwarf-15M with Docker Model Runner:
docker model run hf.co/ThingAI/Dwarf-15M
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,11 +12,11 @@ tags:
|
|
| 12 |
- small-language-model
|
| 13 |
pipeline_tag: text-generation
|
| 14 |
model-index:
|
| 15 |
-
- name: Dwarf-15M
|
| 16 |
results: []
|
| 17 |
---
|
| 18 |
|
| 19 |
-
# Dwarf-15M
|
| 20 |
|
| 21 |
A **15.54M parameter** shell/bash specialist language model that translates natural language into Linux commands.
|
| 22 |
|
|
@@ -25,8 +25,8 @@ A **15.54M parameter** shell/bash specialist language model that translates natu
|
|
| 25 |
```python
|
| 26 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 27 |
|
| 28 |
-
tokenizer = AutoTokenizer.from_pretrained("ThingAI/Dwarf-15M
|
| 29 |
-
model = AutoModelForCausalLM.from_pretrained("ThingAI/Dwarf-15M
|
| 30 |
|
| 31 |
prompt = "<|user|>\nFind all Python files modified in the last 3 days\n<|end|>\n<|assistant|>\n"
|
| 32 |
inputs = tokenizer(prompt, return_tensors="pt")
|
|
@@ -79,7 +79,7 @@ Dwarf-15M takes natural language descriptions of tasks and produces the correspo
|
|
| 79 |
- English: helpful-instructions, FineWeb — 10.3%
|
| 80 |
- CoT: Magpie-Reasoning — 1.1%
|
| 81 |
|
| 82 |
-
**SFT:**
|
| 83 |
|
| 84 |
**Tokenizer:** [DwarfGoToken](https://huggingface.co/ThingAI/DwarfGoToken) — 8,202 token BPE with syntax-aware pre-tokenization for shell operators (2>&1, &&, >>).
|
| 85 |
|
|
@@ -122,7 +122,7 @@ Apache 2.0
|
|
| 122 |
|
| 123 |
```bibtex
|
| 124 |
@misc{dwarf15m2026,
|
| 125 |
-
title={Dwarf-15M
|
| 126 |
author={ThingsAI},
|
| 127 |
year={2026},
|
| 128 |
url={https://huggingface.co/ThingAI/Dwarf-15M-Instruct}
|
|
|
|
| 12 |
- small-language-model
|
| 13 |
pipeline_tag: text-generation
|
| 14 |
model-index:
|
| 15 |
+
- name: Dwarf-15M
|
| 16 |
results: []
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# Dwarf-15M
|
| 20 |
|
| 21 |
A **15.54M parameter** shell/bash specialist language model that translates natural language into Linux commands.
|
| 22 |
|
|
|
|
| 25 |
```python
|
| 26 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 27 |
|
| 28 |
+
tokenizer = AutoTokenizer.from_pretrained("ThingAI/Dwarf-15M", trust_remote_code=True)
|
| 29 |
+
model = AutoModelForCausalLM.from_pretrained("ThingAI/Dwarf-15M", trust_remote_code=True)
|
| 30 |
|
| 31 |
prompt = "<|user|>\nFind all Python files modified in the last 3 days\n<|end|>\n<|assistant|>\n"
|
| 32 |
inputs = tokenizer(prompt, return_tensors="pt")
|
|
|
|
| 79 |
- English: helpful-instructions, FineWeb — 10.3%
|
| 80 |
- CoT: Magpie-Reasoning — 1.1%
|
| 81 |
|
| 82 |
+
**SFT:** 900 curated Linux command pairs, 5 epochs, lr=4e-5. Training time: 19 seconds.
|
| 83 |
|
| 84 |
**Tokenizer:** [DwarfGoToken](https://huggingface.co/ThingAI/DwarfGoToken) — 8,202 token BPE with syntax-aware pre-tokenization for shell operators (2>&1, &&, >>).
|
| 85 |
|
|
|
|
| 122 |
|
| 123 |
```bibtex
|
| 124 |
@misc{dwarf15m2026,
|
| 125 |
+
title={Dwarf-15M: A Shell Specialist Language Model},
|
| 126 |
author={ThingsAI},
|
| 127 |
year={2026},
|
| 128 |
url={https://huggingface.co/ThingAI/Dwarf-15M-Instruct}
|