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
stentor2
tokenmonster
conversational
Eval Results (legacy)
text-generation-inference
Instructions to use StentorLabs/Stentor2-12M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use StentorLabs/Stentor2-12M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="StentorLabs/Stentor2-12M") 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("StentorLabs/Stentor2-12M") model = AutoModelForCausalLM.from_pretrained("StentorLabs/Stentor2-12M", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use StentorLabs/Stentor2-12M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "StentorLabs/Stentor2-12M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StentorLabs/Stentor2-12M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/StentorLabs/Stentor2-12M
- SGLang
How to use StentorLabs/Stentor2-12M 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" \ --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": "StentorLabs/Stentor2-12M", "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 "StentorLabs/Stentor2-12M" \ --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": "StentorLabs/Stentor2-12M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use StentorLabs/Stentor2-12M with Docker Model Runner:
docker model run hf.co/StentorLabs/Stentor2-12M
Update README.md
Browse files
README.md
CHANGED
|
@@ -23,16 +23,17 @@ tags:
|
|
| 23 |
pipeline_tag: text-generation
|
| 24 |
datasets:
|
| 25 |
- epfml/FineWeb-HQ
|
|
|
|
| 26 |
thumbnail: https://huggingface.co/StentorLabs/Stentor2-12M/resolve/main/thumbnail.png
|
| 27 |
widget:
|
| 28 |
-
- text:
|
| 29 |
-
example_title:
|
| 30 |
-
- text:
|
| 31 |
-
example_title:
|
| 32 |
-
- text:
|
| 33 |
-
example_title:
|
| 34 |
-
- text:
|
| 35 |
-
example_title:
|
| 36 |
model_card_authors:
|
| 37 |
- StentorLabs
|
| 38 |
model-index:
|
|
@@ -541,7 +542,7 @@ PyTorch's SDPA implementation handles numerical stability internally and require
|
|
| 541 |
|
| 542 |
### Dataset
|
| 543 |
|
| 544 |
-
The model was trained on **FineWeb-HQ** ([epfml/FineWeb-HQ](https://huggingface.co/datasets/epfml/FineWeb-HQ)) —
|
| 545 |
|
| 546 |
**Total tokens processed:** 480,116,736 (~480M, budget-limited run)
|
| 547 |
**Source tokens (raw data):** 240,000,000 (240M source token budget)
|
|
|
|
| 23 |
pipeline_tag: text-generation
|
| 24 |
datasets:
|
| 25 |
- epfml/FineWeb-HQ
|
| 26 |
+
- StentorLabs/StenCore
|
| 27 |
thumbnail: https://huggingface.co/StentorLabs/Stentor2-12M/resolve/main/thumbnail.png
|
| 28 |
widget:
|
| 29 |
+
- text: Once upon a time
|
| 30 |
+
example_title: Story Generation
|
| 31 |
+
- text: Explain neural networks in simple terms.
|
| 32 |
+
example_title: Toy Explanation (Often Wrong)
|
| 33 |
+
- text: 'def fibonacci(n):'
|
| 34 |
+
example_title: Code Continuation
|
| 35 |
+
- text: The laws of thermodynamics describe
|
| 36 |
+
example_title: Science Continuation
|
| 37 |
model_card_authors:
|
| 38 |
- StentorLabs
|
| 39 |
model-index:
|
|
|
|
| 542 |
|
| 543 |
### Dataset
|
| 544 |
|
| 545 |
+
The model was trained on **FineWeb-HQ and StenCore** ([epfml/FineWeb-HQ](https://huggingface.co/datasets/epfml/FineWeb-HQ)) and ([StentorLabs/StenCore](https://huggingface.co/datasets/StentorLabs/StenCore))— high-quality filtered web and PDF corpuses.
|
| 546 |
|
| 547 |
**Total tokens processed:** 480,116,736 (~480M, budget-limited run)
|
| 548 |
**Source tokens (raw data):** 240,000,000 (240M source token budget)
|