GLM Legal Wiki
Explore GLM Legal, a GLM-based legal AI model for Chinese legal text understanding, document analysis, question answering, prompt testing, local deployment, and research workflows.
GLM Legal Knowledge Hub
Eight core sections covering the model, setup, inference, benchmarks, licensing, and deployment workflows
Latest Updates
Discover the newest guides, tips, and content
GLM Legal Accuracy: Benchmark Results & Error Analysis
How GLM Legal accuracy is measured across Harvey LAB, LegalBench, and PLawBench, with error types, hallucination cases, and review methods.
GLM Legal API: Access Paths & Integration Setup Guide
How to access the GLM Legal API: consultation channels, developer resources, prompt patterns, benchmarks, and enterprise integration planning.
GLM Legal API Access: Official Channels & Setup Guide
How to request GLM Legal API access: official consultation, enterprise preparation, integration planning, and public development resources explained.
GLM Legal API Documentation: Setup & Integration Guide
GLM Legal API documentation guide covering access paths, request structure, legal prompt patterns, structured outputs, and deployment checklists.
GLM Legal Benchmark: Evaluation Frameworks Explained
Understand how GLM Legal is evaluated across Harvey LAB, LegalBench, and PLawBench, including capability dimensions, score interpretation, and limits.
GLM Legal Benchmark Results: How the Model Is Evaluated
Understand GLM Legal benchmark results across Harvey LAB, LegalBench, and PLawBench, including capability dimensions, score interpretation, and key limitations.
GLM Legal Case Analysis: Step-by-Step Workflow & Prompt Guide
Learn how to run GLM Legal case analysis workflows: evidence organization, issue spotting, prompt patterns, verification steps, and professional review practices.
GLM Legal Commercial Use: License Rules & Deployment
Understand GLM Legal commercial use rules: Apache-2.0 terms, law-glm-10b deployment limits, compliance steps, and human review requirements.
GLM Legal Legal Compliance: Rules, Risks & Setup Guide
Understand GLM Legal legal compliance: Apache-2.0 licensing terms, data privacy duties, human review requirements, and safe deployment practices.
GLM Legal Context Window: Capacity, Limits & Long Legal Docs
Understand how GLM Legal handles context windows for legal AI tasks, long contracts, evidence sets, and retrieval workflows, with practical guidance.
GLM Legal Contract Review: Step-by-Step Workflow
Learn how to run GLM Legal contract review workflows: prompt patterns, risk classification, citation checks, and lawyer-verified output schemas.
GLM Legal Deployment: Step-by-Step Setup Guide
Deploy GLM Legal locally or via API with this setup guide covering hardware, Transformers configuration, inference prompts, and access channels.
GLM Legal Overview
GLM Legal (law-glm-10b) is a GLM-architecture language model built for legal text. This section covers what the model is, what it is designed to do, who it serves, and how its open licensing supports research and product work.
GLM-Architecture Foundation
GLM Legal builds on the GLM model family with 10B parameters, tuned for legal text understanding and generation.
Legal-Domain Focus
Training centers on Chinese legal text: statutes, case materials, contracts, and legal question answering.
Who It Serves
NLP researchers, legal-tech developers, and teams building document analysis and legal assistant workflows.
Open Apache-2.0 License
Both public variants ship under Apache-2.0, so weights can be downloaded, modified, and used in commercial projects.
GLM Legal Use Cases
From contract review to legal research, GLM Legal supports a range of legal text workflows. Each use case below describes what the model does and where it fits in a document pipeline.
Legal Document Analysis
Parse statutes, case files, and legal documents to extract structure, parties, dates, and key provisions.
Legal Question Answering
Answer legal questions with reference-grounded responses based on the supplied statutory or case text.
Contract and Clause Review
Summarize contracts, flag unusual clauses, and turn dense agreements into structured review checklists.
Legal Research Support
Organize research questions, summarize authorities, and build issue outlines from supplied legal materials.
Prompt Testing and Evaluation
Run controlled prompt experiments locally to measure output quality before deploying a workflow.
GLM Legal Benchmark Results
Legal model evaluation covers several task families. This table explains what each dimension measures and how to read reported results when comparing legal language models.
| Evaluation Dimension | What It Tests | What Scores Reflect | How to Use Results |
|---|---|---|---|
| Legal Question Answering | Statute and case-based questions requiring precise legal reading. | How accurately the model grounds answers in supplied legal text. | Compare models on the same QA sets before adopting one for research workflows. |
| Text Classification | Sorting legal documents by type, issue area, and relevance. | Consistency of labels across large document batches. | Use it to triage document pipelines and route files to the right review path. |
| Summarization | Condensing contracts, rulings, and statutes into structured briefs. | Whether summaries preserve obligations, dates, parties, and outcomes. | Spot-check summaries against sources before using them in review memos. |
| Information Extraction | Pulling clauses, parties, dates, and obligations from raw text. | Completeness of extracted fields across document formats. | Validate extraction on your own documents to size the review workload. |
GLM Legal Beginner Guide
Six steps take you from model card to first legal inference run. Follow them in order to set up a working GLM Legal environment on your own machine.
Review the Model Card
Start with the law-glm-10b page on Hugging Face to confirm file sizes, license terms, and the latest revision.
- Read the model card and usage notes
- Confirm the Apache-2.0 license fits your project
- Check the v2 variant for the newer iteration
Prepare the Environment
Install Python, PyTorch, and the Transformers library, then verify CUDA and driver versions for your GPU.
- Python 3.10+ inside a virtual environment
- PyTorch matched to your CUDA version
- Transformers and accelerate installed
Download the Weights
The full checkpoint is about 39.5 GB. Plan disk space and download with git LFS or the hf CLI from the model repository.
- Reserve 40 GB or more of free disk space
- Download via git LFS or the hf CLI
- Verify file integrity after download
Load the Model
Load the checkpoint with trust_remote_code enabled, then move it to GPU memory or apply quantization for smaller cards.
- Enable trust_remote_code when loading
- Check VRAM headroom before loading
- Consider 8-bit or 4-bit quantization for consumer GPUs
Run the First Inference
Send a short legal question or a clause and inspect the generated answer, then adjust temperature and max tokens.
- Start with a one-paragraph legal QA prompt
- Compare outputs across two or three prompts
- Log prompts and outputs for review
Evaluate and Iterate
Build a small test set of your own legal questions, score the answers, and refine prompts before wider use.
- Collect 20 to 50 representative questions
- Score answers against source documents
- Refine prompts and repeat the loop
GLM Legal API Access
GLM Legal ships as open model weights, so access means downloading and hosting the model yourself. The panels below cover the main access paths and what to prepare before deployment.
Both law-glm-10b and law-glm-10b-v2 are published on Hugging Face under the law-llm organization. Clone the repository or download individual weight files with the hf CLI.
- The full checkpoint is about 39.5 GB
- Version history is tracked on the model page
- Community discussions are available on the model page
GLM Legal Model Comparison
Pick a model by matching its strengths to the task. This table compares the two GLM Legal variants with the general GLM family and general-purpose LLMs on legal work.
| Model | Primary Focus | Legal Task Fit | Best For |
|---|---|---|---|
| law-glm-10b | Legal-domain GLM model | Chinese legal text understanding, document analysis, and question answering. | Research and product work centered on legal corpora. |
| law-glm-10b-v2 | Updated legal-domain iteration | Same legal focus with the newer training iteration from the law-llm team. | Teams starting fresh who want the latest published checkpoint. |
| General GLM Models | Broad language understanding | Handles legal text with strong prompting but without legal-domain tuning. | General applications where legal precision is not the core requirement. |
| General-Purpose LLMs | Wide task coverage | Strong general reasoning; legal output depends heavily on prompt and context quality. | Mixed workloads where legal tasks are only part of the pipeline. |
GLM Legal Prompt Guide
Stable legal output starts with a structured prompt. Each pattern below states the facts, defines the task, and fixes the output shape so responses stay consistent and easy to review.
Legal Question Answering
Answer a legal question strictly from the supplied text.
You are a legal research assistant. Sources: [insert statute or case text] Question: [insert question] Task: Answer using only the sources above. - Cite the passage that supports the answer - State the answer in one paragraph - List any points the sources do not cover
Contract Clause Extraction
Pull structured clauses out of a contract.
Extract clauses from the contract below. Contract: [insert contract] Return JSON with: - parties: [] - term: "" - termination: "" - payment: "" - liability: "" - unusualClauses: [] Use "not specified" for missing fields.
Document Summarization
Condense a long legal document into a structured brief.
Summarize the legal document below. Document: [insert document] Return: 1. One-paragraph overview 2. Key obligations with clause references 3. Important dates and deadlines 4. Open questions for reviewer attention
Prompt Quality Controls
Add guardrails that keep legal prompts reviewable.
Before answering: - Restate the task in one sentence - List supplied facts separately from assumptions - Cite the source passage for every conclusion - Use the requested output format exactly - Mark missing information instead of guessing
GLM Legal AI Resources
Official starting points for building with GLM Legal: model pages, community discussions, the upstream GLM codebase, and the license text.
law-glm-10b Model Card
Weights, file list, revisions, and usage notes for the base legal model.
Open on Hugging Facelaw-glm-10b-v2 Model Card
The newer iteration of the legal model with its own file history and notes.
Open on Hugging FaceCommunity Discussions
Questions, findings, and issue reports from other law-glm-10b users.
Join the DiscussionUpstream GLM Repository
The THUDM GLM codebase behind the model family, with issues and release notes.
View on GitHubApache-2.0 License
The full license text governing commercial use, modification, and redistribution.
Read the License