Run this model with HF Jobs
Run tiny-random/opt on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/tiny-random/opt. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/tiny-random/opt on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/tiny-random/opt. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/tiny-random/opt. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use tiny-random/opt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/opt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiny-random/opt")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiny-random/opt") model = AutoModelForCausalLM.from_pretrained("tiny-random/opt", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tiny-random/opt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/opt" # 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/opt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tiny-random/opt
- SGLang
How to use tiny-random/opt 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/opt" \ --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/opt", "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/opt" \ --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/opt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tiny-random/opt with Docker Model Runner:
docker model run hf.co/tiny-random/opt
|
Download README.md from tiny-random/opt: direct link, hf CLI and curl.
- Browser
- Download file 2.54 kB
-
https://huggingface.co/tiny-random/opt/resolve/main/README.md
- Command line
-
hf download hf://tiny-random/opt/README.md
-
curl -L -o README.md https://huggingface.co/tiny-random/opt/resolve/main/README.md
2.54 kB
metadata
library_name: transformers
pipeline_tag: text-generation
base_model:
- facebook/opt-125m
This is a randomly initialized tiny model based on facebook/opt-125m for testing and debugging.
| Feature | Source | This repo |
|---|---|---|
| Parameters | 125.24M | 7.36M |
| Weight files | pytorch_model.bin, 250.54MB (FP32/FP16; source ships no safetensors) | 14.73 MB (model.safetensors) |
| Layers | 12 | 4 |
| Hidden width / FFN width | 768 / 3,072 | 128 / 512 |
| Attention heads / head_dim | 12 / 64 | 4 / 32 |
| Vocabulary rows / embedding tying | 50,272 / tied | Same |
| Maximum context length | 2,048 | 1,024 |
| Stored precision | FP16 config | BF16 |
| File path | Size |
|---|---|
| model.safetensors | 14.7MB |
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="sdpa").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/opt")
SGLang (✅ verified)
SGLang 0.5.10 ships a native OPTForCausalLM implementation; serve the tiny checkpoint with tensor parallelism:
sglang serve --model-path tiny-random/opt --tp 4 \
--dtype bfloat16 --context-length 1024 --host 0.0.0.0 --port 30000
Send an OpenAI completion request:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:30000/v1", api_key="EMPTY")
resp = client.completions.create(
model="tiny-random/opt", prompt="The quick brown fox", max_tokens=8, temperature=0
)
print(resp.choices[0].text)
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 facebook/opt-125m source with four decoder layers and head dimension 32.
This repo is generated by GPT-6.1-Sol.