Instructions to use esalahterus/juicio with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use esalahterus/juicio with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="esalahterus/juicio") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("esalahterus/juicio") model = AutoModelForCausalLM.from_pretrained("esalahterus/juicio", device_map="auto") 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 esalahterus/juicio with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "esalahterus/juicio" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "esalahterus/juicio", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/esalahterus/juicio
- SGLang
How to use esalahterus/juicio 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 "esalahterus/juicio" \ --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": "esalahterus/juicio", "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 "esalahterus/juicio" \ --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": "esalahterus/juicio", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use esalahterus/juicio with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for esalahterus/juicio to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for esalahterus/juicio to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for esalahterus/juicio to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="esalahterus/juicio", max_seq_length=2048, ) - Docker Model Runner
How to use esalahterus/juicio with Docker Model Runner:
docker model run hf.co/esalahterus/juicio
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, orPeraturan Pemerintahcited 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
- Base model: Qwen2.5-7B-Instruct by Alibaba Cloud, distributed via Unsloth
- Training datasets:
fathurfrs/qna-hukum-indonesia,ShoAnn/legalqa_klinik_hukumonline - Training accelerated with Unsloth and Hugging Face TRL
- Downloads last month
- 182
Model tree for esalahterus/juicio
Base model
Qwen/Qwen2.5-7B