Instructions to use tiny-random/bloom with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/bloom with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiny-random/bloom")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiny-random/bloom") model = AutoModelForCausalLM.from_pretrained("tiny-random/bloom", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiny-random/bloom with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/bloom" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/bloom", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tiny-random/bloom
- SGLang
How to use tiny-random/bloom 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 "tiny-random/bloom" \ --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": "tiny-random/bloom", "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 "tiny-random/bloom" \ --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": "tiny-random/bloom", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tiny-random/bloom with Docker Model Runner:
docker model run hf.co/tiny-random/bloom
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tiny-random/bloom")
model = AutoModelForCausalLM.from_pretrained("tiny-random/bloom", device_map="auto")This is a randomly initialized tiny model based on bigscience/bloom-560m for testing and debugging.
| Feature | Source | This repo |
|---|---|---|
| Checkpoint tensor elements | 559.21M F16 | 32.91M BF16 |
| Safetensors weight files | 1.12 GB (model.safetensors) | 65.82 MB (model.safetensors) |
| Layers | 24 | 4 |
| Hidden width / FFN width | 1,024 / 4,096 | 128 / 512 |
| Attention heads / head_dim | 16 / 64 | 4 / 32 |
| Position encoding | ALiBi | Same |
| Vocabulary rows / embedding tying | 250,880 / tied | Same |
| Stored precision | FP16 | BF16 |
The 250,880-row tied token matrix sets a lower bound of 64.23MB at hidden width 128: TP=4 requires four attention heads at head_dim 32, so the 30MB best-effort target does not fit without dropping tensor parallelism. The source BLOOM RAIL LICENSE is copied.
SGLang 0.5.10 registers no native implementation for BloomForCausalLM (no EntryClass in sglang/srt/models), so only the generic TransformersForCausalLM fallback exists, which does not shard the model across tensor-parallel ranks. Serving evidence for this repository is the Transformers example.
| File path | Size |
|---|---|
| model.safetensors | 65.8MB |
Example usage
Transformers (β verified)
def run_transformers(model_id: str):
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = str(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = (
AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, attn_implementation="eager").eval().cuda()
)
inputs = tokenizer("The quick brown fox jumps over the lazy dog.", return_tensors="pt").to("cuda")
with torch.no_grad():
assert torch.isfinite(model(**inputs).logits).all()
output = model.generate(**inputs, do_sample=False, max_new_tokens=8)
print(tokenizer.decode(output[0], skip_special_tokens=True))
if __name__ == "__main__":
run_transformers(model_id="tiny-random/bloom")
Creating this repo
- Code: .meta/create_model.py
- Model structure: .meta/model.log
- Environment: .meta/env.json
Change log
- 2026-11-07: Initial version rebuilt from the official bigscience/bloom-560m source with four layers and head dimension 32.
This repo is generated by GPT-6.1-Sol.
- Downloads last month
- 66
Model tree for tiny-random/bloom
Base model
bigscience/bloom-560m
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiny-random/bloom")