Juicio — Indonesian Legal QA Assistant (Qwen2.5-7B)

Juicio is a fine-tuned version of Qwen2.5-7B-Instruct, adapted to answer questions about Indonesian law clearly, accurately, and with references to relevant legal grounds. It is also trained to decline questions outside the legal domain.

  • Developed by: esalahterus
  • Finetuned from model: unsloth/Qwen2.5-7B-Instruct-bnb-4bit
  • License: Apache 2.0
  • Language(s): Indonesian (primary), with support for Malay and English (mixed-language legal terminology)
  • Model type: Causal decoder-only LLM (Qwen2 architecture), fine-tuned with LoRA
  • Training framework: Unsloth + Hugging Face TRL (SFTTrainer)

This qwen2 model was trained 2x faster with Unsloth and Hugging Face's TRL library.


Model Description

Juicio is designed to act as a legal assistant for Indonesian law, trained to answer questions clearly, accurately, and with reference to relevant legal bases (dasar hukum). It declines to answer questions unrelated to Indonesian law.

Training Details

Fine-tuned using LoRA on top of the 4-bit base model, trained on a cleaned and combined dataset built from fathurfrs/qna-hukum-indonesia and ShoAnn/legalqa_klinik_hukumonline, including examples for declining off-topic questions. Training was accelerated with Unsloth.

Intended Use

  • Answering general questions about Indonesian law (contracts, civil law, criminal law, regulations, etc.) in Bahasa Indonesia.
  • Educational and informational purposes.
  • Politely declining questions unrelated to Indonesian law.

Out-of-Scope Use

  • Not a substitute for professional legal advice. Always consult a qualified lawyer (advokat) for real legal matters.
  • Not verified for use in jurisdictions outside Indonesia, or for legal systems other than Indonesian law.
  • May produce outdated information if laws/regulations have changed since the training data was collected.

Limitations

  • Training data coverage, while improved, is still not exhaustive. For legal topics with little or no representation in the training data, the model may still fill gaps with plausible-sounding but fabricated legal citations (wrong law numbers, years, or article contents) rather than acknowledging uncertainty.
  • Do not trust cited article/law numbers without verification. Always cross-check any Undang-Undang, Pasal, or Peraturan Pemerintah cited by the model against an official source (e.g. peraturan.go.id, JDIH) before relying on it.
  • Trained on publicly available Q&A data, which may reflect biases or gaps present in the source datasets.
  • For higher factual reliability, consider pairing this model with a retrieval-augmented generation (RAG) setup over a verified legal database, rather than relying on the model's parametric memory alone.

How to Use

from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="esalahterus/juicio",
    max_seq_length=4096,
    dtype=None,
    load_in_4bit=False,
)
FastLanguageModel.for_inference(model)

messages = [
    {"role": "system", "content": "Anda adalah Juicio, asisten Q&A hukum Indonesia. Tugas utama Anda adalah menjawab pertanyaan yang berkaitan dengan hukum Indonesia. Jika pertanyaan pengguna tidak berkaitan dengan hukum, jangan menjawab pertanyaan tersebut. Sampaikan bahwa Anda hanya dapat membantu pertanyaan terkait hukum."},
    {"role": "user", "content": "Apa syarat sahnya suatu perjanjian menurut KUH Perdata?"},
]

inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(input_ids=inputs, max_new_tokens=512, temperature=0.7)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

A GGUF-quantized version is also available for local inference via llama.cpp/Ollama at esalahterus/juicio-gguf.

Acknowledgements

Downloads last month
182
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for esalahterus/juicio

Base model

Qwen/Qwen2.5-7B
Adapter
(65)
this model
Quantizations
1 model

Datasets used to train esalahterus/juicio

Collection including esalahterus/juicio