EnerGuia-0.5B
EnerGuia-0.5B is a fine-tuned language model specialized in Brazilian electricity consumer rights, based on ANEEL regulations and current legislation. It is derived from Qwen/Qwen2.5-0.5B-Instruct via LoRA supervised fine-tuning.
The model is designed to answer common questions from electricity consumers in Brazil in a clear, objective, and empathetic manner — covering topics such as connection deadlines, billing disputes, outage compensation, and regulatory procedures.
Model Details
| Property | Value |
|---|---|
| Base model | Qwen/Qwen2.5-0.5B-Instruct |
| Fine-tuning method | LoRA (PEFT) |
| Language | Portuguese (Brazilian) |
| Domain | Electricity consumer rights / ANEEL regulations |
| Task | Instruction-following / Question Answering |
| LoRA rank (r) | 8 |
| LoRA alpha | 16 |
| LoRA dropout | 0.1 |
| Target modules | k_proj, up_proj, q_proj, gate_proj, v_proj, down_proj, o_proj |
| Bias | none |
| Training epochs | 3 |
| Batch size (effective) | 16 |
| Learning rate | 0.0001 |
| LR scheduler | SchedulerType.COSINE |
| Optimizer | OptimizerNames.PAGED_ADAMW_8BIT |
| Precision | fp16 |
Training Data
The model was fine-tuned on a curated dataset of 251 instruction-following examples in the chat format, covering Brazilian electricity consumer rights topics such as:
- New connection deadlines (urban/rural, mono/bi/trifasic)
- Required documentation for service requests
- Procedures for billing disputes and overcharges
- Outage duration limits and compensation rights
- Emergency and scheduled interruption rules
- Rights regarding meter readings and inspections
- Escalation paths: distributor → Ouvidoria → ANEEL (167)
All examples follow the messages format with a consistent system prompt establishing the assistant's role as an ANEEL-aware consumer rights specialist.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "maikerdr/EnerGuia-0.5B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto"
)
model.eval()
messages = [
{
"role": "system",
"content": (
"Você é um assistente especialista em direitos do consumidor de energia elétrica "
"no Brasil, com base nas normas da ANEEL e na legislação vigente. "
"Responda de forma clara, objetiva e empática. "
"Quando a pergunta estiver fora do seu domínio de conhecimento, "
"responda taxativamente com 'Não posso responder essa pergunta!'"
),
},
{"role": "user", "content": "Quanto tempo a distribuidora tem para me ligar a energia?"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Intended Use
- Consumer-facing chatbots for Brazilian electricity distributors
- Legal aid tools for consumer rights organizations
- Educational assistants for ANEEL regulatory content
- Prototyping and research on domain-specific small LLMs in Portuguese
Out-of-Scope Use
The model is trained to reply "Não posso responder essa pergunta!" for questions outside its domain. It is not suitable for:
- General-purpose Portuguese conversation
- Legal advice beyond consumer energy rights
- Any safety-critical decision-making without human oversight
Limitations
- Small model size (0.5B parameters) limits complex multi-step reasoning.
- Knowledge is bounded by the training dataset; it may not reflect the most recent ANEEL regulatory updates.
- Responses should be validated against official ANEEL sources for legal proceedings.
License
This model adapter inherits the Apache 2.0 license from the base model.