Instructions to use RayNene/Trilex with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RayNene/Trilex with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RayNene/Trilex") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RayNene/Trilex") model = AutoModelForCausalLM.from_pretrained("RayNene/Trilex") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RayNene/Trilex with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RayNene/Trilex" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RayNene/Trilex", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RayNene/Trilex
- SGLang
How to use RayNene/Trilex with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "RayNene/Trilex" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RayNene/Trilex", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "RayNene/Trilex" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RayNene/Trilex", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RayNene/Trilex with Docker Model Runner:
docker model run hf.co/RayNene/Trilex
TriLex
Understanding law across borders, languages, and legal traditions.
A multilingual legal reasoning model adapted from Llama 3.3 70B Instruct for English, French, and Estonian legal understanding.
Why TriLex?
Law has never been more global.
A company incorporated in London may negotiate contracts governed by French law. An AI researcher may compare judicial systems across Europe. Citizens increasingly seek legal information online before consulting legal professionals. Governments themselves frequently study how other jurisdictions address similar policy challenges.
Yet most legal language models remain confined to a single legal system or language.
TriLex was built to move beyond that limitation.
Instead of specializing in only one jurisdiction, TriLex has been adapted to understand three distinct legal traditions:
- 🇬🇧 England — Common Law built through judicial precedent
- 🇫🇷 France — Civil Law founded on comprehensive legal codification
- 🇪🇪 Estonia — A digitally enabled legal system recognized for modern public administration
By exposing the model to multiple legal frameworks, TriLex aims to produce responses that recognize not only legal terminology, but also the institutional reasoning and policy objectives behind different legal systems.
The Problem
Legal information is often difficult to access.
For many people, legislation is written in technical language, court structures differ from one country to another, and understanding how laws interact across jurisdictions requires years of formal education.
Meanwhile, AI is rapidly becoming one of the first places people turn when trying to understand legal concepts.
That creates an important responsibility.
Rather than generating generic legal responses, TriLex was adapted to produce explanations that are clearer, more contextual, and more sensitive to differences between legal systems.
The goal is not to replace lawyers.
The goal is to make legal knowledge easier to understand.
Model Overview
Base Model
Meta Llama 3.3 70B Instruct
Adaptation Method
- LoRA fine-tuning
- Adaptive Data pipeline by Adaption Labs
Languages
- English
- French
- Estonian
Areas of Expertise
TriLex has been adapted for legal reasoning tasks including:
- Comparative law
- Constitutional law
- Administrative law
- Civil law
- Public policy
- Government structures
- Judicial systems
- Legal interpretation
- Legal education
- Legal question answering
- Cross-jurisdiction legal comparisons
Training Dataset
TriLex was adapted using a multilingual legal instruction dataset containing examples across three legal systems.
The dataset includes:
- English legal reasoning
- French legal reasoning
- Estonian legal reasoning
- Comparative legal analysis
- Enhanced instruction-response pairs
- Semantically enriched legal examples
By training on multiple jurisdictions simultaneously, the model learns to distinguish differences in legal traditions while preserving legal context.
How to Use
This repository contains LoRA adapter weights.
Load the base model first, then apply the adapter.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
BASE_MODEL = "meta-llama/Llama-3.3-70B-Instruct"
ADAPTER = "RayNene/TriLex"
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
base_model = AutoModelForCausalLM.from_pretrained(
BASE_MODEL,
device_map="auto"
)
model = PeftModel.from_pretrained(
base_model,
ADAPTER
)
Prompting Tips
TriLex performs best when legal questions include jurisdictional context.
Examples
Explain the differences between English common law and the French civil law system.
How does Estonia's digital identity framework support its legal and public administration systems?
Compare how administrative disputes are handled in France and England.
Why does England rely heavily on judicial precedent while France relies on codified legislation?
How do tribunal systems improve judicial efficiency in England?
Intended Applications
TriLex is designed for:
- Legal education
- Comparative law research
- Government policy analysis
- Legal assistants
- Academic research
- Multilingual legal retrieval
- Domain-adapted language model research
Limitations
TriLex is intended for research and educational purposes.
It does not provide legal advice and should never replace consultation with qualified legal professionals. Laws change over time, judicial interpretations evolve, and legal outcomes depend heavily on jurisdiction and individual circumstances.
Built with Adaption Labs
TriLex was developed as part of the Adaption Labs AutoScientist Challenge.
The project leveraged Adaptive Data to enhance and refine multilingual legal instruction data before model adaptation. Adaptive Data made it possible to improve instruction quality, enrich legal reasoning examples, and generate a stronger foundation for domain-specific fine-tuning.
Special thanks to Adaption Labs for making advanced domain adaptation workflows more accessible to the open-source AI community.
Vision
The future of legal AI should not stop at answering questions—it should help people understand why legal systems differ.
Every legal system reflects the history, institutions, and values of the society it serves. By bringing together English common law, French civil law, and Estonia's digital-first governance model, TriLex aims to encourage more transparent, multilingual, and internationally aware legal AI.
By releasing both the dataset and model openly, this project hopes to contribute to research, education, and the broader effort to make legal knowledge more accessible worldwide.
Citation
If you use TriLex in research or downstream applications, please cite this repository and the accompanying dataset. If you use TriLex in your research, applications, or derivative work, please cite this repository.
BibTeX
@misc{Ray Munene,
title = {TriLex: A Multilingual Legal Reasoning Model for English, French, and Estonian Law},
author = {Munene, Ray},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/RayNene/TriLex}},
note = {LoRA adaptation of Meta Llama 3.3 70B Instruct developed as part of the Adaption Labs AutoScientist Challenge}
}
APA
Munene, R. (2026). TriLex: A Multilingual Legal Reasoning Model for English, French, and Estonian Law [Computer software]. Hugging Face. https://huggingface.co/RayNene/TriLex
Dataset
The accompanying multilingual legal dataset is available at:
https://huggingface.co/datasets/RayNene/TriLex
If you use the training data, please cite both the dataset and the model.
Contact
Questions, suggestions, or contributions are welcome.
- 🤗 Hugging Face: https://huggingface.co/RayNene
- GitHub: https://github.com/RayMune
- Downloads last month
- -
Model tree for RayNene/Trilex
Base model
meta-llama/Llama-3.1-70B
docker model run hf.co/RayNene/Trilex