Text Generation
Transformers
Safetensors
English
llama
small-language-model
efficient
edge-deployment
speculative-decoding
tiny-model
12m-parameters
kaggle-trained
educational
research
low-resource
cpu-inference
mobile-deployment
preview
stentor2
tokenmonster
Eval Results (legacy)
text-generation-inference
Instructions to use StentorLabs/Stentor2-12M-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use StentorLabs/Stentor2-12M-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="StentorLabs/Stentor2-12M-Preview")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("StentorLabs/Stentor2-12M-Preview") model = AutoModelForCausalLM.from_pretrained("StentorLabs/Stentor2-12M-Preview", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use StentorLabs/Stentor2-12M-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "StentorLabs/Stentor2-12M-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StentorLabs/Stentor2-12M-Preview", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/StentorLabs/Stentor2-12M-Preview
- SGLang
How to use StentorLabs/Stentor2-12M-Preview 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 "StentorLabs/Stentor2-12M-Preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StentorLabs/Stentor2-12M-Preview", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "StentorLabs/Stentor2-12M-Preview" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StentorLabs/Stentor2-12M-Preview", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use StentorLabs/Stentor2-12M-Preview with Docker Model Runner:
docker model run hf.co/StentorLabs/Stentor2-12M-Preview
Download loss_chart.png from StentorLabs/Stentor2-12M-Preview: direct link, hf CLI and curl.
- Browser
- Download file 141 kB
-
https://huggingface.co/StentorLabs/Stentor2-12M-Preview/resolve/main/loss_chart.png
- Command line
-
hf download hf://StentorLabs/Stentor2-12M-Preview/loss_chart.png
-
curl -L -o loss_chart.png https://huggingface.co/StentorLabs/Stentor2-12M-Preview/resolve/main/loss_chart.png
141 kB

- Xet hash:
- cabb7242266340d96f3b47dfab07e86fcbc110c7355e6d97641cdc7a9343d146
- Size of remote file:
- 141 kB
- SHA256:
- 5f0bd3b5ed6cb80bd7f3159be56e2a552a4db9631a5bd2f1ae16da280586dfb7
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.