- GLM Legal weights are published for
law-glm-10bandlaw-glm-10b-v2on Hugging Face under Apache-2.0. - Total repository size is roughly 39.5 GB with 10B parameters per variant.
- Loading requires
trust_remote_code=Truebecause GLM uses custom model code. - Plan for multi-GPU inference or CPU offloading; a single consumer GPU will not fit fp32 weights.
- Always verify license conditions and output citations before production use.
GLM Legal Weights Overview
GLM Legal weights refer to the publicly released model checkpoints of the GLM-based legal language models hosted under the law-llm organization on Hugging Face. Two variants are available: the original law-glm-10b and its successor law-glm-10b-v2. Both are built on the GLM architecture from the THUDM/GLM repository and are oriented toward Chinese legal text understanding, legal question answering, and document analysis tasks.
"GLM Legal" is a community content-site name for these checkpoints, not a confirmed official commercial product name. Do not confuse these weights with Z.ai's GLM-Legal product line or the LawGLM open-source research project.
| Property | law-glm-10b | law-glm-10b-v2 |
|---|---|---|
| Parameters | 10B | 10B |
| Architecture | GLM | GLM |
| License | Apache-2.0 | Apache-2.0 |
| Repo size | ~39.5 GB | Similar checkpoint layout |
| Host | Hugging Face (law-llm org) | Hugging Face (law-llm org) |
| Download stats | Low monthly volume, fluctuates | Low monthly volume, fluctuates |
Original variant
- law-glm-10b
- Baseline legal GLM checkpoint
- Chinese legal corpora focus
Updated variant
- law-glm-10b-v2
- Refined release
- Check model card for changes
Upstream base
- THUDM/GLM
- GLM architecture source
- Training and inference code
Weight Files and Download
The checkpoint files live in each model repository's file tree. Download through huggingface-cli, git lfs, or the Transformers library. Because the repository is large, prefer resumable CLI downloads over browser fetching.
| Method | Command example | Best for |
|---|---|---|
| huggingface-cli | huggingface-cli download law-llm/law-glm-10b | Full repo, resumable |
| Git LFS | git clone https://huggingface.co/law-llm/law-glm-10b | Mirroring the repo |
| Transformers | from_pretrained("law-llm/law-glm-10b") | Automatic pull at load time |
Set HF_HOME to a disk with at least 80 GB free space to accommodate both variants plus cache overhead. Verify file integrity by comparing SHA values against the file tree listing on the model page.
Hardware Requirements
Running 10B-parameter GLM weights is memory-intensive. Use this table to plan deployment before downloading.
| Precision | Approx. memory | Practical setup |
|---|---|---|
| fp32 | ~40 GB | Multi-GPU server (2x A100 40G or similar) |
| fp16 / bf16 | ~20 GB | Single A100 40G, or 2x 24 GB GPUs |
| 8-bit quantized | ~10-12 GB | Single 16-24 GB GPU |
| CPU (offload) | 64 GB+ RAM | Testing only, very slow |
GLM checkpoints load custom modeling code. Passing trust_remote_code=True executes repository code locally. Review the code before running, and only pull weights from the official law-llm organization.
Step-by-Step Local Deployment
Prepare the environment
Install Python 3.8+, PyTorch with CUDA support, and Transformers. Confirm GPU memory matches your target precision from the hardware table above.
Download the weights
Use huggingface-cli download law-llm/law-glm-10b and verify the checkpoint files complete successfully before loading.
Load with trust_remote_code
Call AutoModel.from_pretrained("law-llm/law-glm-10b", trust_remote_code=True) and load the tokenizer the same way.
Run a first inference
Feed a short Chinese legal question with a clear prompt template. Keep generation parameters conservative (low temperature) for factual legal outputs.
Validate outputs
Cross-check every legal citation and factual claim against source statutes or case materials. Record hallucination cases for your evaluation log.
Deployment Checklist:
- Verify disk space (80+ GB free)
- Confirm GPU memory matches precision target
- Review custom code before trust_remote_code
- Test inference on a known legal question
- Log citation accuracy and error cases
Once inference runs cleanly on sample prompts, benchmark the model against your own legal document set rather than relying solely on public benchmark scores.
License and FAQ
The weights are marked Apache-2.0, which permits commercial use, modification, and redistribution with proper attribution and notice inclusion. Verify the model card before commercial deployment, since downstream legal-accuracy obligations remain yours.
Apache-2.0 covers the published weights, but it does not certify output accuracy. Any legal advice workflow built on GLM Legal weights should include human lawyer review and jurisdiction checks.
Q: Where can I download GLM Legal weights?
The weights are hosted on Hugging Face under the law-llm organization, with separate repositories for law-glm-10b and law-glm-10b-v2. Both are Apache-2.0 licensed.
Q: How large are the GLM Legal weights?
The law-glm-10b repository lists roughly 39.5 GB of model files for a 10B-parameter checkpoint. Plan disk space accordingly if you keep both variants.
Q: Can GLM Legal weights run on a single consumer GPU?
Only with quantization or offloading. Full-precision 10B weights need around 40 GB of memory, so fp16 on a 40 GB card or 8-bit quantization on a 16-24 GB card are the practical options.
Q: Why does loading require trust_remote_code?
GLM checkpoints ship custom modeling code that Transformers must execute locally. Review the repository code first, and only enable this flag for the official law-llm repositories.