GigaEdge-LLM 🦔

GigaEdge-LLM is a compact Russian on-device language model for smart home function calling (129.3M parameters in the autoregressive backbone; 160.1M parameters with 4 Multi-Token Prediction heads for speculative decoding). It receives a user request and the house scene, emits compact parallel tool calls for Home Assistant / smart home devices, and produces a concise Russian reply — running locally on CPU without a network connection.

The model uses a pruned domain-focused BPE vocabulary (8,448 tokens) with dedicated special tokens for smart-home device types, parameters, and functions, plus hybrid Sliding Window Attention (SWA 128) to keep KV-cache memory small and speed up inference on edge hardware.

This repository contains both the ready-to-run giga-edge-sdk component (function_calling/, 90.6 MB full-Q4_0 GGUF with 4 MTP heads) and the standard BF16 Hugging Face safetensors checkpoint (129.3M AR) at the repository root.

Files

Path Precision Size Use case
function_calling/ full-Q4_0 (129.3M AR + 4 MTP) 90.6 MB On-device CPU via giga-edge-sdk
model.safetensors (root) BF16 (129.3M AR) 258.6 MB transformers, fine-tuning, custom quant

Model architecture

Property Value
Parameters (AR / +4 MTP) 129.3M (5.4M tied embeddings) / 160.1M
Architecture Dense Qwen3ForCausalLM (qwen3)
Decoder layers 18 (15 sliding-window + 3 full attention, 5:1 pattern; full attention on layers 6, 12, 18)
MTP heads (GGUF) 4 NextN layers (fused speculative decoding in giga-edge-sdk, default mtp_draft_max: 3)
Sliding window size 128 tokens
Hidden size / FFN intermediate size 640 / 2,560
Attention heads (Q / KV) / head dim 10 / 2 / 128 (GQA with QK-Norm)
Vocabulary size 8,448 (pruned BPE + smart-home special tokens)
Native context length 4,096 tokens (n_ctx: 3072 in the SDK demo config)
Quantization (GGUF) full-Q4_0 PTQ (including token embeddings and output tensor)

Training overview

  1. Pretraining: 206M-parameter dense Qwen3-style backbone with 5:1 SWA (window 128).
  2. Vocabulary pruning: Pruned the original 128k BPE vocabulary down to 8,448 tokens (covering 98.4% of smart-home tokens while reducing the AR backbone from 206M to 129.3M parameters).
  3. General & Domain SFT: General Russian SFT (with 4 MTP heads) followed by ~600k synthetic multi-turn smart-home dialogues covering 28 device types, 90 parameters, parallel tool calls, clarifications, and refusals, with higher loss weights on tool-call tokens.
  4. Reinforcement Learning: Iterative GRPO with difficulty-filtered tasks and strict validation of parallel tool-call batches.
  5. Quantization: Post-training full-Q4_0 quantization with negligible quality drop relative to BF16.

Scope note: This open-source release is trained specifically for smart home control (devices, rooms, groups, state queries, clarifications, and refusals). Other assistant domains such as music playback, timers/alarms, and date/time queries are intentionally excluded.

Compact prompt and function-calling format

To minimize latency and KV-cache recomputation on edge hardware, the static home scene (devices, rooms/groups, and supported rw/ro parameters without live values) is placed at the start of the first user turn and separated from the user request by <sep>. Function calls use dedicated special tokens with positional arguments separated by <arg_sep>:

<s>system<|role_sep|>
<|message_sep|>

user<|role_sep|>
<d_kettle>0 Чайник [Кухня]<p_rw_on_off><p_rw_kitchen_water_temperature_set><p_ro_kitchen_water_temperature>
<d_light>1 Люстра [Кухня]<p_rw_on_off><p_rw_light_brightness><p_ro_online><sep>Включи чайник<|message_sep|>

assistant<|role_sep|>
<start_function_call><f_set_device_parameter><d_kettle>0<arg_sep><p_rw_on_off><arg_sep>true<|message_sep|>

function results<|role_sep|>
{"status": "success"}<|message_sep|>

assistant<|role_sep|>
Чайник включён.<|message_sep|>

Independent tool calls in a single turn are emitted sequentially before <|message_sep|> for parallel execution by the host runtime.

The model does not check whether a device is on. If you ask it to turn up a TV that is off, it raises the volume but does not turn the TV on; what should happen in that case is up to your device integration.

Evaluation results

Unweighted mean across 6 internal Russian smart-home benchmarks (LLM-as-a-judge Gemma 4 31B, overall score from 1 to 5; 95% CIs are dialog-level bootstrap intervals with 10,000 resamples). Avg. tokens/turn is the unweighted mean across the same 6 benchmarks and includes all tool-call rounds and thinking tokens.

Model Mode Params Score (1–5) 95% CI Avg. tokens/turn
Gemma 4 E4B thinking 8.0B 4.60 [4.57, 4.62] 520
Qwen 3.5 4B thinking 4.7B 4.52 [4.48, 4.56] 626
Gemma 4 E2B thinking 5.1B 4.35 [4.31, 4.39] 610
Qwen 3.5 4B instant 4.7B 4.32 [4.27, 4.36] 128
GigaEdge-LLM (BF16) instant 129M 4.24 [4.20, 4.28] 26
GigaEdge-LLM (full-Q4_0) instant 129M 4.24 [4.20, 4.28] 26
Gemma 4 E4B instant 8.0B 4.17 [4.13, 4.20] 56
Gemma 4 E2B instant 5.1B 3.72 [3.67, 3.76] 62
Qwen 3.5 2B thinking 2.3B 3.36 [3.31, 3.42] 3140
Qwen 3.5 2B instant 2.3B 3.16 [3.10, 3.21] 310
Qwen 3.5 0.8B instant 0.87B 2.40 [2.35, 2.45] 217
Qwen 3.5 0.8B thinking 0.87B 2.15 [2.10, 2.19] 2628

Usage

1. giga-edge-sdk (full-Q4_0 GGUF with MTP, recommended)

The directory function_calling/ is a part of the SDK model, version function_calling.oss.1.0.0, ready to load in the offline assistant demo of giga-edge-sdk (example/offline_assistant): meta.json, the graph model/config.yaml and the full-Q4_0 GGUF with 4 MTP heads next to it. The graph builds the prompt from the devices of Home Assistant and turns the calls of the model into calls of Home Assistant tools over MCP.

The GGUF needs the llama.cpp that the SDK builds. Its patches add what the model uses: per-layer Qwen3 Sliding Window Attention, the pruned gpt-4o pre-tokenizer and fused MTP speculative decoding. Stock llama.cpp does not have them.

From the root of giga-edge-sdk:

pip install -U huggingface_hub
M=example/offline_assistant/model
hf download ai-sage/GigaEdge-LLM --include "function_calling/*" --local-dir $M
hf download ai-sage/GigaEdge-Models --include "*/*" --local-dir $M

The second command brings the other models of the demo, GigaEdge Models: wake word, speech recognition, end of utterance and speech synthesis. Then build and run the demo as its README says.

  • The room of the assistant is current_room of the ha_catalog node in function_calling/model/config.yaml: requests without a room go there.
  • By default mtp_draft_max: 3 enables 3-token fused MTP speculative decoding (swa_full: true). Set mtp_draft_max: 0 to skip loading the MTP heads into RAM (TENSOR_SKIP, saving ~17.4 MB of weight memory).
  • The model knows a fixed set of device categories and functions. The README of the Home Assistant adapter of the SDK, giga_edge/modules/smart_home_ha, lists them and says what the model cannot do yet.

2. transformers (BF16, for fine-tuning and research)

Use the root BF16 safetensors checkpoint if you plan to fine-tune the model, run custom quantization, or inspect raw outputs in Python (for out-of-the-box smart home inference, use giga-edge-sdk above). Tested with transformers 5.24.1 (requires per-layer Qwen3 sliding_attention / full_attention support).

Note: Running directly with transformers only executes raw model generation — your own code must format the scene (<d_*> / <p_rw_*> / <p_ro_*>), parse compact <start_function_call> tool calls (including parallel batches), execute them, and feed JSON results back in a tool turn.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "ai-sage/GigaEdge-LLM"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16)

scene = "\n".join([
    "<d_kettle>0 Чайник [Кухня]<p_rw_on_off><p_rw_kitchen_water_temperature_set><p_ro_kitchen_water_temperature>",
    "<d_light>1 Люстра [Кухня]<p_rw_on_off><p_rw_light_brightness><p_ro_online>",
])
messages = [{"role": "user", "content": f"{scene}<sep>Включи чайник"}]

# Step 1: generate compact function call (stops automatically at <|message_sep|>)
inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
)
out = model.generate(**inputs, max_new_tokens=256)
tool_call = tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=False)
tool_call = tool_call.removesuffix("<|message_sep|>\n\n").removesuffix("</s>")
print("Tool call:", tool_call)
# <start_function_call><f_set_device_parameter><d_kettle>0<arg_sep><p_rw_on_off><arg_sep>true

# Step 2: return tool execution result and generate the final response
messages.extend([
    {"role": "assistant", "content": tool_call},
    {"role": "tool", "content": '{"status": "success"}'},
])
inputs = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
)
out = model.generate(**inputs, max_new_tokens=256)
answer = tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print("Answer:", answer)
# Включил чайник.

License

This model is released under the MIT License.

Downloads last month
23
Safetensors
Model size
0.1B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including ai-sage/GigaEdge-LLM