Guide · Open source
How to use unilm: clone the repo and pick a model family
Updated · written with AI from the project's own documentation and checked against our catalogue data
unilm is Microsoft's GeneralAI research repository. It collects many pre-trained AI models and their code in one place, covering text in 100+ languages, images, speech, documents with layout, and multimodal inputs. This guide shows you how to get the repository onto your machine and how to find the subproject that fits your task, so you can start from the right folder.
Quick start
- 1Clone the repository. Run the git clone command from the README to download microsoft/unilm to your machine.
- 2Pick a model family. Use the README sections to match your task to a named project, such as MiniLM for small language models or TrOCR for OCR.
- 3Open the subproject folder. Each project links to its own folder in the repository. Go to that folder to find its specific instructions.
- 4Read the subproject setup. Follow the install and requirements steps written in that folder, since they differ from project to project.
- 5Check the licence. Confirm the MIT licence and any subproject licence terms before you reuse the code or models.
What unilm is and who it is for
unilm is mainly a research resource rather than a single ready-to-use app. The README is a directory of named projects, and each one links to its own subfolder in the repository.
It suits researchers comparing pre-trained model families such as MiniLM, BEiT, or LayoutLM, Document AI developers looking at LayoutLM, LayoutXLM, or TrOCR, and teams that need small pre-trained language models such as MiniLM for limited hardware. It is less suited to non-technical users, since most entries assume machine learning knowledge.
- Research comparison of pre-trained model families
- Document AI work with LayoutLM, LayoutXLM, or TrOCR
- Small language models like MiniLM for limited hardware
- Multilingual models such as InfoXLM or DeltaLM
Clone the unilm repository
The README gives one install command: cloning the repository from GitHub. The project is listed as clone-and-build, and the README does not list prerequisites for the top-level repo. Each subproject has its own setup described in its own folder, so the clone is only the first step.
git clone https://github.com/microsoft/unilm.gitFind the right subproject for your task
Browse the README sections to match your goal to a project name. Language and multilingual models include UniLM, InfoXLM/XLM-E, DeltaLM/mT6, and MiniLM. Vision includes BEiT, BEiT-2, and DiT. Speech includes WavLM and VALL-E. Multimodal document work includes LayoutLM, LayoutLMv2, LayoutLMv3, LayoutXLM, and MarkupLM. Applications include TrOCR and LayoutReader.
Each project name links to a subfolder of the repository, such as minilm, layoutlmv3, or trocr. Open that folder and read its own instructions before installing anything.
- Small language models: MiniLM
- Multilingual text: InfoXLM/XLM-E, DeltaLM/mT6
- Document AI: LayoutLMv3, LayoutXLM, DiT
- OCR: TrOCR
- Multimodal foundation model: BEiT-3
Set up a specific subproject
Setup differs by project, because the README describes unilm as a catalog of separate research projects rather than one product. Follow the instructions in the subproject folder you picked. The README does not give a single shared install path for all of them, so do not assume one set of steps covers everything.
The repository also contains a foundation architecture library, TorchScale, which the README links separately at its own repo.
- Read the README inside the chosen subfolder first
- Check that the subproject's stated requirements match your machine
- Install only the project you need
Understand the licence and related tools
unilm is released under the MIT licence, as listed on its repository page. The README names comparable projects in the same space: Hugging Face Transformers, OpenMMLab MMPretrain, and timm. If you want one consistent library interface for loading pre-trained models, those projects may be easier starting points than the raw research code in unilm.
Check the licence file of any individual subproject before reusing its code or models in your own work.
- Licence for the repository: MIT
- Comparable projects: Hugging Face Transformers, OpenMMLab MMPretrain, timm
Keep up with new releases
The README has a News section that lists model releases and new projects, with dates and links. Check it when you want to know which projects are new or recently updated. Projects marked as new in the README include EdgeLM, E5, SimLM, VL-BEiT, and BEiT-3.
What people use it for
- Compare LayoutLMv3 and LayoutXLM for extracting information from scanned or multilingual documents
- Use TrOCR as a starting point for transformer-based optical character recognition
- Try MiniLM for a small language model on limited hardware
- Study BEiT-3 as a general-purpose multimodal foundation model
- Explore InfoXLM or DeltaLM for cross-lingual text tasks
Frequently asked questions
How do I install unilm?
The README gives one command, git clone https://github.com/microsoft/unilm.git, which downloads the repository. Each subproject then has its own setup described in its own folder, so install instructions depend on which project you choose.
Is unilm free to use?
unilm is released under the MIT licence, as listed on its repository. Check the licence of any individual subproject before you reuse its code or models.
What are the requirements for unilm?
The README does not list prerequisites for the repository as a whole. Requirements are set by each subproject in its own folder, so read that folder's instructions for your chosen project.
Is unilm a single app I can run?
No. The README is a catalog of separate research projects, not one product. Each name links to its own subfolder with its own code and setup.
What are alternatives to unilm?
The README names Hugging Face Transformers, OpenMMLab MMPretrain, and timm as comparable projects. These may be easier if you want a consistent library interface for pre-trained models.
Which unilm model should I use for document AI?
The README lists LayoutLM, LayoutLMv2, LayoutLMv3, and LayoutXLM as multimodal document foundation models, with LayoutXLM for multilingual Document AI. TrOCR is listed for transformer-based OCR.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
unilm suits researchers and ML developers who want to compare or study Microsoft's pre-trained model families, especially for documents, multilingual text, and small language models like MiniLM. It is a poor fit if you want one ready-to-run app or a single install path, since each subproject sets up separately. If you prefer a unified library interface, Hugging Face Transformers, MMPretrain, or timm are the README's named alternatives.
Install options & downloads