Instructions to use Truthseeker87/solarhive-26b-a4b-nf4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Truthseeker87/solarhive-26b-a4b-nf4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Truthseeker87/solarhive-26b-a4b-nf4") 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("Truthseeker87/solarhive-26b-a4b-nf4") model = AutoModelForMultimodalLM.from_pretrained("Truthseeker87/solarhive-26b-a4b-nf4", 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 Truthseeker87/solarhive-26b-a4b-nf4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Truthseeker87/solarhive-26b-a4b-nf4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Truthseeker87/solarhive-26b-a4b-nf4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Truthseeker87/solarhive-26b-a4b-nf4
- SGLang
How to use Truthseeker87/solarhive-26b-a4b-nf4 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 "Truthseeker87/solarhive-26b-a4b-nf4" \ --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": "Truthseeker87/solarhive-26b-a4b-nf4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "Truthseeker87/solarhive-26b-a4b-nf4" \ --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": "Truthseeker87/solarhive-26b-a4b-nf4", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use Truthseeker87/solarhive-26b-a4b-nf4 with Docker Model Runner:
docker model run hf.co/Truthseeker87/solarhive-26b-a4b-nf4
- SolarHive 26B A4B NF4 — Community Solar Energy Intelligence (Quantized)
- Overview
- Mission
- Why 26B A4B? Model Architecture Selection
- Quantization Details
- Benchmark Results
- Key Specifications
- Precision Note — NF4 vs the BF16 Source vs the Native Gemma 4 Release
- Training Details
- How to Use
- Core Capabilities
- Community Model Specifications
- Technical Notes
- Limitations
- Future Iteration — Multi-Token Prediction (MTP) Drafters
- Companion Repositories
- Corrections (November 21, 2026)
- Citation
- Overview
SolarHive 26B A4B NF4 — Community Solar Energy Intelligence (Quantized)
Overview
SolarHive 26B A4B NF4 is the 4-bit quantized version of solarhive-26b-a4b-merged, pre-quantized to NF4 via bitsandbytes so the model loads in NF4 directly without runtime quantization. Designed for deployment on Hugging Face Spaces and Colab. In the May 2026 run it used 49.2 GB of GPU memory on one GPU (notebook 3, cell 47).
It is a LoRA fine-tuned Gemma 4 26B A4B (MoE) model specialized in community solar energy intelligence with native function calling, multimodal VQA, and selective tool reasoning.
Why pre-quantized?
- No runtime quantization — skips the CPU-intensive quantization step at startup
- Faster Space startup — model loads directly in NF4, ready for inference immediately
- Same tool routing score in the May 2026 run: 4 of 5 tool prompts, the same as the BF16 merged variant (notebook 3, cells 45 and 47). One run cannot show that quantization is lossless.
- Embedded quantization config — loads in NF4 automatically without user-specified
BitsAndBytesConfig
Key Features:
- Domain expertise in solar production, battery management, grid optimization, and community coordination
- Multimodal visual question answering from the base vision encoder (sky analysis, panel inspection, neighborhood assessment). VQA was not scored.
- Native function calling for the five energy tools listed under Core Capabilities
- Tool grounded answers that can cite live API data. Outputs can still contain wrong numbers.
- No Unsloth dependency — loads with standard
transformers
Mission
SolarHive is a learning prototype of an open-source energy advisor for community microgrids and shared storage. It explores how a fine tuned model could help plan around midday solar surplus, solar irradiance and cloud cover. It controls no real equipment, and no real community has tested it. The shared battery is a simulator.
Why 26B A4B? Model Architecture Selection
Gemma 4 offers four model sizes. This project compared all four using Google's published benchmarks and fine tuned two of them: 26B A4B for cloud inference (the model behind this repository) and E4B for edge deployment.
| Model | Params (Total / Active) | Architecture | Vision Encoder | Context | Modalities | Selection |
|---|---|---|---|---|---|---|
| E2B | 5.1B / 2.3B effective | Dense + PLE | ~150M | 128K | Text, Image, Audio | Considered for Ollama serving. Not fine tuned or shipped. |
| E4B | 8B / 4.5B effective | Dense + PLE | ~150M | 128K | Text, Image, Audio | Fine tuned for edge |
| 26B A4B | 25.2B / 3.8B active | MoE (8/128 + 1 shared) | ~550M | 256K | Text, Image | This model: cloud inference |
| 31B | 30.7B / 30.7B | Dense | ~550M | 256K | Text, Image | Not selected |
The table below contains Google's published base model benchmarks. These results provide model selection context. They do not measure SolarHive quality, speed or cost.
| Benchmark | SolarHive Use Case | E4B | 26B A4B | 31B |
|---|---|---|---|---|
| MMMU Pro (vision) | Sky/panel VQA analysis | 52.6% | 73.8% | 76.9% |
| MATH-Vision | Visual reasoning on solar data | 59.5% | 82.4% | 85.6% |
| OmniDocBench (lower=better) | Document understanding | 0.181 | 0.149 | 0.131 |
| MMLU Pro | Domain expertise (energy advisory) | 69.4% | 82.6% | 85.2% |
| GPQA Diamond | Scientific reasoning | 58.6% | 82.3% | 84.3% |
| MRCR v2 128K | Long context retrieval | 25.4% | 44.1% | 66.4% |
Source: Gemma 4 Model Card (the older ai.google.dev link now redirects there). All four models support native function calling and agentic workflows.
Selection notes:
- Vision benchmarks: Google reports higher base model vision scores for 26B A4B than for E4B. SolarHive did not score VQA, so this project does not establish better sky or panel analysis.
- MoE sparse activation: the model activates 3.8B of its 25.2B parameters per token.
- 256K context window. This project did not run a long context evaluation.
- Training loss: 0.6956 for 26B A4B and 0.9218 for E4B (average of the last 20 steps). No validation loss was measured, so these values do not compare model quality.
Why not 31B? 31B scores about 3 points higher than 26B A4B on MMMU Pro and MMLU Pro, and 22 points higher on MRCR v2 128K, in Google's published results. It needs more GPU memory because all 30.7B parameters are active. This project did not measure 31B speed, quality or cost.
Quantization Details
| Parameter | Value |
|---|---|
| Source Model | Truthseeker87/solarhive-26b-a4b-merged (BF16) |
| Quantization Method | NF4 (4-bit NormalFloat) via bitsandbytes |
| Compute dtype | BF16 (for dequantized computation) |
| Quantized Layers | 426 / 861 weighted layers (linear layers) |
| Non-quantized Layers | Embeddings, layer norms, gate layers (remain in BF16) |
| Model Size on Disk | 48.34 GB (decimal GB, Hugging Face file listing; bitsandbytes serialized NF4, includes quantization state) |
| GPU memory | 49.2 GB on one GPU in the May 2026 run (notebook 3, cell 47). The archived runs do not include a CPU offload load with device_map="auto", so this card no longer claims a 24 GB fit |
| Quantization Tool | bitsandbytes >=0.45.0 on Google Colab Pro (NVIDIA RTX PRO 6000 Blackwell) |
Why NF4?
NF4 (NormalFloat 4-bit) is optimized for normally-distributed neural network weights, providing better accuracy than uniform INT4 quantization. The 26B A4B uses a MoE architecture with 128 routed experts + 1 shared expert per MoE layer, activating only 8 experts (3.8B params) per forward pass out of 25.2B total. The model has 30 layers with a ~550M parameter vision encoder.
Architectural Note: Partial Quantization
bitsandbytes quantizes only torch.nn.Linear layers. Gemma 4's MoE expert weights use Gemma4ClippableLinear, a custom subclass that bitsandbytes does not recognize. This means 435 of 861 weighted layers (the MoE expert gate/routing layers) remain in BF16, and the file is 48.34 GB on disk. This explanation comes from the original card. It has not been checked with a tensor or configuration audit, and the GitHub README does not state a cause for the NF4 file size.
A smaller 4-bit file would need a method that quantizes every linear layer type, such as GPTQ or AWQ. This project did not try either method. The Hugging Face Space demo (now paused) used the runtime BitsAndBytesConfig approach. This project did not compare its accuracy with this pre-quantized file.
Benchmark Results
How to read these scores. The Q&A half of each 8/8, 9/10 and 10/10 score is not graded. The benchmark script records 5 of 5 Q&A once it generates five answers. Only tool routing and When2Call are scored by code. The 8/8 score comes from the earlier check at the end of the April 2026 fine tune notebook (notebook 2: 5 Q&A recorded, not graded, plus 3 tool prompts). The 9/10 and 10/10 scores come from the final May 2026 inference run (notebook 3: 5 Q&A recorded, not graded, plus 5 tool prompts and 3 When2Call probes). The two checks use different tool prompts. The prompts are project prompts, not a public benchmark, and they are not held out. Close paraphrases of the three When2Call probes appear in the training data, and the When2Call matcher is a lenient keyword check. Each score comes from a single run at temperature 1.0. The archived notebooks are in archive/final_run/.
Earlier 8 question check (reported by the original card)
The original card reported an 8 question check on this NF4 model after quantization: 5 Q&A answers (recorded, not graded) and 3 of 3 tool prompts. The notebook for that check is not in the GitHub repository, so the result cannot be verified there. The same three tool prompts appear in the April 2026 fine tune notebook (notebook 2, cell 35), which ran the LoRA model before the merge and quantization.
| Question | Expected Tool(s) | Result (original card) |
|---|---|---|
| "What's the current battery state?" | get_battery_state |
PASS |
| "How much solar are we producing right now in Seattle?" | get_weather or get_solar_production |
PASS |
| "What are the general maintenance tips for panels?" | No tool call | PASS |
Final run: May 2026 inference notebook (9/10)
The final inference run used Colab Pro G4 (NVIDIA RTX PRO 6000 Blackwell). This A4B NF4
variant loaded directly through AutoModelForCausalLM.from_pretrained(..., device_map="cuda:0"),
with no BitsAndBytesConfig because the weights are pre-quantized on disk. It used 49.2 GB of
GPU memory (notebook 3, cell 47).
Score: 5/5 Q&A recorded (not graded) + 4/5 tool = 9/10 on the 10 question set, the same totals as the BF16 merged variant. One run on 5 tool prompts cannot show that NF4 quantization is lossless.
The single tool FAIL is the lenient multi call probe, "Compare today's irradiance forecast across Ann Arbor, Phoenix, and Seattle" (min_calls=2), where this variant returned no tool call. Four of the five cloud variants failed this probe. Only the E4B LoRA + base variant chained the multi city calls (3 × get_weather). Each variant ran once at temperature 1.0. A repeated run would show how stable the result is.
When2Call probes: 3/3, measured in a single run (notebook 3, cell 47)
The probe categories come from Ross, H., Mahabaleshwarkar, A. S., & Suhara, Y. (2025). When2Call: When (not) to Call Tools. arXiv:2504.18851. The paper links missing follow up and unable to answer training data to higher tool hallucination. The SolarHive probes are not held out: close paraphrases of all three appear in the training data (solarhive_datagen.py lines 2717, 5079 and 5107), and the matcher is a lenient keyword check (solarhive_inference.py lines 1232 to 1252).
| Probe | Question | A4B NF4 result |
|---|---|---|
| (b) Tool routing | "What's the current grid rate?" | Pass: called get_grid_status |
| (c) Follow up question | "How much will a 10 kW array produce today?" | Pass under the lenient matcher: no tool call and a content keyword match. This cell does not print the full response. |
| (d) Refuse + redirect | "What's the current air quality index in Ann Arbor?" | Pass under the lenient matcher: no tool call and a content keyword match. This cell does not print the full response. |
In the May 2026 final inference run (notebook 3), all five cloud variants were measured directly on the three probes in a single run. The A4B LoRA (cell 33), A4B merged (cell 45) and A4B NF4 (cell 47) variants scored 3 of 3. The E4B LoRA (cell 39) and E4B merged (cell 41) variants scored 2 of 3, and both failed probe (c). The E4B GGUF scored 2 of 3 in a separate local Ollama run and failed probe (d). Its results file is not committed. Three probes, one run and a lenient matcher cannot show that a merge or quantization step is lossless. They also cannot show that the A4B and E4B gap comes from model size.
Model size context
Google reports higher base model benchmark scores for 26B A4B than for E4B on MMLU Pro (82.6% vs 69.4%), MMMU Pro (73.8% vs 52.6%), AIME 2026 (88.3% vs 42.5%) and LiveCodeBench v6 (77.1% vs 52.0%) (Gemma 4 model card). These upstream scores do not predict SolarHive When2Call behavior. The single SolarHive run does not establish a scaling relationship or a deployment routing rule.
Key Specifications
| Parameter | Value |
|---|---|
| Base Model | google/gemma-4-26B-A4B-it |
| Source Model | Truthseeker87/solarhive-26b-a4b-merged |
| Architecture | MoE — 25.2B total, 3.8B active (8/128 + 1 shared experts) |
| Modalities | Text + Image |
| Context Length | 256K tokens |
| Fine-Tuning Method | LoRA via Unsloth (BF16), merged to 16-bit, then quantized to NF4 |
| Training Data | 1,727 examples (solarhive-community-solar-multimodal) — text-only fine-tune; VQA at inference uses the base Gemma 4 vision encoder (~550M params), unmodified by our LoRA per the Vertex AI SFT recipe |
| Converged Loss | 0.6956 |
| Benchmark Score | 9/10 in the May 2026 final run: 5/5 Q&A recorded (not graded) + 4/5 tool routing, plus 3/3 When2Call. Same totals as BF16 merged. Single run, not held out |
| Precision | NF4 + BF16 hybrid (426/861 layers quantized per the original card). 48.34 GB on disk; 49.2 GB GPU memory on one GPU in the May 2026 run |
| License | MIT (SolarHive files in this repository) / Apache 2.0 (base model, per Google's Gemma 4 license page and Hugging Face model page) |
Precision Note — NF4 vs the BF16 Source vs the Native Gemma 4 Release
This repository is the only quantization step in the SolarHive 26B A4B release. The pipeline is:
Google's open-source Gemma 4 26B A4B base (BF16, native release precision)
↓ LoRA fine-tuning at BF16 (Unsloth FastVisionModel)
solarhive-26b-a4b-lora: adapter weights (BF16, ~2 GB)
↓ merge_16bit (Unsloth save_pretrained_merged)
solarhive-26b-a4b-merged: full BF16 weights (same precision as base, 51.61 GB on disk)
↓ BitsAndBytesConfig(load_in_4bit=True, nf4): THIS step is the only quantization
solarhive-26b-a4b-nf4: partial NF4 quantization (this repo, 48.34 GB on disk)
BF16 is Google's native release precision for Gemma 4 — the open-source
base at google/gemma-4-26B-A4B-it
is itself BF16. The intermediate LoRA
and merged
artifacts preserve that precision exactly. Only this NF4 repository
introduces a precision change — and only for 426 of 861 weighted layers
(the standard torch.nn.Linear ones); the MoE expert weights stay in BF16
because bitsandbytes does not recognize the Gemma4ClippableLinear subclass,
according to the original card (see the note under Quantization Details). The
file is 48.34 GB on disk.
| Artifact | Precision | Notes |
|---|---|---|
| Google's Gemma 4 26B A4B base | BF16 | Native release precision; no FP32 source exists |
| SolarHive LoRA adapters | BF16 (delta only) | Apply over base via Unsloth |
| SolarHive merged BF16 | BF16 (full model) | Same precision as base + LoRA delta folded in |
| This NF4 repo | NF4 + BF16 hybrid | 426 Linear layers quantized; 435 MoE expert layers stay BF16 |
In the May 2026 run, this NF4 model and the BF16 merged model both scored 4 of 5 on tool routing and 3 of 3 on the When2Call probes. One run on these small sets cannot show that the partial quantization preserves quality.
Training Details
| Parameter | Value |
|---|---|
| Method | LoRA via Unsloth FastVisionModel (BF16, RTX PRO 6000 Blackwell 102 GB) |
| LoRA rank | 16 |
| LoRA alpha | 16 |
| Learning rate | 2e-4 |
| Epochs | 3 |
| Max sequence length | 2048 |
| Precision | BF16 (training) → NF4 (this quantized release) |
| Trainable parameters | 505.4M / 26.3B (1.92%) |
| Training time | 7,198 seconds (~120 minutes) |
| Hardware | Google Colab Pro (NVIDIA RTX PRO 6000 Blackwell) |
Training Data — 1,727 Examples
Canonical training corpus: solarhive-community-solar-multimodal:
- 413 hand-crafted examples across 15+ US cities, 9 energy domains
- ~1,117 API-grounded examples from Open-Meteo, PVWatts, OpenWeatherMap, EIA
- 183 tool-calling examples (positive, negative refusals, follow-up clarifications, failure-recovery; When2Call taxonomy)
- 14 image-grounded Q&A turns from 7 manually-labeled Ann Arbor sky photographs
The dataset was generated with the original temperature derating formula and the old NREL host. Both are fixed in code. Dataset regeneration and retraining are pending (see Limitations).
How to Use
Loading Pre-Quantized Model (Recommended)
No BitsAndBytesConfig needed — weights are already quantized:
from transformers import AutoProcessor, AutoModelForCausalLM
import torch
processor = AutoProcessor.from_pretrained(
"google/gemma-4-26B-A4B-it",
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
"Truthseeker87/solarhive-26b-a4b-nf4",
device_map="cuda:0",
trust_remote_code=True,
)
Two-Step Tokenization (Required)
messages = [
{"role": "system", "content": "You are SolarHive, an AI energy advisor for a community of 12 homes with rooftop solar and shared battery storage in Ann Arbor, Michigan."},
{"role": "user", "content": "How will today's weather affect our solar production?"},
]
# Step 1: render text (tokenize=False)
text = processor.apply_chat_template(
messages, tools=tools,
add_generation_prompt=True,
enable_thinking=False,
tokenize=False,
)
# Step 2: tokenize separately
inputs = processor(text=text, images=None, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=1024, temperature=1.0, top_p=0.95, top_k=64)
response = processor.tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True)
Native Function Calling
def get_weather(location: str) -> dict:
"""Get current weather conditions for a location.
Args:
location: City name, e.g. 'Ann Arbor, MI'
Returns:
dict with temp_f, clouds_pct, wind_mph, humidity, sunrise, sunset
"""
...
def get_solar_production(clouds_pct: int, temp_f: float) -> dict:
"""Get estimated community solar production using GHI irradiance data.
Args:
clouds_pct: Cloud cover percentage (0-100)
temp_f: Temperature in Fahrenheit
Returns:
dict with production_kw, capacity_kw, efficiency_pct, ghi_wm2
"""
...
tools = [get_weather, get_solar_production, get_battery_state, get_grid_status]
text = processor.apply_chat_template(
messages, tools=tools,
add_generation_prompt=True,
enable_thinking=False,
tokenize=False,
)
Core Capabilities
1. Multimodal Visual Question Answering (3 Modes)
| Mode | Input | Output |
|---|---|---|
| Sky Analysis | Sky photograph | Cloud coverage %, production forecast, storage recommendation |
| Panel Inspection | Panel photograph | Dirt/damage/shading detection, efficiency impact estimate |
| Neighborhood Assessment | Aerial/satellite image | Panel inventory, expansion priorities, shading analysis |
2. Native Function Calling (5 Tools — all 3 keyed APIs wired)
| Tool | API | Returns |
|---|---|---|
get_weather(location) |
OpenWeatherMap (OWM_API_KEY) |
Temperature, clouds %, wind, humidity, sunrise/sunset |
get_solar_production(clouds_pct, temp_f) |
Open-Meteo GHI (keyless) | Production kW, efficiency %, GHI W/m2, temp derating |
get_battery_state() |
Community BMS (sim) | State of charge, capacity, charging status |
get_grid_status() |
EIA Open Data (EIA_API_KEY) |
Pricing period, rate/kWh, renewable %, CO2 intensity |
get_nrel_pvwatts_baseline() |
NREL PVWatts v8 (NREL_API_KEY) |
Annual + current-month typical kWh + avg kW for the 72 kW array |
Tool results feed back as a 2-message sequence matching the training distribution: {"role": "assistant", "tool_calls": [...]} then {"role": "tool", "name": "<fn>", "content": json.dumps(result)}. Shared across solarhive_datagen.py, solarhive_finetune.py and solarhive_inference.py Cell 4. An earlier test script, test_ollama_tools.py, is not in the public GitHub repository.
3. Selective Tool Reasoning
The model intelligently decides when to call tools:
- "What time does peak pricing start?" → Calls:
get_grid_status()only - "Is today's production above typical for January?" → Calls:
get_solar_production()+get_nrel_pvwatts_baseline() - "Should I run my pool heater now?" → Calls:
get_weather()+get_solar_production()+get_battery_state()+get_grid_status() - "What are general maintenance tips?" → Calls: none
4. Inference-time When2Call Validation
Three project probes cover 3 of the 4 categories in the When2Call taxonomy. The probe categories come from Ross, H., Mahabaleshwarkar, A. S., & Suhara, Y. (2025). When2Call: When (not) to Call Tools. arXiv:2504.18851. The paper links missing follow up and unable to answer training data to higher tool hallucination. The SolarHive probes are not held out: close paraphrases of all three appear in the training data (solarhive_datagen.py lines 2717, 5079 and 5107), and the matcher is a lenient keyword check (solarhive_inference.py lines 1232 to 1252).
- (b) "What's the current grid rate?" → expect a
get_grid_statuscall (well specified, in scope) - (c) "How much will a 10 kW array produce today?" → expect a follow up question that asks for the location
- (d) "What's the current air quality index in Ann Arbor?" → expect a refusal and a redirect, with no tool call
The SolarHive training corpus includes 16 matching examples (10 unable-to-answer + 6 follow-up clarification). This NF4 variant scored 3/3 in a single run (notebook 3, cell 47).
Community Model Specifications
| Parameter | Value |
|---|---|
| Location | Ann Arbor, Michigan (42.2808N, 83.7430W) |
| Community size | 12 homes |
| Total panel capacity | 72 kW |
| Shared battery storage | 100 kWh |
| Grid region | MISO (Midcontinent Independent System Operator) |
Technical Notes
- Pre-quantized model: NF4 weights are saved directly via
push_to_hub()(bitsandbytes >=0.45.0) — noBitsAndBytesConfigneeded at load time. JustAutoModelForCausalLM.from_pretrained()withdevice_map="cuda:0". - Processor from base model: Use
AutoProcessor.from_pretrained("google/gemma-4-26B-A4B-it")— the base model's processor has the correct chat template with native tool-call support - Two-step tokenization: Single-step
tokenize=Truecrashes in transformers 5.5.x on messages without acontentkey — always use the two-step approach - System prompt repetition: The message format repeats the system prompt. This adapts an idea from Leviathan, Kalman & Matias (2025), Prompt Repetition Improves Non-Reasoning LLMs (arXiv:2512.14982). The cited paper repeated the full input query, not the system prompt. This project did not measure the effect of its variation.
- GPU memory: Used 49.2 GB on one GPU with
device_map="cuda:0"in the May 2026 run (notebook 3, cell 47). The archived runs do not test CPU offload withdevice_map="auto". The repository'squantization_configsetsllm_int8_enable_fp32_cpu_offloadtofalse. - Memory footprint: The original card reports a 48.30 GB memory footprint. The file is 48.34 GB on disk. All sizes on this card are decimal GB.
- Quantization verified: 426 Linear4bit layers confirmed after save/load cycle from HuggingFace Hub
- Sampling: temperature=1.0, top_p=0.95, top_k=64 (Kaggle-recommended defaults)
- Dependencies:
transformers>=5.5.0,accelerate,bitsandbytes>=0.45.0 - For full BF16 precision: Use the merged model (51.61 GB on disk; used 52.4 GB of GPU memory in the May 2026 run)
Limitations
- Prototype tested on single community (12 homes, Ann Arbor) — validation needed across geographies
- Model occasionally uses "60 kW" instead of correct 72 kW capacity in direct VQA responses
- Tool responses depend on external API availability with rate limits
- Battery state simulator is deterministic for demonstrations
- NF4 quantization may introduce minor quality variations compared to BF16 on edge cases
- For maximum quality, use the BF16 merged model
- Does not fit small GPUs in a single GPU load. The model used 49.2 GB of GPU memory. It does not fit a 16 GB or 40 GB GPU in a single GPU load.
- Small, single run evaluation. Each benchmark ran once at temperature 1.0 on 5 tool prompts and 3 When2Call probes. The Q&A half of each score is recorded, not graded. The prompts are not held out.
- VQA was not scored. The fine tune is text only. The May 2026 VQA tests used synthetic placeholder images.
- The Hugging Face Space demo is paused.
- Training data predates the November 20, 2026 code fixes. The dataset that trained this model was generated with the original temperature derating, which applied 0.4% loss per °F above 77°F to air temperature. Panel temperature coefficients are stated per °C and refer to cell temperature. The data generation code also called
developer.nrel.gov, a host that stopped serving requests on May 29, 2026. As of November 20, 2026, the code onmainin the GitHub repository (commita89b751) applies 0.4% loss per °C above 25°C, with the original 0.75 floor, to a cell temperature estimated with the NOCT model from air temperature, GHI and wind, and it callsdeveloper.nlr.gov. The published dataset, this model and every score on this card still come from the old formula and the old host. Dataset regeneration, a new fine tune and a rerun are pending. See Known Limitations in the GitHub README.
Future Iteration — Multi-Token Prediction (MTP) Drafters
Not in the measured numbers above. Google announced Gemma 4 MTP drafters on May 5, 2026 (blog, overview, HF collection, Kaggle, @GoogleGemma) — after this artifact's final benchmark was captured. The benchmarks above reflect standard autoregressive decoding only. MTP integration is documented here as future iteration; no measured speedup is claimed in this release.
Theoretical foundation. Speculative decoding (Leviathan, Kalman & Matias, Fast Inference from Transformers via Speculative Decoding, ICML 2023, arXiv:2211.17192) accelerates generation without changing the output distribution under argmax decoding: a smaller drafter proposes γ candidate tokens, the target verifies all γ in a single parallel forward pass, accepted tokens are kept, and any rejection is resampled from a corrected distribution. The output distribution is preserved exactly regardless of drafter quality; only acceptance rate α, and therefore walltime speedup, varies.
What Google released on May 5, 2026. Paired drafter checkpoints for all four IT-tuned Gemma 4 variants — gemma-4-E2B-it-assistant, gemma-4-E4B-it-assistant, gemma-4-26B-A4B-it-assistant, gemma-4-31B-it-assistant — discoverable via the google/gemma-4 Hugging Face collection and on Kaggle Models. The drafters share the input embedding table with their paired target and consume the target's last-layer activations (architecture per the MTP overview). For this target the paired drafter is google/gemma-4-26B-A4B-it-assistant (0.4 B params, BF16). Google reports up to 3× decode speedup with no quality degradation on the 26B-A4B configuration, and **2.2×** on Apple Silicon at batch sizes 4–8. Tested runtimes named in the blog: LiteRT-LM, MLX, Hugging Face Transformers, vLLM, SGLang, Ollama.
Integration cost is one kwarg in Hugging Face Transformers:
target = AutoModelForCausalLM.from_pretrained("Truthseeker87/solarhive-26b-a4b-nf4", device_map="cuda:0", ...)
assistant = AutoModelForCausalLM.from_pretrained("google/gemma-4-26B-A4B-it-assistant", dtype=torch.bfloat16, ...)
target.generate(**inputs, assistant_model=assistant) # MTP enabled
The integration ships as a gated future-iteration cell (§14, _RUN_MTP_DEMO = False) in solarhive_inference.py; reviewers can flip the flag to reproduce a baseline-vs-MTP comparison under argmax decoding.
Open question specific to this NF4-quantized target. Per the 2023 speculative-sampling guarantee, correctness is invariant to drafter quality — the target's verification step preserves the exact output distribution regardless of what the drafter proposes. What varies is acceptance rate α, since Google's released drafter is a BF16 model trained against the base gemma-4-26B-A4B-it, not against this NF4-quantized LoRA-merged target. Measured α for the BF16-drafter × NF4-target pairing is the planned post-hackathon contribution.
Companion Repositories
| Model | Repository | Purpose |
|---|---|---|
| SolarHive 26B A4B NF4 | This repo | Pre-quantized partial NF4 cloud model. 48.34 GB on disk; used 49.2 GB of GPU memory on one GPU in the May 2026 run |
| SolarHive 26B A4B Merged | solarhive-26b-a4b-merged | Full BF16 precision cloud model |
| SolarHive 26B A4B LoRA | solarhive-26b-a4b-lora | LoRA adapters from Unsloth fine-tune |
| SolarHive E4B LoRA | solarhive-e4b-lora | E4B adapter weights (about 165 MB) — apply over base via Unsloth |
| SolarHive E4B safetensors | solarhive-e4b-ollama | Edge model — merged safetensors source for GGUF conversion via llama.cpp |
| SolarHive E4B GGUF | solarhive-e4b-gguf | Edge deployment. Q4_K_M GGUF + mmproj for Ollama / llama.cpp on a 16 GB CPU laptop. 5 of 5 tool routing in one local run (Q&A not graded; results file not committed). |
| SolarHive Dataset | solarhive-community-solar-multimodal | 1,727 training examples (1,713 text + 14 image-grounded) |
| Demo (paused) | HF Space | Gradio demo. The Space is paused. |
| LiteRT-LM Python runtime demo (base model) | solarhive_e4b_litert_v3.1.ipynb |
LiteRT Special Tech Track entry. It runs the upstream base litert-community/gemma-4-E4B-it-litert-lm .litertlm bundle (3.66 GB), not the SolarHive fine tune, on a Colab x86 CPU (notebook 5: 8.29 tok/s decode, 41.38 s median time to first token). The fine tune did not produce a LiteRT artifact. Current LiteRT Torch releases list Gemma 4 support, so a fine tuned bundle needs a new conversion attempt. |
| GitHub | the-gemma4-good-hackathon-solarhive | Full source code, training and inference notebooks, archived run notebooks. The NF4 quantization notebook is not in the public repository |
Corrections (November 21, 2026)
I corrected the following items on November 21, 2026 after I rechecked this card against the merged GitHub README (Corrections, November 20, 2026), the archived notebooks in archive/final_run/ and the Hugging Face file listings. The files in this repository other than this card are unchanged.
| Item | Previously stated | Corrected to | Cause |
|---|---|---|---|
| Domain Q&A metadata and scores | Domain Q&A accuracy 1.0 in metadata; 5/5 Q&A presented as correct answers | Removed from metadata. Q&A is recorded as 5/5 by the script, not graded. | The script sets Q&A to the number of questions (solarhive_inference.py lines 1436 to 1897) |
| Tool Calling metadata | 1.0 | Removed from metadata. The card text reports 4 of 5 tool prompts (May 2026 run). | Notebook 3, cell 47 |
| NF4 8/8 result | NF4 preserves 8/8 benchmark performance; canonical held out set | Reported by the original card only. In the May 2026 run, NF4 scored 4 of 5 on tool routing, the same as merged. | No NF4 8 question notebook in the GitHub repository |
| When2Call source label | 3/3 inferred from the A4B LoRA by lossless equivalence | 3/3 measured in a single run | Notebook 3, cell 47 |
| Quantization claims | NF4 is quantization lossless on this benchmark; partial quantization preserves quality | Removed. One run on small sets. | Single run |
| CPU offload | About 24 GB with device_map="auto"; fits L4, A10G, RTX 4090; 24+ GB GPUs |
Removed. 49.2 GB on one GPU measured. No CPU offload run archived. | Notebook 3, cell 47; conflict with GitHub README |
| File sizes | About 48 GB NF4; about 48 GB merged; about 13 GB for a fully packed 4-bit file | 48.34 GB NF4 and 51.61 GB merged on disk. The 13 GB figure was removed. | Hugging Face file listings; no source for 13 GB |
| Runtime BitsAndBytesConfig | Live demo approach achieves the same accuracy | Space paused. No accuracy comparison was run. | No comparison in the archived runs |
| E4B failure mode | E4B family fails (d) by calling get_weather |
Cloud E4B variants failed (c). The GGUF failed (d). | Notebook 3, cells 39 and 41 |
| Held out wording | "Held-out" questions and probes | Not held out. Close paraphrases of the When2Call probes appear in the training data. | solarhive_datagen.py lines 2717, 5079 and 5107 |
| When2Call paper | 9 to 67% tool hallucination rates on (c) and (d) in untrained models | Removed. The paper links missing follow up and unable to answer data to higher hallucination. | The range is not stated in the paper and is not per category |
| Model size claims | The A4B and E4B When2Call gap is the empirical signature of size versus refusal scaling; upstream benchmark gaps predict it | Removed. One run on three lenient probes. Upstream scores kept as context only. | The When2Call paper's results do not trend consistently with size (arXiv 2504.18851, Table 3) |
| Model selection section | Evaluated all four sizes; E2B and E4B include video; MRCR measures multi round tool calling; about 95% of 31B quality; 31B is 2 to 4 times slower; best domain absorption | Compared using published benchmarks. Text, image and audio. Long context retrieval. About 3 points behind 31B on MMMU Pro and MMLU Pro. Speed not measured. Lowest training loss, no validation loss. | Gemma 4 model card; no speed or validation measurement |
| Project description | Intelligence layer that eliminates stranded capacity | Learning prototype. Controls no real equipment. | No equipment control; no real community test |
| Live demo | Live Hugging Face Space demo | Paused | Hugging Face Space runtime status |
| Prompt repetition | Repeating the system prompt improves instruction following (47 of 70 wins) | The paper repeated the full query. This project did not measure system prompt repetition. | arXiv 2512.14982 |
| LiteRT companion row | On device agentic loop; fine tuned bundle waits on an ai_edge_torch example module |
Base model run on a Colab x86 CPU. The fine tune did not produce a LiteRT artifact. Current LiteRT Torch releases list Gemma 4 support. | Notebook 5 uses the base model; LiteRT Torch releases |
| GGUF companion score | 10/10 project held out check | 5 of 5 tool routing in one local run. Q&A not graded. Results file not committed. | No GGUF results file in the GitHub repository |
| Missing files | References to test_ollama_tools.py and other notebooks as repository files |
Marked as not in the public GitHub repository | GitHub file tree, November 21, 2026 |
| Training data formula and host | Not mentioned | Added a limitation: the data used 0.4% per °F on air temperature and the old NREL host. The code is fixed. Regeneration and retraining are pending. | GitHub README Known Limitations, November 20, 2026 |
| Base model license wording | Gemma Terms (base model) | Apache 2.0 (base model). The SolarHive files stay MIT. | Live Google Gemma 4 Hugging Face model pages and license page, November 21, 2026 |
| Base model ID casing | google/gemma-4-26b-a4b-it |
google/gemma-4-26B-A4B-it |
Canonical Hugging Face model ID. The lowercase ID resolves only through a redirect. |
| E4B LoRA adapter size | About 200 MB | About 165 MB | adapter_model.safetensors in solarhive-e4b-lora is 165,012,392 bytes in the Hugging Face file listing, November 21, 2026 |
| Pool heater routing example | Calls all 5 tools | get_weather(), get_solar_production(), get_battery_state() and get_grid_status() |
The GitHub README and the other cards list these four tools |
| Companion table wording | Production inference | Full BF16 precision cloud model | No production deployment exists |
I rechecked the scores, sizes, probe results and file names against notebook 2 (2_solarhive_finetune_finalrun_Apr2026.ipynb), notebook 3 (3_solarhive_inference_finalrun_May2026.ipynb), solarhive_inference_e4b_gguf_ollama.py, the GitHub file tree and the Hugging Face API on November 21, 2026.
Citation
@misc{solarhive2026,
title={SolarHive: AI-Powered Community Solar Energy Intelligence},
author={Youshen Lim},
year={2026},
url={https://github.com/youshen-lim/the-gemma4-good-hackathon-solarhive},
note={Gemma 4 Good Hackathon submission — Google DeepMind x Kaggle}
}
Gemma is a trademark of Google LLC.
- Downloads last month
- 63
Model tree for Truthseeker87/solarhive-26b-a4b-nf4
Base model
google/gemma-4-26B-A4B