Instructions to use davideparisi/pallade-idrico-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use davideparisi/pallade-idrico-7b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("sapienzanlp/Minerva-7B-instruct-v1.0") model = PeftModel.from_pretrained(base_model, "davideparisi/pallade-idrico-7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
- Pallade Idrico 7B (v1.0) — Model Card & Technical Monograph
- ⚡ Quickstart: How to Use Pallade Idrico 7B
- 📌 Glossary of Key Italian Regulatory Acronyms & Institutional Terms
- 1. Overview, Background, and Project Motivations
- 2. Model Selection Rationale: Minerva vs Qwen / LLaMA
- 3. Architectural Evolution: Hybrid RAG-LLM Approach & LoRA/QLoRA Fine-Tuning
- 4. Methodological Framework: Precedence Hierarchy and Temporal Validity
- 5. Data Pipeline & Inventory Schema (
DATASET_INDEX.csv) - 6. Training Infrastructure, Hyperparameters & Benchmarking
- 7. Knowledge Base Scope, Roadmap & Collaborations
- 8. Ownership, Licensing & Usage Terms
- 9. Official Disclaimer & Trademarks
- 10. Official BibTeX Citation
Pallade Idrico 7B (v1.0) — Model Card & Technical Monograph
Pallade Idrico 7B is a domain-specific Large Language Model (LLM) specialized in Italian water market regulation and the Integrated Water Service (SII - Servizio Idrico Integrato). Conceived, curated, and developed entirely by Davide Parisi (Email: dp@davideparisi.com), the model was obtained via Supervised Fine-Tuning (SFT) on Google Colab Pro infrastructure of the Italian foundational base model sapienzanlp/Minerva-7B-instruct-v1.0 (Sapienza NLP, FAIR, and CINECA) over the complete Italian and European regulatory corpus of the water sector.
⚡ Quickstart: How to Use Pallade Idrico 7B
In Python using transformers & peft
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "sapienzanlp/Minerva-7B-instruct-v1.0"
adapter_model_id = "davideparisi/pallade-idrico-7b"
# Load tokenizer and base model
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
# Apply Pallade Idrico LoRA adapter
model = PeftModel.from_pretrained(base_model, adapter_model_id)
model.eval()
# Example regulatory query (TIMSI / RQSII)
messages = [
{"role": "user", "content": "Quali sono gli obblighi minimi di lettura del contatore idrico secondo la regolazione ARERA TIMSI e il D.M. 93/17?"}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.2,
do_sample=True,
top_p=0.9
)
response = tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
Local Deployment via Ollama
To run locally using Ollama and the included Modelfile.pallade:
# Clone the repository
git clone https://huggingface.co/davideparisi/pallade-idrico-7b
cd pallade-idrico-7b
# Create and run model in Ollama
ollama create idrico-expert -f Modelfile.pallade
ollama run idrico-expert
📌 Glossary of Key Italian Regulatory Acronyms & Institutional Terms
To facilitate international understanding of Italian public administration and water utility governance, key acronyms used throughout this document are defined below:
- ARERA (Autorità di Regolazione per Energia Reti e Ambiente): The Italian Regulatory Authority for Energy, Networks, and Environment. An independent public body responsible for economic regulation, quality standards, and tariff frameworks in electricity, gas, waste, and water services across Italy.
- SII (Servizio Idrico Integrato - Integrated Water Service): The unified public utility service in Italy encompassing raw water abstraction, treatment, aqueduct distribution, sewerage collection, and wastewater purification.
- EGA (Ente di Governo dell'Ambito - Area Governing Body): Local public authority representing municipalities within a designated optimal territorial area (ATO), responsible for choosing the management model, approving investment plans, and proposing tariff structures to ARERA.
- MTI-1 / MTI-2 / MTI-3 / MTI-4 (Metodo Tariffario Idrico): The multi-year tariff determination methodologies established by ARERA (MTI-1 for 2012–2015; MTI-2 for 2016–2019; MTI-3 for 2020–2023; MTI-4 for 2024–2027 via Resolution 639/2023/R/idr) setting capital expenditure ($Capex$), operational expenditure ($Opex$), and environmental cost recovery rules.
- RQSII (Testo Integrato della Qualità Contrattuale del Servizio Idrico Integrato): ARERA's Consolidated Text on Contractual Quality Standards, establishing mandatory service levels, response times, commercial guarantees, and user compensations.
- RQTI (Testo Integrato della Qualità Tecnica del Servizio Idrico Integrato): ARERA's Consolidated Text on Technical Quality Standards, setting binding performance indicators for water network losses ($M1a, M1b$), supply continuity, and water quality.
- TICSI / TIMSII / TIBSI: ARERA's Consolidated Texts governing tariff structure standardization (TICSI), water metering regulations (TIMSII), and social water bonuses for vulnerable households (TIBSI).
- TUA (Testo Unico Ambientale - Legislative Decree 152/2006): Italy's primary Environmental Protection Code governing water resources management, pollution prevention, and discharge limits.
- Legge Galli (Law 36/1994): The landmark 1994 Italian legislation that instituted the Integrated Water Service concept and consolidated fragmented municipal water utilities into territorial management areas.
1. Overview, Background, and Project Motivations
1.1 Project Origins and Operational Background
While providing IT services within the Integrated Water Service (SII) sector, it was possible to collaborate closely with officials and executive directors across multiple Italian water utility operators. Coming from facility management and integrated maintenance engineering, the initial observation was that of a highly technical yet technologically underdeveloped market. Maintenance operations were often managed with legacy mindsets compared to building asset management, driven primarily by hydraulic trade culture rather than modern digital management, while simultaneously coping with an extraordinarily complex array of administrative and regulatory compliance duties.
Direct engagement with these industry leaders revealed their exceptional technical caliber and dedication: operational managers possessing deep domain expertise, deeply committed to managing a vital public service essential to local communities.
During a strategic meeting, a senior executive of a major water operator highlighted a critical pain point: the overwhelming complexity of the regulatory framework. In Italy, the SII is governed by ARERA (Autorità di Regolazione per Energia Reti e Ambiente). ARERA is an active, assertive regulatory body exercising continuous market oversight. A central operational challenge for utility managers is staying constantly aligned with the numerous formal resolutions (delibere), executive determinations (determine), and legal opinions (pareri) issued by the Authority.
Beyond core framework resolutions, the primary administrative friction arises from specific queries submitted by market participants, to which ARERA responds with binding legal opinions and guidance. Continuous evolutions in environmental protection, consumer safeguards, and metering technology render this regulatory body highly dynamic, forcing utility managers (as well as municipalities, regional bodies, and public operators) to reconstruct applicable rules across years of layered opinions. This frequently prompts new formal queries, further compounding the volume of regulatory sources.
The executive posed a visionary question: Why has no expert system been established—for the benefit of ARERA and utility operators alike—that ingests the entire regulatory framework and answers operational queries directly, relieving administrative overload while providing immediate guidance based on existing binding precedents?
This vision led to the inception of Idrico Expert and the development of the specialized Pallade Idrico 7B model.
1.2 Pre-Development Legal and Technical Feasibility Analysis
Prior to data ingestion and model training, a thorough legal and technical study was conducted regarding the usability of public materials published on ARERA's official portal:
- No Legal Obstacles Identified: The legal review confirmed no restrictive elements. Administrative resolutions, determinations, consultative documents, and tariff annexes published by the Authority constitute official public administrative acts available under open access.
- Alignment with Institutional Purpose: ARERA's primary statutory objective is to ensure that all regulated entities, local governments, utilities, and citizens can freely access, understand, and comply with the regulatory framework. Utilizing public data to enhance regulatory transparency and compliance directly serves this public interest objective.
- Primary Legislation and EU Directives: National primary legislation (via Normattiva) and European Directives (via EUR-Lex) are established as public-domain legal materials free from reuse restrictions for educational and analytical AI applications.
1.3 Scope Evolution: From Multi-Sector ARERA to Specialized Water Focus
Initial project design contemplated expanding the AI system across all markets regulated by ARERA (Electricity, Natural Gas, District Heating, Waste Management). However, a strategic decision was made to focus 100% of engineering efforts exclusively on the Integrated Water Service (SII) for two reasons:
- Domain Expertise: The author's deep domain expertise in the water sector enabled rigorous validation of regulatory relationships that would be unfeasible across disparate sectors.
- Divergent Sector Dynamics: Electricity and gas markets operate on financial trading, power dispatching, and market clearing mechanics, whereas the SII is governed by infrastructure cost-reflective tariff regulation (MTI-1/2/3/4) and environmental cost-recovery principles (EU Water Framework Directive 2000/60/EC). A dedicated focus on water ensured "Zero-Loss" precision without domain dilution.
1.4 Etymology of the Name "Pallade"
In classical mythology, Pallas (Greek Παλλάς) was a water nymph, daughter of the sea god Triton, and childhood companion of the goddess Minerva (Athena). The choice of this name symbolizes the model's architecture: Pallade Idrico is the vertical extension "over the waters" that thrives in symbiosis with the foundational Minerva base model (sapienzanlp/Minerva-7B-instruct-v1.0), bringing general Italian linguistic and legal knowledge to serve the specialized domain of the Integrated Water Service.
2. Model Selection Rationale: Minerva vs Qwen / LLaMA
During initial research, several popular 7B/8B open-weights model architectures were benchmarked (including Qwen 2.5 and LLaMA 3.1).
Results from generic multilingual models proved unsatisfactory for Italian administrative and regulatory contexts:
- Linguistic and Legal Distortion: Multilingual models tended to distort formal Italian legal terminology and the precise phrasing of ARERA Consolidated Texts (Testi Integrati), introducing unnatural or anglicized phrasing.
- Normative Hallucinations: Lacking extensive pre-training on Italian statutory law (D.Lgs. 152/2006, Public Contracts Code, Legge Galli), generic models frequently hallucinated non-existent article numbers and legal citations.
The breakthrough occurred by selecting sapienzanlp/Minerva-7B-instruct-v1.0:
- Elimination of Unnecessary Multilingual Overhead: Water regulation in Italy targets local public administration, utility executives, and Italian engineering/legal practitioners (alongside technical English). A model burdened with dozens of irrelevant languages was unnecessary.
- Native Pre-Training on Italian Public Legislation: Developed by Sapienza NLP, FAIR, and CINECA, Minerva 7B includes a massive corpus of Italian legislative, administrative, and legal texts in its pre-training data. This foundational pre-exposure allowed the model to assimilate ARERA resolutions with exceptional fidelity, zero syntactic distortion, and complete absence of legal hallucinations.
3. Architectural Evolution: Hybrid RAG-LLM Approach & LoRA/QLoRA Fine-Tuning
Engineering experiments yielded two fundamental architectural insights:
A) Failure of Direct Full Fine-Tuning & PEFT Solution (LoRA/QLoRA)
Initial experiments attempted direct Full Fine-Tuning (updating all base model weights simultaneously without parameter-efficient adapters). Outcome: Severe Catastrophic Forgetting:
- Model Disruption: Full weight updates destroyed Minerva's conversational alignment. The model generated fragmented phrasing, endless loops of disconnected regulatory terms, and lost syntactic coherence.
- Resolution via LoRA/QLoRA ($r=32$): Freezing Minerva 7B's core weights and training low-rank adaptation matrices (LoRA) across all linear projection modules (
target_modules = All Linear) resolved the issue. Minerva's native conversational fluency remained intact while LoRA adapters smoothly learned specialized SII regulatory knowledge.
B) Definitive Hybrid Synergy: Fine-Tuning + RAG
Empirical evaluation proved that neither isolated Fine-Tuning nor isolated RAG suffices for high-stakes regulatory compliance:
- Fine-Tuning (SFT) alone provides domain reasoning competence: formal legal register, ARERA terminology, and structural understanding of tariff mechanics. However, LLMs can exhibit uncertainty on exact protocol numbers, dates, or specific financial parameters ($VR_g$, $Opex$, $Capex$).
- RAG (Retrieval-Augmented Generation) alone provides deterministic memory: retrieving exact text chunks from 1,837 ARERA resolutions indexed in ChromaDB. However, when attached to a generic LLM, the model struggles to interpret source hierarchy and legal precedence.
- Hybrid Synergy: In Pallade Idrico, SFT acts as the "expert reasoning brain" while RAG acts as the "real-time reference library". This combination eliminates hallucinations while ensuring deterministic citation accuracy.
4. Methodological Framework: Precedence Hierarchy and Temporal Validity
The Integrated Water Service regulatory corpus is characterized by:
- Multi-Tiered Legal Hierarchy: Coexistence of EU Directives, Primary National Laws, General ARERA Resolutions, Executive Determinations, and Advisory Opinions.
- Continuous Temporal Evolution (Lex Posterior): Evolving rules across successive tariff periods (MTI-1, MTI-2, MTI-3, MTI-4) and Consolidated Texts (RQSII, RQTI, TICSI, TIMSII, TIBSI).
To enforce legal coherence, a Source Priority Matrix was established:
- Technical Precedence: EU Legislation (Tier 1) > Primary National Laws (Tier 2) > ARERA General Resolutions (Tier 3) > ARERA Executive Determinations (Tier 4) > Advisory Opinions (Tier 5).
- Temporal Precedence: Current Consolidated Texts and active MTI-4 resolutions override superseded provisions, retaining historical acts strictly for audit, reconciliation, and litigation analysis.
5. Data Pipeline & Inventory Schema (DATASET_INDEX.csv)
The regulatory corpus was audited, verified, and extracted via a 5-task deterministic pipeline:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 2015 entries, 0 to 2014
Data columns (total 14 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 doc_id 2015 non-null object
1 source 2015 non-null object
2 doc_type 2015 non-null object
3 identifier 2015 non-null object
4 title 2015 non-null object
5 publication_date 2015 non-null object
6 hierarchy_level 2015 non-null int64
7 periodo_validita 2015 non-null object
8 vigenza_status 2015 non-null object
9 word_count 2015 non-null int64
10 estimated_tokens 2015 non-null int64
11 file_format 2015 non-null object
12 checksum_sha256 2015 non-null object
13 url 2015 non-null object
Ingested Dataset Breakdown (2,015 Official Documents / 9.25M Tokens):
- Tier 1 - European Union Legislation: 3 documents | 228,203 tokens (2.47%) (Water Framework Directive 2000/60/EC, Urban Wastewater Directive 91/271/EEC, Drinking Water Directive 2020/2184)
- Tier 2 - Primary National Legislation: 8 documents | 338,542 tokens (3.66%) (Legge Galli 36/1994, Environmental Code D.Lgs. 152/2006, Local Public Services D.Lgs. 201/2022, Drought Decree 39/2023)
- Tier 3 - ARERA General Resolutions: 1,837 documents | 8,061,575 tokens (87.19%) (Tariff Methods MTI-1/2/3/4, RQSII, RQTI, TICSI, TIMSII, TIBSI)
- Tier 4 - ARERA Executive Determinations: 153 documents | 557,225 tokens (6.03%) (Water Systems Directorate Determinations)
- Tier 5 - ARERA Advisory Opinions & Consultations: 14 documents | 60,769 tokens (0.66%)
6. Training Infrastructure, Hyperparameters & Benchmarking
- Local Prototyping: Initial testing and local simulation conducted on a dual NVIDIA RTX 5060 Ti workstation (16GB VRAM each).
- Cloud Training Infrastructure: Final training executed on Google Colab Pro (NVIDIA L4 GPU with 24 GB VRAM, 53 GB High-RAM system memory).
- Acceleration Engine: Unsloth with custom Triton kernels.
- Mandatory Precision Standard: Configured at 8-bit Minimum / Full Precision (
load_in_4bit = False) to eliminate quantization loss in legal terminology and financial formulas. - Hyperparameters:
- Base Model:
sapienzanlp/Minerva-7B-instruct-v1.0(7B parameters, Sapienza NLP) - Max Sequence Length: 4,096 tokens
- LoRA Rank ($r$): 32 | LoRA Alpha: 32 (Target Modules:
All Linear) - Per-device Batch Size: 8 | Gradient Accumulation: 2 (Effective Batch Size = 16)
- Learning Rate: 2e-4 (Cosine Scheduler) | Warmup Steps: 10
- SFT Dataset: 16,377 ChatML conversations (
unsloth_sii_dataset.jsonl)
- Base Model:
6.1 Empirical Tri-Stream Benchmark Results (Minerva 7B Base vs Pallade 7B RAG OFF vs Pallade 7B RAG ON)
To rigorously quantify the domain adaptation achieved by Pallade Idrico 7B, an empirical evaluation suite was executed across 5 core ARERA regulatory macro-domains, benchmarking three experimental conditions:
- Stream A (Minerva 7B Base - Zero-Shot): The un-adapted Italian foundational model.
- Stream B (Pallade 7B - RAG OFF): Pure parametric memory evaluation of the QLoRA weights.
- Stream C (Pallade 7B - RAG ON): The full hybrid RAG system incorporating ChromaDB vector retrieval (64,197 chunks).
| Benchmark ID | Regulatory Domain & Query Topic | Stream A: Minerva 7B Base (Zero-Shot) | Stream B: Pallade 7B Fine-Tuned (RAG OFF) | Stream C: Pallade 7B + RAG ARERA | Empirical Findings & Impact |
|---|---|---|---|---|---|
| BENCH-01 | RQSII / TIMSI (Mandatory meter readings & attempts) | Generic response; suggests monthly/quarterly readings unconnected to ARERA standards. (117.98s) | Exact citation of D.M. 93/17 & TIMSI Art. 10, mandatory 2 annual reading attempts. (37.01s) | Enriches context with 24h validation window and retry procedures. (20.98s) | Zero hallucination. Pallade 7B internalized exact reading frequencies. |
| BENCH-02 | RQTI (Technical Quality M1-M6 indicators) | Hallucinated targets (arbitrary 25% loss and 3 interruptions per year). (10.49s) | Reproduces formal ARERA resolution register (DELIBERAZIONE / INTIMAZIONE). (19.98s) | Ingests structural environmental and continuity framework. (27.05s) | Minerva Base invents fake targets; Pallade retains strict legal register. |
| BENCH-03 | MTI-4 (Tariff Methodology 2024–2029) | Generic overview; fails to cite the governing resolution. (15.08s) | Exact citation of Resolution 639/2023/R/idr & 2024–2029 regulatory period. (24.42s) | Extracts MTI-4 consultation guidelines and MTI-3 transition rules. (39.20s) | Pallade 7B instantly identifies Landmark Act Resolution 639/2023. |
| BENCH-04 | TICSI (Resident Domestic Tariff Structure) | Hallucinated percentages (fake 2–5% fixed/variable ratios). (43.05s) | Cites Consolidated Text on Tariffs (TICSI) and official ARERA sources. (17.69s) | Integrates cost-recovery principles ("polluter pays"). (22.93s) | Minerva Base invents non-existent ratios; Pallade maintains terminology. |
| BENCH-05 | REMSI / TIBSI (Morosità & User Safeguards) | Severe Hallucination: defines REMSI as "European Regulation". (7.63s) | Accurately identifies REMSI as ARERA Water Disconnection Regulation. (23.33s) | Incorporates universal service and vulnerable user safeguards. (22.18s) | Key Scientific Proof: Base model hallucinates acronyms; Pallade maps to ARERA. |
Key Analytical Conclusions:
- Acronym Resolution: Minerva Base hallucinates domain acronyms (e.g., mapping REMSI to a non-existent "Regolamento Europeo"). Pallade 7B correctly maps REMSI to ARERA's Regolazione Morosità Servizio Idrico.
- Parametric Act Citation: Pallade 7B (RAG OFF) spontaneously cites governing legal acts (D.M. 93/17, Resolution 639/2023/R/idr, Resolution 917/2017/R/idr) without external context.
- Formal Register Alignment: Fine-tuning on 16,377 ChatML legal pairs successfully aligned Pallade's output syntax with formal ARERA administrative acts (VISTI, DELIBERA).
7. Knowledge Base Scope, Roadmap & Collaborations
- Knowledge Base Cutoff Date: Pallade Idrico (v1.0) covers the complete regulatory corpus published up to September 2026 (including the full MTI-4 tariff period). Regulatory acts published after this date require vector database expansion or incremental SFT update cycles.
- Openness to Partnerships & Sponsorships: Idrico Expert is open to institutional, academic, and industrial partnerships, as well as corporate sponsorships from Water Utilities, Area Governing Bodies (EGA), software vendors, and research centers.
- Future Reservation-Based Cloud Service: Future roadmap plans include offering a reservation-based online cloud service (SaaS / Web API) for interactive model inference and enterprise integration with dedicated compute resources.
8. Ownership, Licensing & Usage Terms
- Author and Owner: Davide Parisi (Email:
dp@davideparisi.com). - License & Usage Conditions: Released under Apache 2.0 and CC BY 4.0 licenses subject to mandatory conditions:
- Attribution: Explicitly cite Davide Parisi (
dp@davideparisi.com) and link to the official repository. - Notification Clause: Any public, private, academic, or commercial entity intending to use, integrate, or deploy the model or dataset is required to send a notification email to
dp@davideparisi.com.
- Attribution: Explicitly cite Davide Parisi (
9. Official Disclaimer & Trademarks
- Institutional Non-Affiliation: Pallade Idrico is an independent research and engineering project by Davide Parisi. It is not affiliated with, endorsed by, or sponsored by ARERA, Sapienza University of Rome (Sapienza NLP), FAIR, CINECA, or any other mentioned public institution.
- Third-Party Trademarks: Trademarks, brand names, and software libraries (including NVIDIA, Google, Unsloth, Hugging Face, ChromaDB, PyTorch, Meta, Qwen, LLaMA, etc.) belong to their respective owners and are referenced solely for descriptive and technical identification.
- Operational Value: Pallade Idrico is a decision-support and regulatory orientation tool. It does not constitute binding legal counsel and does not replace official rulings or determinations issued by ARERA or Area Governing Bodies (EGA).
10. Official BibTeX Citation
@techreport{parisi_2026_pallade_idrico,
title = {Pallade Idrico: A Zero-Loss Hybrid RAG-LLM Architecture for Economic Regulation and Governance of the Italian Integrated Water Service},
author = {Parisi, Davide},
email = {dp@davideparisi.com},
institution = {Idrico Expert Initiative},
year = {2026},
type = {Technical Monograph / Research Report},
doi = {10.5281/zenodo.23144167},
url = {https://zenodo.org/records/23144167}
}
- Downloads last month
- 26
Model tree for davideparisi/pallade-idrico-7b
Base model
sapienzanlp/Minerva-7B-base-v1.0