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

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.

Downloads last month
134
Safetensors
Model size
7.36M params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for tiny-random/opt

Finetuned
(107)
this model

Collection including tiny-random/opt