Instructions to use sudhanshu42844/my-tiny-llm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sudhanshu42844/my-tiny-llm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sudhanshu42844/my-tiny-llm")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sudhanshu42844/my-tiny-llm") model = AutoModelForCausalLM.from_pretrained("sudhanshu42844/my-tiny-llm", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sudhanshu42844/my-tiny-llm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sudhanshu42844/my-tiny-llm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sudhanshu42844/my-tiny-llm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sudhanshu42844/my-tiny-llm
- SGLang
How to use sudhanshu42844/my-tiny-llm 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 "sudhanshu42844/my-tiny-llm" \ --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": "sudhanshu42844/my-tiny-llm", "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 "sudhanshu42844/my-tiny-llm" \ --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": "sudhanshu42844/my-tiny-llm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sudhanshu42844/my-tiny-llm with Docker Model Runner:
docker model run hf.co/sudhanshu42844/my-tiny-llm
TinyStories GPT-Style Language Model (1.06M Parameters)
A small decoder-only Transformer language model trained from random initialization on a subset of the TinyStories dataset. This checkpoint demonstrates causal language modeling, BPE tokenization, training, checkpoint saving, and loading through Hugging Face Transformers.
Status: Experimental proof of concept; not a production-ready or instruction-following model.
Architecture
| Property | Value |
|---|---|
| Model family | GPT-style decoder-only causal language model |
| Trainable parameters | 1,060,992 |
| Tokenizer | BPE, trained on the sampled training text |
| Vocabulary size | 3,512 |
| Training initialization | From scratch (random weights) |
| Training framework | PyTorch and Hugging Face Transformers |
Training data and setup
- Training dataset: roneneldan/TinyStories, English text,
trainsplit. - Subset used for this run: 270 training examples and 30 validation examples.
- Training epochs: 2.
- Training loss: epoch 1: 7.5319; epoch 2: 6.6421.
- Validation loss: epoch 1: 7.0656; epoch 2: 6.3688.
- Training hardware: NVIDIA GeForce GTX 1650 series GPU with 4 GB VRAM.
- Dataset license (as shown on its Hub page): CDLA-Sharing-1.0. This applies to the dataset; the model weights are licensed separately (see below).
The logged losses are specific to this small subset; they do not establish general-purpose language-model quality. There are no independent benchmark evaluations for this checkpoint.
Quick start
Install compatible PyTorch and Transformers packages, then run:
from transformers import AutoTokenizer, AutoModelForCausalLM
repo_id = "sudhanshu42844/my-tiny-llm"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id)
inputs = tokenizer("Once upon a time", return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=40,
do_sample=True,
temperature=0.8,
pad_token_id=tokenizer.pad_token_id,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Alternatively, use the local model path instead of repo_id.
Intended use
- Demonstrating GPT-style causal language model training from scratch.
- Testing Hugging Face dataset, tokenizer, and checkpoint integration.
- Experimenting with small-scale text generation.
Limitations
- Only 270 training examples were used in the reported experiment.
- Generated stories may be repetitive, ungrammatical, incoherent, or misleading.
- The model is not intended for factual question answering, safety-critical decisions, or production deployment.
- No safety, bias, robustness, or generalization evaluations have been performed.
Reproducibility
To reproduce the run, see the training program used to produce the checkpoint and specify the dataset, architecture, random seed, optimizer, and training arguments. Update this card when publishing any new version or substantially different checkpoint.
Attribution and licensing
Training data: TinyStories. The dataset is distributed under CDLA-Sharing-1.0, which continues to apply to the data itself.
The model weights, tokenizer and configuration in this repository are released under the Apache License 2.0 (Copyright 2026 Sudhanshu Shukla); see LICENSE.
- Downloads last month
- 108