Skip to content

Custom LLM for Legal Documents

Project Name : Custom LLM for Legal Documents

Summary : Automated ingestion, contextualization, and natural language query system for legal documents. 

Project Type : Student Only | Proof of Concept

Client : Law firm based in Madrid, Spain

Talent Source : IIT Kanpur, IIT Kharagpur

Project Scope : Custom LLM research, Data ingestion, Query interface for users


A law firm specializing in civil litigation wanted to access and analyze over 100,000 counts of legal documents, including statutes, case law, and regulations, to provide accurate and timely advice to their clients. With an extensive collection of documents with varying legal contexts, lawyers struggled to quickly retrieve relevant information, leading to delays in case preparation and client consultations. Additionally, the high cost associated with manual research efforts hindered the firm’s ability to scale its operations effectively.


The Client used Trumio to find & contract with a talented student team to develop a Proof of Concept (PoC) for a custom Large Language Model (LLM). The team embarked on a comprehensive research endeavor to identify and  prototype suitable LLM frameworks and models tailored to the firm’s requirements. Through advanced data ingestion techniques, the team experimented by consuming an extensive collection of legal documents into the LLM framework, enabling efficient parsing and analysis of textual data. They also developed a user-friendly query interface, allowing lawyers to access and retrieve relevant legal information with ease.


Cost Efficient Prototyping

The experimentation with Custom LLMs led to the development of a prototype with the potential to efficiently partition, ingest, and access a selective repository of legal documents. At the end of the project, the prototype was available for validation and user testing. 

Potential Cost Savings

The application has the potential to reduce the time and resources spent on manual research efforts by the firm’s lawyers. The parsing technique and automation of data ingestion and analysis processes was a key innovation achieved by the team.

Scale to Production

With a robust application framework in place, the firm is open to explore opportunities to move the prototype to production, while continuing to work with Trumio platform  experts and offered infrastructure solutions.