Instructions to use Maxinger15/LunaraHome-Gemma4-E4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Maxinger15/LunaraHome-Gemma4-E4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Maxinger15/LunaraHome-Gemma4-E4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Maxinger15/LunaraHome-Gemma4-E4B") model = AutoModelForMultimodalLM.from_pretrained("Maxinger15/LunaraHome-Gemma4-E4B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Maxinger15/LunaraHome-Gemma4-E4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Maxinger15/LunaraHome-Gemma4-E4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Maxinger15/LunaraHome-Gemma4-E4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Maxinger15/LunaraHome-Gemma4-E4B
- SGLang
How to use Maxinger15/LunaraHome-Gemma4-E4B 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 "Maxinger15/LunaraHome-Gemma4-E4B" \ --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": "Maxinger15/LunaraHome-Gemma4-E4B", "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 "Maxinger15/LunaraHome-Gemma4-E4B" \ --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": "Maxinger15/LunaraHome-Gemma4-E4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Maxinger15/LunaraHome-Gemma4-E4B with Docker Model Runner:
docker model run hf.co/Maxinger15/LunaraHome-Gemma4-E4B
π LunaraHome Gemma4-E4B Β· v1
A small, fast voice-assistant brain for Home Assistant.
LunaraHome turns everyday German (and English) requests into Home Assistant and Music Assistant tool calls. It stays silent when a sentence wasn't meant for it. I fine-tuned Gemma 4 E4B on my own dataset of household commands, safety-relevant actions and false triggers. This repository holds the merged BF16 weights; for llama.cpp use the GGUF version.
Evaluation details Β· Licenses Β· Discord for updates and feedback
Benchmark
- Overall: in BF16 it solves 1,555 of 1,812 cases (85.8 %), the untrained base 690.
- Tool calls and safety: tool calls rise from 309 to 708 of 800, safety-relevant actions from 226 to 454 of 498.
- Silence and false triggers: it stays silent in all 104 silence cases and all 50 real false triggers.
- General knowledge: retention multiple choice stays level (359 β 362 of 512).
The chart shows the quantized files as users run them. This is my own development benchmark, not an independent test.
Training
- Method: LoRA on the text attention (Q/V, rank 8, alpha 16), one epoch on my dataset v5.
- 22,101 rows, 2,763 steps, learning rate 2e-4, up to 6,144 tokens.
- Trained on a single RTX 4090, then merged into the base weights.
- Unchanged: vision and audio parts come unchanged from Gemma 4 E4B.
Getting started
from transformers import AutoTokenizer, Gemma4ForConditionalGeneration
model_id = "Maxinger15/LunaraHome-Gemma4-E4B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = Gemma4ForConditionalGeneration.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
Pass Home Assistant's real system prompt, the exposed entities and the offered
tools through the chat template with thinking disabled. The training reference
is Home Assistant 2026.9.3. An empty reply means "not meant for me".
Limitations
- Safety: I have not reviewed 8 safety cases that got worse than the base model, such as disarming an alarm or turning off a lock instead of locking it.
- Don't let it control locks, alarms, gates or valves unattended.
- Keep confirmations in your integration.
- Benchmark: my numbers come from my own cases. They don't prove the model works for every household.
License
The Gemma base, tokenizer and template remain under Apache 2.0. My own contributions are MIT. The training sources keep their licenses; see THIRD_PARTY_NOTICES.md. LunaraHome is an independent hobby project, not an official product of Google, Home Assistant or Music Assistant.
- Downloads last month
- 127
