How to use from
vLLM
Install from pip and serve model
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tiny-random/internlm2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
	-H "Content-Type: application/json" \
	--data '{
		"model": "tiny-random/internlm2",
		"messages": [
			{
				"role": "user",
				"content": "What is the capital of France?"
			}
		]
	}'
Use Docker
docker model run hf.co/tiny-random/internlm2
Quick Links

This is a randomly initialized tiny model based on internlm/internlm2-chat-20b for testing and debugging.

Feature Source This repo
Checkpoint tensor elements 19.86B BF16 12.65M BF16
Safetensors weight files 39.72 GB (21 files) 25.30 MB (model.safetensors)
Layers 48 4
Hidden width / MLP width 6,144 / 16,384 (2.67x) 128 / 352 (2.75x)
Q heads / KV heads / head_dim 48 / 8 (GQA 6:1) / 128 4 / 4 (MHA) / 32
RoPE base / biases 1,000,000 / none Same
Vocabulary rows / embedding tying 92,544 checkpoint / 92,550 tokenizer / untied (source) 92,550 / tied
Stored precision BF16 Same

This InternLM2 revision is not registered in the installed Transformers release, so the pinned upstream remote code is included (load with trust_remote_code=True). The untied tiny checkpoint ties the language-model head to the token embedding (the source shipped them untied), keeping the artifact at 25.30MB within the 30MB best-effort target; the source 6:1 GQA ratio cannot fit four TP=4-legal heads.

File path Size
model.safetensors 25.3MB

Example usage

Transformers (βœ… verified)

Load the included pinned InternLM2 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()
    )
    prompt = tokenizer.apply_chat_template(
        [{"role": "user", "content": "δ½ ε₯½οΌŒθ―·δ»‹η»δΈ€δΈ‹δ½ θ‡ͺ己。"}],
        tokenize=False,
        add_generation_prompt=True,
    )
    inputs = tokenizer(prompt, 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/internlm2")

SGLang (βœ… verified)

SGLang 0.5.10 ships a native InternLM2ForCausalLM implementation; serve the tiny checkpoint with tensor parallelism:

sglang serve --model-path tiny-random/internlm2 --tp 4 \
  --dtype bfloat16 --context-length 1024 --disable-piecewise-cuda-graph --host 0.0.0.0 --port 30000 \
  --trust-remote-code

piecewise prefill CUDA graph capture hits CUBLAS_STATUS_INTERNAL_ERROR in wo, so the command below passes --disable-piecewise-cuda-graph.

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/internlm2", 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 internlm/internlm2-chat-20b source, shipping its pinned remote code.

This repo is generated by GPT-6.1-Sol.

Downloads last month
149
Safetensors
Model size
12.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/internlm2

Finetuned
(1)
this model

Collection including tiny-random/internlm2