This is a randomly initialized tiny model based on THUDM/chatglm3-6b-128k for testing and debugging.

Feature Source This repo
Parameters 6.24B (7 FP16 .bin shards, 12.49GB; source ships no safetensors) 9.31M
Weight files 7 pytorch_model .bin shards, 12.49GB 18.62 MB (model.safetensors)
Layers 28 4
Hidden width / FFN width 4,096 / 13,696 128 / 512
Q heads / KV groups / head dim 32 / 2 / 128 4 / 2 / 32
RoPE ratio / context 500 / 131,072 500 / 8,192
Prefix prompt 2-layer learnable prefix Same
Vocabulary rows / embedding tying 65,024 / untied (source) 65,024 / tied
Stored precision FP16 BF16

Transformers has not registered this ChatGLM revision, so the pinned upstream remote code is included. Its KV cache is a custom tuple format with learnable prefix prompts that predates the Transformers 5.x Cache API; the example runs generation with use_cache=False (full recomputation), and cached decoding is not claimed. The tiny checkpoint ties the output projection to the token embedding (the source shipped them untied), keeping the artifact at 18.62MB. Load with trust_remote_code=True.

File path Size
model.safetensors 18.6MB

Example usage

Transformers (βœ… verified)

Load the included pinned ChatGLM implementation with trust_remote_code=True. The pinned tuple/prefix-prompt KV cache predates the Transformers 5.x Cache API, so generation uses use_cache=False.

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("δ½ ε₯½οΌŒθ―·δ»‹η»δΈ€δΈ‹δ½ θ‡ͺ己。", 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/chatglm3")

SGLang (βœ… verified)

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

sglang serve --model-path tiny-random/chatglm3 --tp 4 \
  --dtype bfloat16 --context-length 1024 --host 0.0.0.0 --port 30000 \
  --trust-remote-code

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/chatglm3", 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 THUDM/chatglm3-6b-128k source, shipping its pinned remote code; generation runs without KV cache because the pinned tuple-cache implementation predates the Transformers Cache API.

This repo is generated by GPT-6.1-Sol.

Downloads last month
148
Safetensors
Model size
9.31M 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/chatglm3

Finetuned
(1)
this model

Collection including tiny-random/chatglm3