Instructions to use roneneldan/TinyStories-1M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use roneneldan/TinyStories-1M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="roneneldan/TinyStories-1M")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("roneneldan/TinyStories-1M") model = AutoModelForCausalLM.from_pretrained("roneneldan/TinyStories-1M", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use roneneldan/TinyStories-1M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "roneneldan/TinyStories-1M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "roneneldan/TinyStories-1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/roneneldan/TinyStories-1M
- SGLang
How to use roneneldan/TinyStories-1M 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 "roneneldan/TinyStories-1M" \ --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": "roneneldan/TinyStories-1M", "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 "roneneldan/TinyStories-1M" \ --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": "roneneldan/TinyStories-1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use roneneldan/TinyStories-1M with Docker Model Runner:
docker model run hf.co/roneneldan/TinyStories-1M
License for the released checkpoints?
Hi Ronen β thank you for TinyStories; the 1M checkpoint is a gift for teaching.
I'm building a free, open, bilingual interactive essay ("Inside the Machine") and a small zero-dependency TypeScript library that reimplements the GPT-Neo forward pass and runs your TinyStories-1M weights entirely in the browser, so readers can watch a real model tokenize, attend over, and continue their own sentence. To do that I convert the checkpoint to fp16 safetensors and self-host the 7.5 MB file alongside the site (schools' content filters often block huggingface.co, so runtime fetching isn't an option in classrooms).
The model card doesn't carry a license field. Could you confirm under what terms the released checkpoints may be redistributed β e.g. MIT or Apache-2.0, as many derivative repos assume? If you'd rather I not redistribute, I'll fall back to fetching from the Hub at runtime where possible.
I credit the paper and this repo prominently either way. The project is live at https://insidethemachine.org (free, no ads, no data collection), and the code is MIT on GitHub: https://github.com/toolbooth/nano-lm and https://github.com/toolbooth/llm-explainer.
Thanks,
Shangyan Shen
I comfirm that this is under MIT license.
Hi @roneneldan ,
Can you please review my work.
I did it starting from your work then added mine experiments in it.
PDF: https://huggingface.co/sraivante/tinystories-35m/resolve/main/arxiv/report.pdf
All checkpoints, code and raw result files: https://huggingface.co/sraivante/tinystories-35m
Archived copy (Zenodo DOI): https://doi.org/10.5281/zenodo.23489983
Endorsement code: AAFTFX
Endorsement page: https://arxiv.org/auth/endorse
Please see if you can endorse it. This will ne my first research paper in arxive.
And i will be highly obeliged.
I am new in this field.
PDF: https://huggingface.co/sraivante/tinystories-35m/resolve/main/arxiv/report.pdf
All checkpoints, code and raw result files: https://huggingface.co/sraivante/tinystories-35m
Archived copy (Zenodo DOI): https://doi.org/10.5281/zenodo.23489983
Endorsement code: AAFTFX
Endorsement page: https://arxiv.org/auth/endorse
@roneneldan Please review:
Endorsement code: AAFTFX
Endorsement page: https://arxiv.org/auth/endorse
Please see if you can endorse it. This will ne my first research paper in arxive.
And i will be highly obeliged.
I am new in this field.