Instructions to use ai-sage/GigaEdge-LLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ai-sage/GigaEdge-LLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ai-sage/GigaEdge-LLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ai-sage/GigaEdge-LLM") model = AutoModelForCausalLM.from_pretrained("ai-sage/GigaEdge-LLM", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ai-sage/GigaEdge-LLM with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ai-sage/GigaEdge-LLM # Run inference directly in the terminal: llama cli -hf ai-sage/GigaEdge-LLM
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ai-sage/GigaEdge-LLM # Run inference directly in the terminal: llama cli -hf ai-sage/GigaEdge-LLM
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf ai-sage/GigaEdge-LLM # Run inference directly in the terminal: ./build/bin/llama cli -hf ai-sage/GigaEdge-LLM
Use Docker
docker model run hf.co/ai-sage/GigaEdge-LLM
- Llama new
- LM Studio
- Jan
- vLLM
How to use ai-sage/GigaEdge-LLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ai-sage/GigaEdge-LLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-sage/GigaEdge-LLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ai-sage/GigaEdge-LLM
- SGLang
How to use ai-sage/GigaEdge-LLM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ai-sage/GigaEdge-LLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-sage/GigaEdge-LLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ai-sage/GigaEdge-LLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ai-sage/GigaEdge-LLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use ai-sage/GigaEdge-LLM with Ollama:
ollama run hf.co/ai-sage/GigaEdge-LLM
- Unsloth Desktop
- Docker Model Runner
How to use ai-sage/GigaEdge-LLM with Docker Model Runner:
docker model run hf.co/ai-sage/GigaEdge-LLM
- Lemonade
How to use ai-sage/GigaEdge-LLM with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ai-sage/GigaEdge-LLM
Run and chat with the model
lemonade run user.GigaEdge-LLM-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf ai-sage/GigaEdge-LLM# Run inference directly in the terminal:
llama cli -hf ai-sage/GigaEdge-LLMBuild from source code
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-app# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama serve -hf ai-sage/GigaEdge-LLM# Run inference directly in the terminal:
./build/bin/llama cli -hf ai-sage/GigaEdge-LLMUse Docker
docker model run hf.co/ai-sage/GigaEdge-LLMGigaEdge-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
- Pretraining: 206M-parameter dense Qwen3-style backbone with 5:1 SWA (window 128).
- 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).
- 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.
- Reinforcement Learning: Iterative GRPO with difficulty-filtered tasks and strict validation of parallel tool-call batches.
- Quantization: Post-training
full-Q4_0quantization 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_roomof theha_catalognode infunction_calling/model/config.yaml: requests without a room go there. - By default
mtp_draft_max: 3enables 3-token fused MTP speculative decoding (swa_full: true). Setmtp_draft_max: 0to 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
Install (macOS, Linux)
# Start a local OpenAI-compatible server with a web UI: llama serve -hf ai-sage/GigaEdge-LLM# Run inference directly in the terminal: llama cli -hf ai-sage/GigaEdge-LLM