Ralf v9: Qwen-based business and tax assistant
2 min readupdated
This is a LoRA (a small add-on layer for a base model) for the unsloth/Qwen3.8-27B language model, trained to handle corporate, tax, and business law tasks in Brazil in Portuguese. The model's primary focus is strict anti-hallucination (preventing fabrication): it minimizes inventing non-existent laws, articles, and precedents, and honestly reports uncertainty. The model was created using SFT (supervised fine-tuning) and GRPO (group relative policy optimization / reinforcement learning via accuracy reward) methods. It will be useful for lawyers, entrepreneurs, and specialists working with Brazilian law in Portuguese.
Key features
- Legal specialization: focused exclusively on corporate and tax topics.
- Anti-fabrication: penalizes references to non-existent rules and encourages declining to answer when in doubt.
- Training optimization: underwent iterative SFT fine-tuning stages and a GRPO reinforcement cycle.
- Unmerged format: loaded at runtime on top of the base model with an adapter rank of 32.
What you can do
- Service integration: deploy in a corporate chatbot for initial business inquiries.
- Document analysis: use with vLLM to review and break down business tasks.
- Prompt tuning: apply the system prompt from the card to maintain a strict tone.
- Production testing: run via PEFT and Transformers frameworks while maintaining accuracy.
Example
from peft import PeftModel
from transformers import AutoProcessor, AutoModelForImageTextToText
import torch
base = AutoModelForImageTextToText.from_pretrained(
"unsloth/Qwen3.8-27B", torch_dtype=torch.bfloat16, device_map="auto"
)
model = PeftModel.from_pretrained(base, "Mydatagent-ai/ralf-v9")
processor = AutoProcessor.from_pretrained(
"Mydatagent-ai/ralf-v9"
)Read more
Details• Architecture: PEFT / LoRA (r=32, $\alpha$=32)
• Base: unsloth/Qwen3.8-27B
• Metrics: 5.6% fabrications on internal evaluation set, 100% out-of-scope detection
• License: Apache 2.0
• Language: Portuguese (Brazil)










Comments