Downloads · 30 days
9
13% of all-time downloads
Abogatic/qwen35-9b-legal-sft-es-v1
qwen35-9b-legal-sft-es-v1 is a text generation model from Abogatic. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
LoRA adapter for Qwen/Qwen3.5-9B tuned for Spanish legal assistant behavior over statutes and case law, with emphasis on prudence, grounding, and faithful handling of visible legal text.
Downloads · 30 days
9
13% of all-time downloads
All-time downloads
70
Public
Repo size
136 MB
Likes
0
Public
Click a slice to open those files.
.safetensors116 MB · 85%
From the Hugging Face model README
LoRA adapter for Qwen/Qwen3.5-9B tuned for Spanish legal assistant behavior over statutes and case law, with emphasis on prudence, grounding, and faithful handling of visible legal text.
This is an adapter only. It must be loaded on top of the base model Qwen/Qwen3.5-9B.
The fine-tuning objective was behavioral, not encyclopedic. The target model should:
The adapter was designed for RAG-style systems over Spanish legal sources, especially where the retrieved context may include:
The training corpus was built from anonymized Spanish Supreme Court judgments and transformed into chat-format SFT examples focused on:
The dataset was designed to reduce these failure modes:
Qwen/Qwen3.5-9Bgold20452587477.95 seconds2.4783r: 16160.0noneq_projk_projv_projo_projgate_projup_projdown_projAn internal 60-case benchmark compared the base model against this adapter on Spanish legal behavior. The benchmark measured:
Summary:
5.317 -> 5.5000.917 -> 1.0000.767 -> 0.8830.950 -> 1.000Observed improvements in this benchmark:
1 to 0;4 to 0;3 to 0.Benchmark artifacts included in this repository:
benchmark_summary.jsonBENCHMARK.mdKnown limitation:
Best fit:
Recommended guardrails:
no consta when the context is partial;This adapter is not a substitute for:
It should not be used to assert current legal validity unless the current statutory text is explicitly present in the retrieved context.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base_model = "Qwen/Qwen3.5-9B"
adapter_path = "PATH/TO/ADAPTER"
tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_model,
trust_remote_code=True,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter_path)
model.eval()
vllm serve Qwen/Qwen3.5-9B \
--trust-remote-code \
--enable-lora \
--max-lora-rank 16 \
--lora-modules '{"name":"legal-v1","path":"PATH/TO/ADAPTER","base_model_name":"Qwen/Qwen3.5-9B"}' \
--generation-config vllm \
--default-chat-template-kwargs '{"enable_thinking": false}'
The adapter was trained from anonymized judicial material transformed into behavioral SFT examples. Review the legal and organizational requirements applicable to the source corpus before redistribution or downstream commercial use.
The adapter itself is released under the same practical serving assumptions as the base repository, but use remains subject to the base model license and the legal constraints of the training corpus.