Run this model with HF Jobs
Run Azrail/smallm_70 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/Azrail/smallm_70. 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/Azrail/smallm_70 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/Azrail/smallm_70. 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.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Azrail/smallm_70. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Azrail/smallm_70 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Azrail/smallm_70 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Azrail/smallm_70", 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("Azrail/smallm_70", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Azrail/smallm_70 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Azrail/smallm_70" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Azrail/smallm_70", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Azrail/smallm_70
- SGLang
How to use Azrail/smallm_70 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 "Azrail/smallm_70" \ --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": "Azrail/smallm_70", "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 "Azrail/smallm_70" \ --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": "Azrail/smallm_70", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Azrail/smallm_70 with Docker Model Runner:
docker model run hf.co/Azrail/smallm_70
SmalLM
SmalLM is a series of small transformer models built from scratch for language modeling. This project is designed to explore innovative approaches to transformer architectures through modular pipelines for pretraining, fine-tuning, and alignment.
Uses
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Azrail/smallm_70")
model = AutoModelForCausalLM.from_pretrained("Azrail/smallm_70", trust_remote_code=True)
inputs = tokenizer("How are you?", return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.batch_decode(out))
Model Details**
Key Features:
Grouped Query Attention (GQA).
Mixture-of-Experts with auxiliary loss-free balancing.
ALiBi (Attention with Linear Biases) or Rotary Position Embedding (RoPE).
NTK-by-parts RoPE interpolation for extends context length.
Pre-Training:
| Model | Training Data | Steps | Content Length | Tokens | LR | Batch Size | Precision |
|---|---|---|---|---|---|---|---|
| SmalLM-70M | smollm-corpus | 70k | 1024 | 18B | 1e-3 | 0.25M | bfloat16 |
| SmalLM-150M | smollm-corpus | - | 1024 | - | - | - | bfloat16 |
| SmalLM-350M | smollm-corpus | - | 1024 | - | - | - | bfloat16 |
| SmalLM-500M | smollm-corpus | - | 1024 | - | - | - | bfloat16 |
Evaluation: Evaluation runing with lm-evaluation-harness
| Model | MMLU | ARC easy/hard | PIQA | HellaSwag | OBQA | Winogrande |
|---|---|---|---|---|---|---|
| SmalLM-70M | 25.33 | 51.47/25.68 | 61.75 | 30.31 | 30.8 | 50.83 |
| SmalLM-150M | - | - | - | - | - | - |
| SmalLM-350M | - | - | - | - | - | - |
| SmalLM-500M | - | - | - | - | - | - |
Procedure:
Framework versions
- Transformers 4.50.3
- Pytorch 2.6.0+cu126
- Datasets 3.5.0
- Tokenizers 0.21.1
- Downloads last month
- 123
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "Azrail/smallm_70"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Azrail/smallm_70", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'