CoolFace
Modelpublic

loll070303/GEMMA3-micio-IT-gguf

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes60downloads
Model Card

Gemma3-MICIO-IT (Intent Classification Engine)

๐Ÿ”ฌ Model Description

Gemma3-MICIO-IT is a specialized Large Language Model (LLM) fine-tuned for Intent Classification in Italian and English, specifically optimized for Smart Home and IoT ecosystems. Built upon the Gemma 3 270M architecture, the model is designed for high-efficiency deployment on local edge devices, ensuring data privacy and low-latency inference.

Technical Specifications

  • โ€”Core Architecture: Gemma 3 (270M parameters)
  • โ€”Training Methodology: Fine-tuned via LoRA (Low-Rank Adaptation)
  • โ€”Optimization: Quantized in GGUF format for CPU/NPU-based local inference
  • โ€”Primary Objective: Mapping natural language utterances to deterministic intent tokens

๐Ÿ“Š Performance Metrics

The model was evaluated on a dedicated test set consisting of 1,083 unseen samples, demonstrating high reliability in home automation contexts.

MetricValue
Global Accuracy98.52%
Class Coverage43 Intent Classes
Inference Throughput~9,000 tokens/sec (Apple M-series/Metal)
Precision (Top 35 Classes)100%

๐Ÿ“‹ Intent Taxonomy

The model classifies inputs into 43 discrete categories, structured into four main functional domains:

1. Internet of Things (IoT)

  • โ€”iot_light_on/off/getstate/changecolor: Lighting control systems.
  • โ€”iot_plug_on/off/getstate: Smart plug and appliance management.
  • โ€”iot_motor_on/off/getstate: Actuator control (blinds, gates, valves).
  • โ€”iot_fan_on/off/getstate: HVAC and ventilation control.
  • โ€”iot_sensor_presencestate/doorstate: Security and environmental sensor monitoring.

2. Multimedia & Entertainment

  • โ€”media_music_play/query: Audio streaming and playback.
  • โ€”media_video_play/query: Smart TV and video content management.
  • โ€”media_volume_up/down/mute: Audio level regulation.

3. Information Management (PIM)

  • โ€”alarm_set/remove/query: Time-based notification management.
  • โ€”calendar_set/remove/query: Scheduling and appointment operations.
  • โ€”list_createoradd/remove/query: Management of lists and reminders.

4. System Security & Utilities

  • โ€”malicious_prompt: Detection of adversarial inputs or prompt injection attempts.
  • โ€”weather_query / datetime_query: Environmental and temporal data retrieval.
  • โ€”general_greet / general_joke: Conversational fillers and basic interaction.

๐Ÿ›  Implementation Guide

Requirements

bash
pip install llama-cpp-python huggingface-hub
Model Loading (GGUF)

Python
from huggingface_hub import hf_hub_download
from llama_cpp import Llama

# Download model weights
model_path = hf_hub_download(
    repo_id="loll070303/GEMMA3-micio-IT-GGUF",
    filename="GEMMA3-micio-IT.gguf"
)

# Initialize Inference Engine
llm = Llama(
    model_path=model_path,
    n_ctx=1024,
    n_gpu_layers=-1, # Set to 0 for CPU-only
    verbose=False
)
Inference Script

Python
SYSTEM_PROMPT = "You are an intent classifier. Reply with ONLY the intent token."

def get_intent(user_input):
    response = llm.create_chat_completion(
        messages=[
            {"role": "system", "content": SYSTEM_PROMPT},
            {"role": "user", "content": user_input}
        ],
        max_tokens=12,
        temperature=0.0
    )
    return response['choices'][0]['message']['content'].strip().lower()

# Usage
# Input: "Spegni tutte le luci in salotto" -> Output: "iot_light_off"
โš ๏ธ Security & Ethics
The inclusion of the malicious_prompt class provides a first-layer defense against prompt injection. However, for critical infrastructure, it is recommended to implement additional validation layers (e.g., PII masking or secondary logic checks).

๐Ÿ“ Citation
If this model contributes to your research or commercial project, please cite the repository to support the development of open-source NLU tools for the Italian language.