How to use from
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/mpt" \
    --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/mpt",
		"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/mpt" \
        --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/mpt",
		"prompt": "Once upon a time,",
		"max_tokens": 512,
		"temperature": 0.5
	}'
Quick Links

This is a randomly initialized tiny model based on RedHatAI/mpt-7b-gsm8k-pt for testing and debugging.

Feature Source This repo
Parameters 6.73B 13.70M
Weight files 3 pytorch_model .bin shards, 27.42GB (BF16; source ships no safetensors) 27.40 MB (model.safetensors)
Layers 32 4
Hidden width / FFN width (4x) 4,096 / 16,384 128 / 512
Attention heads / head_dim 32 / 128 4 / 32
Position encoding learned embeddings Same, length 1,024
Norm / bias layout low-precision LayerNorm, no biases Same
Vocabulary rows / embedding tying 50,432 / tied (SharedEmbedding) Same
Stored precision BF16 Same

Transformers has not registered this MPT revision, so the pinned upstream remote code is included with attn_impl='torch'; load with trust_remote_code=True.

SGLang 0.5.10 registers no native implementation for MPTForCausalLM (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 27.4MB

Example usage

Transformers (βœ… verified)

Load the included pinned MPT implementation with trust_remote_code=True.

def run_transformers(model_id: str):
    import torch
    from transformers import AutoModelForCausalLM, AutoTokenizer

    model_id = str(model_id)
    tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
    model = (
        AutoModelForCausalLM.from_pretrained(
            model_id, trust_remote_code=True, 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, use_cache=False).logits).all()
        output = model.generate(**inputs, do_sample=False, max_new_tokens=8, use_cache=False)
    print(tokenizer.decode(output[0], skip_special_tokens=True))


if __name__ == "__main__":
    run_transformers(model_id="tiny-random/mpt")

Creating this repo

Change log

  • 2026-11-07: Initial version rebuilt from the official RedHatAI/mpt-7b-gsm8k-pt source (the Red Hat AI migration of mosaicml/mpt-7b), shipping its pinned remote code with the pure-torch attention path.

This repo is generated by GPT-6.1-Sol.

Downloads last month
112
Safetensors
Model size
13.7M 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/mpt

Finetuned
(1)
this model

Collection including tiny-random/mpt